:root {
  --inset: 16px;
  --accent: #c8cdd6;
  --on-accent: #0c0d10;
  --bg: #050506;
  --panel: #14161c;
  --ink: #f3f4f6;
  --mid: #a9afba;
  --muted: #6e7582;
  --glass: 76%;
  --blur: 18px;
  --scale: 1;
  --json-size: 13px;
  --json-wrap: pre-wrap;
  --dur: 420ms;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: 16px;
  --line: color-mix(in srgb, var(--ink) 10%, transparent);
  --line-strong: color-mix(in srgb, var(--ink) 18%, transparent);
  --sans: Geist, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --dot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Ccircle cx='6' cy='6' r='2.2' fill='%23f4f4f5' stroke='%230c0d10' stroke-width='0.8'/%3E%3C/svg%3E") 6 6, auto;
  color-scheme: dark;
}

html[data-speed="fast"] { --dur: 180ms; }
html[data-speed="slow"] { --dur: 860ms; }
html[data-density="dense"] { --pad: 10px; }
html[data-scheme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
@media (pointer: fine) {
  html, html * { cursor: var(--dot) !important; }
  input, textarea, pre, .json-view { cursor: text !important; }
  button, a, label, .choice, .osint-stat, .copyable { cursor: pointer !important; }
}
@keyframes pulse {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}
.skeleton-card {
  height: 64px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(100deg, var(--line) 30%, var(--line-strong) 50%, var(--line) 70%);
  background-size: 200% 100%;
  animation: pulse 1.2s ease-in-out infinite;
}
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.011em;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at var(--glow-x, 50%) var(--glow-y, 38%), color-mix(in srgb, var(--accent) var(--glow-bright, 10%), transparent) 0%, color-mix(in srgb, var(--accent) calc(var(--glow-bright, 10%) * 0.45), transparent) var(--glow-edge, 28%), transparent var(--glow-size, 46%)),
    var(--wall, none);
  background-size: auto, cover;
  background-position: center, center;
  background-attachment: fixed;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: transparent;
}
html[data-wall="on"] body {
  background-image: var(--wall, none);
  background-size: cover;
}
html[data-wall="on"] body::before {
  background: color-mix(in srgb, var(--bg) var(--wall-dim), transparent);
}
.gate-wrap { position: relative; z-index: 1; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.file-proxy {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
label.ghost { display: inline-flex; align-items: center; cursor: pointer; }
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.float {
  position: fixed;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(960px, calc(100vw - 28px));
  zoom: var(--scale);
}

.gate-wrap {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.shell {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  height: min(680px, calc(100vh - 28px));
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow:
    0 30px 80px rgb(0 0 0 / 42%),
    inset 0 1px 0 color-mix(in srgb, var(--ink) 12%, transparent);
  overflow: hidden;
  animation: pop var(--dur) var(--ease);
}
.shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: color-mix(in srgb, var(--panel) var(--glass), transparent);
  backdrop-filter: blur(var(--blur)) saturate(1.15);
  pointer-events: none;
}
.shell > * { position: relative; z-index: 1; }
.gate-shell {
  width: min(420px, 100%);
  height: auto;
  padding-bottom: 22px;
}

.top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px var(--pad);
  border-bottom: 1px solid var(--line);
  user-select: none;
}
#drag { cursor: default; }
.mark, .avatar {
  width: 32px;
  height: 32px;
  object-fit: contain;
  background: transparent;
  border: 0;
  flex-shrink: 0;
  transform: translateZ(0);
}
.avatar { width: 36px; height: 36px; border-radius: 50%; }
.brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.brand-mark { color: var(--accent); margin-left: 0.28em; font-weight: 550; }
.ver {
  margin-top: 2px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: -0.01em;
  color: var(--muted);
}
.brand-block { flex: 1; min-width: 0; }
.text-btn, .ghost, .reset-btn, .config-actions .ghost, .wall-clear {
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.011em;
  text-transform: none;
  border-radius: 10px;
  padding: 8px 14px;
  min-height: 36px;
}
.text-btn:hover, .ghost:hover, .reset-btn:hover, .wall-clear:hover {
  filter: brightness(1.08);
}
.ghost:disabled, .text-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.choice {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  padding: 4px 10px;
  min-height: 30px;
}
.choice:hover { color: var(--ink); }

.body { display: flex; min-height: 0; flex: 1; }
aside {
  width: 228px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border-right: 1px solid var(--line);
  position: relative;
}
.menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow: auto;
  min-height: 0;
}
.menu-item {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--mid);
  text-align: left;
  padding: 7px 10px;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.menu-item svg,
.module-chip svg,
.sheet-item svg,
.m-nav svg,
.m-icon svg,
.dock-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.menu-label { flex: 1; font-size: 13.5px; font-weight: 500; letter-spacing: -0.01em; }
.menu-item:hover { color: var(--ink); }
.source-list .menu-item.active {
  background: transparent;
  color: var(--accent);
  box-shadow: none;
}
.source-list .menu-item.active .pill { color: var(--accent); }
.menu-item::after, .query button::after, .primary::after, .wall-pick::after {
  content: none;
}
.query button, .primary, .wall-pick { position: relative; overflow: hidden; }
.pill {
  font-family: var(--sans);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.menu-gap { height: 8px; margin: 4px 10px; border-top: 1px solid var(--line); }

.profile-slot { position: relative; z-index: 2; }
.profile {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 2px 10px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  padding: 10px;
  text-align: left;
}
.profile:hover { border-color: var(--line-strong); }
.avatar { grid-row: span 2; }
.local-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}
.identity {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
}
.identity .avatar { width: 52px; height: 52px; }
.identity-fields { display: flex; flex-direction: column; gap: 6px; }
.identity-fields input {
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  outline: none;
  padding: 6px 0;
  font: inherit;
}
.identity-fields input:focus { border-bottom-color: var(--accent); }
.identity-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cropper {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(0 0 0 / 62%);
}
.crop-card {
  width: min(360px, calc(100vw - 28px));
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(18px);
}
.crop-title { margin: 0 0 12px; font-weight: 550; }
.crop-stage {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
  cursor: grab;
  touch-action: none;
}
.crop-stage:active { cursor: grabbing; }
.crop-stage img {
  position: absolute;
  max-width: none;
  user-select: none;
  pointer-events: none;
}
.crop-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, white 35%, transparent);
  pointer-events: none;
}
.crop-zoom { margin-top: 14px; }
.crop-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.profile-name {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.profile-meta {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: var(--accent);
}
.profile-meta.off { color: var(--muted); }
.profile-tokens {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--mid);
}
.profile-window {
  position: absolute;
  z-index: 6;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  width: auto;
}
.profile-shell {
  height: auto;
  max-height: min(420px, calc(100vh - 120px));
  background: var(--panel);
  animation: pop var(--dur) var(--ease);
}
.profile-shell::before { display: none; }
.profile-who {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0 14px;
}
.profile-who .avatar { width: 48px; height: 48px; }
.profile-who strong, .profile-who span { display: block; }
.profile-who strong { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.profile-who span { margin-top: 2px; color: var(--muted); font-size: 12px; }
#view-profile { display: flex; flex-direction: column; gap: 14px; max-width: 560px; color: #fff; }
#view-profile h1 { margin: 4px 0 2px; font-size: 28px; letter-spacing: -0.03em; color: #fff; }
#view-profile .profile-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: transparent;
}
.profile-hero { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; }
.profile-hero .avatar { width: 72px; height: 72px; border-radius: 18px; }
.profile-edit { display: flex; flex-direction: column; gap: 6px; }
#view-profile .profile-edit span,
#view-profile .local-note,
#view-profile .k,
#view-profile .section,
#view-profile .spent-chip span { color: #fff; }
.profile-edit input {
  border: 0;
  border-bottom: 1px solid rgb(255 255 255 / 40%);
  background: transparent;
  outline: none;
  padding: 6px 0;
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 550;
  letter-spacing: -0.02em;
}
.profile-edit input:focus { border-bottom-color: var(--accent); }
.spent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.spent-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: transparent;
  color: #fff;
}
.spent-chip span { color: var(--muted); font-size: 11px; }
.spent-chip strong { font-size: 14px; font-weight: 550; letter-spacing: -0.02em; }
.profile-body {
  overflow: auto;
  padding: 6px 16px 16px;
}
#view-profile .row, .profile-body .row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
#view-profile .k, .profile-body .k {
  color: #fff;
  font-size: 12px;
}
#view-profile .v, .profile-body .v {
  text-align: right;
  font-family: var(--sans);
  font-size: 12px;
  overflow-wrap: anywhere;
  color: #fff;
}
#view-profile .ghost { color: #fff; }
#view-profile .section, .profile-body .section {
  margin: 16px 0 2px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 550;
  letter-spacing: -0.01em;
  text-transform: none;
  color: #fff;
}
.profile-body ul { list-style: none; margin: 0; padding: 0; }
.profile-body li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--mid);
}
.profile-body .tx {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-body .amt {
  flex-shrink: 0;
  font-family: var(--sans);
  color: var(--ink);
}
.profile-body .empty-tx { color: var(--muted); }

.pane { flex: 1; min-width: 0; overflow: auto; padding: 22px 24px 36px; }
.pane-view.swap { animation: enter var(--dur) var(--ease); }
.record, .json-view { animation: enter calc(var(--dur) * 1.15) var(--ease); }
.pane-head { margin-top: 8px; }
.pane-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.pane-head p { margin: 6px 0 0; color: var(--mid); font-size: 14px; }
.cost {
  margin-top: 8px !important;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.query {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 48%, transparent);
}
.query:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.query input, .query textarea {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  padding: 8px 10px;
  font-family: var(--sans);
  font-size: 13px;
  color: inherit;
}
.query textarea {
  min-height: 76px;
  resize: vertical;
  line-height: 1.45;
}
.query .add-line {
  align-self: flex-end;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mid);
}
.photo-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--mid);
  font-size: 13px;
}
.photo-pick img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.photo-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.query input::placeholder { color: var(--muted); }
.query button, .gate-form button, .primary, .wall-pick, .reset-btn, .text-btn {
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease), background var(--dur) var(--ease), filter var(--dur) var(--ease);
}
.query button:active, .gate-form button:active, .primary:active, .wall-pick:active, .reset-btn:active {
  transform: scale(0.98);
}
.query button, .gate-form button, .primary, .wall-pick {
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 550;
  letter-spacing: -0.015em;
  padding: 8px 16px;
  min-height: 38px;
}
.query button:disabled { opacity: 0.45; cursor: progress; }

.warn {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.warn.low { color: #e7b2a8; }
.history { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.history:empty { display: none; }
.history-label {
  width: 100%;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--muted);
}
.history-item {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mid);
  border-radius: 999px;
  min-height: 30px;
  padding: 4px 10px;
  font-family: var(--sans);
  font-size: 11px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-item:hover { color: var(--ink); border-color: var(--line-strong); }
html[data-stream="on"] .mask,
html[data-stream="on"] .history-item,
html[data-stream="on"] .history-item span,
html[data-stream="on"] .hist-main strong,
html[data-stream="on"] .recent-strip .history-item,
html[data-stream="on"] .profile-tokens,
html[data-stream="on"] .profile-body .v.mask,
html[data-stream="on"] #view-profile .v.mask,
html[data-stream="on"] .admin-mint-key,
html[data-stream="on"] .admin-title strong,
html[data-stream="on"] .json-view,
html[data-stream="on"] .osint-stat strong,
html[data-stream="on"] .osint-row,
html[data-stream="on"] .osint-card strong,
html[data-stream="on"] .photo-hit,
html[data-stream="on"] #query,
html[data-stream="on"] #query-lines,
html[data-stream="on"] #photo-name,
html[data-stream="on"] #mod-cost,
html[data-stream="on"] #cost-warn,
html[data-stream="on"] #view-result .pane-head p {
  filter: blur(6px);
  user-select: none;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  padding: 0;
}
.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.icon-btn:hover { color: var(--ink); }
.source-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--dur) var(--ease);
}
.source-list.open { max-height: 480px; overflow: auto; }
.source-list > .menu-item { padding-left: 18px; }
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--mid);
}
.pager .ghost { min-width: 88px; font-family: var(--sans); text-transform: none; letter-spacing: -0.011em; }
.json-filter {
  flex: 1;
  min-width: 120px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  outline: none;
  padding: 6px 0;
  font-family: var(--sans);
  font-size: 12px;
}
.json-filter:focus { border-bottom-color: var(--accent); }
.copyable { cursor: pointer; }
.copyable:hover { text-decoration: underline; text-underline-offset: 3px; }
.results { margin-top: 18px; }
.empty { margin: 28px 0 0; color: var(--muted); font-size: 13px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar-actions { display: flex; gap: 12px; flex-shrink: 0; }
.json-view {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: var(--json-size);
  line-height: 1.65;
  white-space: var(--json-wrap);
  color: var(--mid);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--ink) 22%, transparent) transparent;
}
.json-view::-webkit-scrollbar { width: 6px; height: 6px; background: transparent; }
.json-view::-webkit-scrollbar-track { background: transparent; }
.json-view::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink) 22%, transparent);
  border-radius: 99px;
}
.json-view::-webkit-scrollbar-corner { background: transparent; }
.json-view .jk { color: var(--muted); }
.json-view .js { color: var(--ink); }
.json-view .jn { color: var(--mid); }
.json-view .jb { color: var(--accent); }

.osint { display: flex; flex-direction: column; gap: 16px; margin-top: 4px; }
.osint-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.osint-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px;
}
.osint-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  color: var(--mid);
  text-align: left;
}
.osint-stat span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.osint-stat strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 550;
  letter-spacing: -0.02em;
  line-height: 1.35;
  word-break: break-word;
}
.osint-stat[data-tone="bad"] strong, .osint [data-tone="bad"] { color: #e07a72; }
.osint-stat[data-tone="warn"] strong, .osint [data-tone="warn"] { color: #d2a15a; }
.osint-stat[data-tone="ok"] strong, .osint [data-tone="ok"] { color: #7dae86; }
.osint-block h2 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: -0.02em;
}
.osint-list, .osint-cards { display: flex; flex-direction: column; gap: 6px; }
.osint-row {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  text-align: left;
}
.osint-row:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.osint-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 3%, transparent);
}
.osint-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.osint-card-top strong { font-size: 14px; letter-spacing: -0.02em; }
.osint-card p { margin: 6px 0 0; }
.osint-meta, .osint-card-top span { color: var(--mid); font-size: 12px; }
.osint-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.osint-tag {
  padding: 3px 8px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--mid);
  font-size: 11px;
}
.osint-links { display: flex; gap: 14px; align-items: center; }
.osint-map {
  align-self: flex-start;
  color: var(--mid);
  font-size: 12px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.photo-hit { display: flex; gap: 12px; align-items: flex-start; }
.photo-hit > img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}
.photo-hit strong { display: block; }
.photo-hit a {
  display: block;
  margin-top: 6px;
  color: var(--mid);
  font-size: 12px;
  word-break: break-all;
}
.osint-raw summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
}
.osint-raw .json-view { margin-top: 8px; }

.group {
  margin: 0 0 22px;
  padding: 0;
}
.group h2 {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 550;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--muted);
}
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  min-height: 42px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.choices button, .ghost, .reset-btn, .config-row, .lang-item, .wall-pick, .wall-clear {
  white-space: nowrap;
}
.slider-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px 12px;
  min-height: 48px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.slider-row input[type="range"] { grid-column: 1 / -1; width: 100%; }
.set-val {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--muted);
}
.choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px;
  max-width: 100%;
  padding: 3px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}
.choice {
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--sans);
  font-size: 13px;
  border-radius: 7px;
  min-height: 30px;
  padding: 4px 10px;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.choice.on {
  background: var(--accent);
  color: var(--on-accent);
}
.wall-card {
  position: relative;
  height: 108px;
  margin: 4px 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg) center / cover no-repeat;
}
.wall-card.has { background-image: var(--wall); }
.wall-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) var(--wall-dim), transparent);
}
.wall-card span {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: 100%;
  padding-top: 22px;
  color: var(--muted);
  font-size: 13px;
}
.wall-card.has span { display: none; }
.wall-pick, .wall-clear {
  position: absolute;
  z-index: 2;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 550;
  letter-spacing: -0.011em;
  cursor: pointer;
}
.wall-pick {
  left: 12px;
  background: var(--accent);
  color: var(--on-accent);
}
.wall-clear {
  right: 12px;
  background: var(--accent);
  color: var(--on-accent);
}
.wall-clear:disabled { opacity: 0.35; cursor: default; }
.lang-row { position: relative; }
.lang-current, .lang-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.flag {
  width: 18px;
  height: 12px;
  flex-shrink: 0;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent);
}
.lang-menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  right: 0;
  min-width: 196px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  box-shadow: 0 18px 40px rgb(0 0 0 / 28%);
  backdrop-filter: blur(18px);
  animation: drop var(--dur) var(--ease);
}
.lang-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  border-radius: 7px;
  min-height: 36px;
  padding: 6px 8px;
  font-size: 13px;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.lang-item:hover, .lang-item.on { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.lang-item:hover { transform: translateX(2px); }
.reset-btn { font-weight: 500; }
.reset-btn:hover { border-color: var(--accent); }
input[type="color"] {
  width: 36px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
}
input[type="range"] {
  appearance: none;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --pct: 0%;
}
input[type="range"]:focus-visible { outline-offset: 4px; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(to right, var(--accent) var(--pct), color-mix(in srgb, var(--ink) 16%, transparent) var(--pct));
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5.5px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  background: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}
input[type="range"]::-moz-range-track {
  height: 3px;
  border: 0;
  border-radius: 99px;
  background: color-mix(in srgb, var(--ink) 16%, transparent);
}
input[type="range"]::-moz-range-progress {
  height: 3px;
  border-radius: 99px;
  background: var(--accent);
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
}
.config-row, .save-row, .config-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.config-row {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 10px 0;
  min-height: 42px;
}
.config-row.active .config-name { color: var(--accent); }
.swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
}
.config-name { flex: 1; }
.save-row { margin-top: 12px; }
.save-row input, .key-line input {
  flex: 1;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  outline: none;
  padding: 8px 0;
  font-family: var(--sans);
  font-size: 13px;
}
.save-row input:focus, .key-line input:focus { border-bottom-color: var(--accent); }
.config-actions { margin-top: 12px; flex-wrap: wrap; gap: 8px; }
.toolbar-actions { display: flex; gap: 8px; flex-shrink: 0; }
.icon-x {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 32px;
  padding: 4px 6px;
}
.icon-x:hover { color: var(--ink); }

.gate-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding: 8px var(--pad) 0;
}
.key-line { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.key-line span {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: -0.011em;
  text-transform: none;
  color: var(--muted);
}
.error {
  margin: 14px var(--pad) 0;
  color: #e7b2a8;
  font-family: var(--sans);
  font-size: 12px;
}

.loadbar {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  width: 28%;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
}
.shell.is-busy .loadbar {
  opacity: 1;
  animation: sweep 1s var(--ease) infinite;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 40;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(460px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  color: var(--ink);
  font-size: 13px;
  backdrop-filter: blur(16px);
  animation: drop var(--dur) var(--ease);
}
.toast button { min-height: 32px; padding: 6px 12px; font-size: 13px; }
.toast .ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mid);
  border-radius: 8px;
}

@keyframes pop {
  from { opacity: 0; translate: 0 16px; scale: 0.98; }
  to { opacity: 1; translate: 0 0; scale: 1; }
}
@keyframes sheen {
  to { transform: translateX(120%); }
}
@keyframes enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes drop {
  from { opacity: 0; translate: 0 8px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes sweep {
  from { transform: translateX(-120%); }
  to { transform: translateX(420%); }
}

::-webkit-scrollbar { width: 8px; height: 8px; background: transparent; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ink) 18%, transparent); border-radius: 99px; }
::-webkit-scrollbar-corner { background: transparent; }

html[data-ui="legacy"] {
  --sans: Geist, "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --radius: 8px;
}
html[data-ui="legacy"] body {
  background-image: none;
  overflow: hidden;
  font-size: 13px;
  letter-spacing: 0;
}
html[data-ui="legacy"] body::before { display: none; }
html[data-ui="legacy"] .shell::before { display: none; }
html[data-ui="legacy"] .float {
  inset: 0;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  transform: none;
  zoom: 1;
}
html[data-ui="legacy"] #shell {
  height: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  box-shadow: none;
  background: var(--panel);
  animation: none;
}
html[data-ui="legacy"] .top,
html[data-ui="legacy"] aside,
html[data-ui="legacy"] .pane,
html[data-ui="legacy"] .dock,
html[data-ui="legacy"] .profile,
html[data-ui="legacy"] .query,
html[data-ui="legacy"] .menu-item,
html[data-ui="legacy"] .menu-item.active,
html[data-ui="legacy"] .card,
html[data-ui="legacy"] .json-view,
html[data-ui="legacy"] .profile-shell,
html[data-ui="legacy"] .crop-card,
html[data-ui="legacy"] .lang-menu {
  box-shadow: none;
  backdrop-filter: none;
}
html[data-ui="legacy"] .top {
  background: color-mix(in srgb, var(--ink) 5%, var(--panel));
  border-bottom: 1px solid var(--line);
  min-height: 42px;
}
html[data-ui="legacy"] aside {
  width: 220px;
  background: color-mix(in srgb, var(--bg) 28%, var(--panel));
  border-right: 1px solid var(--line);
  padding: 10px;
}
html[data-ui="legacy"] .menu-item {
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 13px;
  padding: 5px 10px;
}
html[data-ui="legacy"] .menu-item:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
html[data-ui="legacy"] .menu-item.active,
html[data-ui="legacy"] .source-list .menu-item.active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  box-shadow: none;
}
html[data-ui="legacy"] .menu-item.active .pill { color: var(--on-accent); }
html[data-ui="legacy"] .source-list .menu-item.active .pill { color: var(--accent); }
html[data-ui="legacy"] .query,
html[data-ui="legacy"] input,
html[data-ui="legacy"] textarea {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 55%, var(--panel));
  border-radius: var(--radius);
  box-shadow: none;
  color: var(--ink);
}
html[data-ui="legacy"] .pane { background: var(--panel); }
html[data-ui="legacy"] .pane-head h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; }
html[data-ui="legacy"] .osint-stat,
html[data-ui="legacy"] .osint-card,
html[data-ui="legacy"] .profile-card,
html[data-ui="legacy"] .osint-row {
  border-radius: var(--radius);
  border-color: var(--line);
  background: color-mix(in srgb, var(--ink) 4%, var(--panel));
  box-shadow: none;
}
html[data-ui="legacy"] .admin-create,
html[data-ui="legacy"] .admin-mint,
html[data-ui="legacy"] .admin-role.on { border-radius: 0; }
html[data-ui="legacy"] .query button,
html[data-ui="legacy"] .text-btn,
html[data-ui="legacy"] .ghost,
html[data-ui="legacy"] .primary,
html[data-ui="legacy"] .reset-btn,
html[data-ui="legacy"] .wall-pick,
html[data-ui="legacy"] .wall-clear,
html[data-ui="legacy"] .choice.on {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink) 6%, var(--panel));
  color: var(--ink);
  box-shadow: none;
  min-height: 32px;
  font-size: 13px;
}
html[data-ui="legacy"] .primary,
html[data-ui="legacy"] .query button {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
  box-shadow: none;
}
html[data-ui="legacy"] button:active {
  box-shadow: inset 0 1px 2px color-mix(in srgb, var(--bg) 55%, transparent);
}
html[data-ui="legacy"] .brand { font-weight: 600; letter-spacing: -0.03em; }
html[data-ui="legacy"] .json-view {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: color-mix(in srgb, var(--bg) 65%, var(--panel));
}
html[data-ui="legacy"] .profile,
html[data-ui="legacy"] .module-chip,
html[data-ui="legacy"] .dock-item { border-radius: var(--radius); }
html[data-ui="legacy"] .profile-shell {
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--panel);
  backdrop-filter: none;
}
html[data-ui="legacy"] .gate-wrap { padding: 0; }
html[data-ui="legacy"] .gate-shell {
  width: min(480px, 100%);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
}

.dock, .module-row, .app-back, .app-title, .avatar-btn, .crumb, .net, .desk-menu { display: none; }
.sheet { display: none; }

@media (min-width: 761px) {
  .float {
    inset: var(--inset);
    left: var(--inset);
    top: var(--inset);
    width: auto;
    height: auto;
    transform: none;
  }
  .shell {
    height: 100%;
    max-height: none;
    border-radius: 16px;
  }
  .top {
    min-height: 52px;
    padding: 8px 16px;
    gap: 12px;
  }
  .top .mark { width: 22px; height: 22px; }
  .brand { font-size: 14px; }
  .ver { font-size: 11px; }
  .brand-block { flex: 0 1 auto; }
  .crumb {
    display: block;
    flex: 1;
    min-width: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .net {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    flex-shrink: 0;
  }
  .net::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #7dae86;
  }
  html[data-net="off"] .net::before { background: #e07a72; }
  .top #logout { display: none; }
  aside { width: 240px; padding: 12px 10px 10px; gap: 4px; }
  .menu-kicker {
    margin: 14px 10px 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 550;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .menu-kicker:first-child { margin-top: 2px; }
  .source-list { max-height: none; overflow: visible; }
  .source-list.open { max-height: none; }
  .source-list > .menu-item { padding-left: 10px; }
  .menu-item { min-height: 34px; border-radius: 8px; }
  .menu-item.active {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--ink);
    box-shadow: inset 2px 0 0 var(--accent);
  }
  .source-list .menu-item.active {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--ink);
  }
  .menu-item:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
  .pane { padding: 28px 32px 48px; }
  .pane-view { width: min(1180px, 100%); }
  #view-sources .results, #view-admin { width: min(1280px, 100%); }
  .pane-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; margin: 0 0 20px; }
  .head-copy { flex: 1 1 280px; min-width: 0; }
  .pane-head h1 { font-size: 28px; letter-spacing: -0.04em; }
  .pane-head p { max-width: 52ch; }
  .meta-row { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
  .meta-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.01em;
  }
  .cost { display: none; }
  .query {
    margin-top: 0;
    padding: 8px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--ink) 3%, transparent);
  }
  .query input, .query textarea { font-size: 14px; min-height: 40px; }
  .photo-pick {
    min-height: 88px;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    justify-content: center;
  }
  .results { margin-top: 28px; }
  .toolbar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 8px 0;
    background: color-mix(in srgb, var(--panel) 92%, transparent);
    backdrop-filter: blur(10px);
  }
  .osint-metrics { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .osint-stat { min-height: 72px; }
  .json-view {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    background: color-mix(in srgb, var(--bg) 55%, transparent);
    max-height: min(62vh, 720px);
  }
  .empty {
    margin: 36px 0 0;
    padding: 20px 0;
    border-top: 1px solid var(--line);
    max-width: 42ch;
  }
  .desk-menu {
    display: flex;
    flex-direction: column;
    position: fixed;
    z-index: 20;
    min-width: 240px;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 18px 40px rgb(0 0 0 / 32%);
  }
  .desk-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    text-align: left;
    padding: 6px 10px;
    font: inherit;
    font-size: 13px;
  }
  .desk-menu button:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
  .desk-menu .danger { color: #e7b2a8; }
  .desk-settings {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
  }
  .desk-side { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; }
  .desk-side button {
    min-height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--mid);
    text-align: left;
    padding: 6px 10px;
    font: inherit;
    font-size: 13px;
  }
  .desk-side button.on { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--ink); }
  .config-row { border-radius: 8px; padding: 10px 8px; }
  .config-row:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
  .toast { bottom: 28px; }
  .toast.err { border-color: color-mix(in srgb, #e07a72 45%, var(--line)); }
  .toast.ok { border-color: color-mix(in srgb, #7dae86 40%, var(--line)); }
}
html[data-ui="legacy"] .float {
  inset: 0;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  transform: none;
}
html[data-ui="legacy"] .crumb,
html[data-ui="legacy"] .net,
html[data-ui="legacy"] .meta-row,
html[data-ui="legacy"] .desk-menu,
html[data-ui="legacy"] .menu-kicker { display: none !important; }
html[data-ui="legacy"] .top #logout { display: inline-flex; }
@media (min-width: 761px) and (max-width: 1180px) {
  aside { width: 208px; }
  .pane { padding: 20px; }
  .desk-settings { grid-template-columns: 168px minmax(0, 1fr); gap: 16px; }
}
@media (min-width: 1800px) {
  .pane-view { width: min(1240px, 100%); }
}

@media (max-width: 760px) {
  :root {
    --touch: 44px;
    --m-pad: 16px;
    --m-radius: 16px;
    --m-nav: calc(64px + env(safe-area-inset-bottom));
  }
  html, body { height: 100%; overflow: hidden; }
  body { background-attachment: scroll; }
  .gate-wrap {
    min-height: 100dvh;
    min-height: 100svh;
    padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
    align-items: flex-end;
  }
  .gate-shell {
    width: 100%;
    border-radius: 22px 22px 18px 18px;
    padding-bottom: 18px;
  }
  .gate-form { gap: 14px; }
  .gate-form button, .key-line input { min-height: 48px; font-size: 16px; }
  .float {
    inset: 0;
    width: 100%;
    height: 100dvh;
    height: 100svh;
    transform: none;
    zoom: 1;
  }
  .shell {
    height: 100%;
    max-height: none;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .top {
    min-height: calc(56px + env(safe-area-inset-top));
    padding: max(8px, env(safe-area-inset-top)) var(--m-pad) 8px;
    gap: 10px;
  }
  .top .mark, .top .brand-block, .top #logout { display: none; }
  #stream-btn {
    display: inline-flex;
    width: var(--touch);
    height: var(--touch);
    border-radius: 14px;
    margin-left: auto;
    flex-shrink: 0;
  }
  .app-back, .avatar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--touch);
    height: var(--touch);
    border: 0;
    border-radius: 14px;
    background: color-mix(in srgb, var(--ink) 6%, transparent);
    color: var(--ink);
    padding: 0;
    flex-shrink: 0;
  }
  .app-back svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .app-title {
    display: block;
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  html[data-depth="root"] .app-back { display: none; }
  html[data-depth="child"] #stream-btn { margin-left: 0; }
  html[data-depth="child"] .app-title { margin-right: auto; }
  html[data-depth="root"] .top .mark,
  html[data-depth="root"] .top .brand-block { display: block; }
  html[data-depth="root"] .top .brand-block { display: block; flex: 1; }
  html[data-depth="root"] .app-title { display: none; }
  html[data-depth="root"] .avatar-btn { display: inline-flex; }
  .avatar-btn .avatar { width: 32px; height: 32px; }
  aside { display: none; }
  .body { min-height: 0; }
  .pane {
    padding: 8px var(--m-pad) calc(var(--m-nav) + 12px);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .pane-view { animation: none; }
  html[data-motion="on"] .pane-view.swap { animation: enter var(--dur) var(--ease); }
  .pane-head { margin-top: 4px; }
  .pane-head h1 { font-size: 28px; letter-spacing: -0.04em; }
  .pane-head p { display: block; margin-top: 4px; font-size: 14px; }
  .cost { display: block !important; }
  #view-sources .history { display: none; }
  #view-sources #results { display: none; }
  #view-result .results { display: block; margin-top: 8px; }
  .module-row { display: block; margin: 6px 0 14px; }
  .module-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 64px;
    border: 1px solid var(--line);
    border-radius: var(--m-radius);
    background: color-mix(in srgb, var(--ink) 4%, transparent);
    color: var(--ink);
    padding: 10px 12px;
    text-align: left;
  }
  .module-chip svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: var(--accent);
  }
  .module-chip .mod-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
  .module-chip strong { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
  .module-chip span { color: var(--muted); font-size: 12px; font-weight: 500; }
  .module-chip .chev {
    width: 18px;
    height: 18px;
    color: var(--muted);
    flex-shrink: 0;
  }
  .query {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 4px;
    padding: 8px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--ink) 4%, transparent);
  }
  .query input, .query textarea {
    min-height: 52px;
    font-size: 16px;
    padding: 12px;
  }
  .query textarea { min-height: 112px; }
  .query button, .ghost, .text-btn, .primary, .reset-btn { min-height: var(--touch); }
  .query button { width: 100%; }
  .photo-pick { min-height: 56px; font-size: 15px; }
  .warn { font-size: 12px; letter-spacing: 0; min-height: 20px; margin-top: 12px; }
  .dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 8;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel) 86%, transparent);
    backdrop-filter: blur(18px) saturate(1.2);
  }
  .dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 52px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    font-weight: 550;
    letter-spacing: -0.01em;
  }
  .dock-item svg { width: 22px; height: 22px; }
  .dock-item.on { color: var(--accent); background: transparent; }
  .dock-item:active { transform: scale(0.96); }
  .sheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 24;
  }
  .sheet-dim {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgb(0 0 0 / 54%);
    padding: 0;
  }
  .sheet-card {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    max-height: min(86dvh, 720px);
    padding-bottom: env(safe-area-inset-bottom);
    border: 1px solid var(--line-strong);
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    background: var(--panel);
    backdrop-filter: none;
    box-shadow: 0 -24px 60px rgb(0 0 0 / 45%);
    animation: sheet-in var(--dur) var(--ease);
    touch-action: none;
  }
  .sheet-grab {
    width: 36px;
    height: 4px;
    margin: 8px auto 4px;
    border-radius: 99px;
    background: color-mix(in srgb, var(--ink) 28%, transparent);
    flex-shrink: 0;
  }
  .sheet-body {
    overflow: auto;
    padding: 6px 16px 18px;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
  .sheet-search {
    width: 100%;
    min-height: 44px;
    margin: 6px 0 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--bg) 72%, var(--panel));
    color: inherit;
    padding: 0 12px;
    font: inherit;
    font-size: 16px;
    outline: none;
  }
  .sheet-search:focus { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
  .sheet-kicker {
    margin: 12px 2px 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 550;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .sheet-item, .m-row, .m-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    border: 0;
    border-top: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    text-align: left;
    padding: 10px 2px;
    font: inherit;
  }
  .sheet-item.on { color: var(--accent); }
  .sheet-item .mod-copy, .m-row .mod-copy, .m-nav .mod-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
  .sheet-item strong, .m-row strong, .m-nav strong {
    display: block;
    font-size: 15px;
    font-weight: 550;
    letter-spacing: -0.02em;
    color: var(--ink);
  }
  .sheet-item span, .m-row span, .m-nav .mod-copy span { color: var(--muted); font-size: 12px; }
  .m-nav svg:last-child { width: 16px; height: 16px; color: var(--muted); }
  .m-icon svg { width: 18px; height: 18px; }
  .sheet-item svg { width: 20px; height: 20px; }
  .m-list { display: flex; flex-direction: column; }
  .m-day {
    margin: 16px 0 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 550;
  }
  .m-day:first-child { margin-top: 0; }
  .hist-card {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 64px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
  }
  .hist-main {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    padding: 4px 0;
  }
  .hist-main strong, .hist-main span { display: block; }
  .hist-main strong {
    font-size: 15px;
    font-weight: 550;
    letter-spacing: -0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .hist-main span { margin-top: 2px; color: var(--muted); font-size: 12px; }
  .icon-x, .m-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--touch);
    height: var(--touch);
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font-size: 18px;
  }
  .find-row { display: flex; margin: 2px 0 10px; }
  .find-row input, .m-field {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--ink) 4%, transparent);
    color: inherit;
    font: inherit;
    font-size: 16px;
    outline: none;
    padding: 0 12px;
  }
  .find-row input:focus, .m-field:focus { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
  .find-row input::placeholder { color: var(--muted); }
  .state-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 18px;
    padding: 4px 0;
  }
  .state-card .skeleton-card { width: 100%; }
  .state-card strong { font-size: 18px; letter-spacing: -0.03em; font-weight: 600; }
  .state-card p { margin: 0; color: var(--mid); font-size: 14px; }
  .result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 12px;
  }
  .result-chip {
    padding: 4px 8px;
    border-radius: 99px;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
  }
  .osint-metrics { grid-template-columns: 1fr 1fr; }
  .osint-stat { min-height: 72px; }
  .osint-row { min-height: 44px; font-size: 13px; }
  .json-view { max-width: 100%; overflow: auto; }
  .toolbar { align-items: stretch; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .ghost { flex: 1; }
  #view-profile { max-width: none; gap: 12px; }
  #view-profile h1, #view-history > .pane-head h1, #view-modules > .pane-head h1, #view-more > .pane-head h1 { display: none; }
  #view-profile .profile-hero { align-items: center; }
  #view-profile .profile-edit span { font-size: 12px; }
  .logout-row strong { color: #e7b2a8; }
  .profile-hero { grid-template-columns: 64px 1fr; }
  .account-actions { display: flex; flex-direction: column; margin-top: 4px; }
  .account-actions .m-nav { min-height: 52px; }
  .logout-row { color: #e7b2a8; }
  .logout-row .chev { display: none; }
  .logout-row svg { color: #e7b2a8; }
  .set-row { align-items: flex-start; flex-direction: column; min-height: 52px; }
  .choices { width: 100%; justify-content: flex-start; }
  .choice { min-height: 36px; }
  .slider-row { min-height: 56px; }
  input[type="range"]::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -9.5px; }
  input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; }
  .config-row { min-height: 52px; }
  .config-actions .ghost { flex: 1; min-width: 44%; }
  .cropper {
    align-items: flex-end;
    padding: 0;
  }
  .crop-card {
    width: 100%;
    border-radius: 22px 22px 0 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  }
  .crop-stage { width: min(240px, 68vw); height: min(240px, 68vw); }
  .crop-actions { justify-content: stretch; }
  .crop-actions button { flex: 1; }
  .toast {
    bottom: calc(var(--m-nav) + 8px);
    width: calc(100vw - 24px);
    max-width: none;
  }
  .admin-create,
  .admin-mint,
  .admin-keys-head { display: flex; flex-direction: column; align-items: stretch; }
  .admin-find { max-width: none; }
  .admin-create > button[type="submit"],
  .admin-field input,
  .admin-grant input { width: 100%; min-height: 44px; font-size: 16px; }
  .admin-row { align-items: stretch; }
  html[data-ui="legacy"] .module-chip,
  html[data-ui="legacy"] .query,
  html[data-ui="legacy"] .dock-item,
  html[data-ui="legacy"] .dock,
  html[data-ui="legacy"] .sheet-card { border-radius: 0; }
  html[data-depth="child"] .dock { display: none; }
  html[data-depth="child"] .pane { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
  .osint-raw { margin-top: 8px; }
  .osint-list, .json-view, .admin-grant { max-width: 100%; }
  .osint-list { overflow-x: auto; }
  .json-view { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .recent-strip { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; }
  .recent-strip:empty { display: none; }
  .recent-strip .history-item { flex: 0 0 auto; max-width: 180px; min-height: 36px; }
}
@media (max-width: 760px) and (max-height: 480px) {
  .dock { grid-template-columns: repeat(5, 1fr); padding-top: 4px; }
  .dock-item { min-height: 44px; flex-direction: row; gap: 6px; font-size: 12px; }
  .dock-item span { display: none; }
  .pane-head h1 { font-size: 22px; }
  .gate-wrap { align-items: center; }
}
@keyframes sheet-in {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}
.admin-create {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px 12px;
  align-items: end;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 36%, transparent);
}
.admin-create-title {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: -0.01em;
  color: var(--mid);
}
.admin-roles {
  display: flex;
  padding: 3px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}
.admin-role {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  min-height: 34px;
  padding: 4px 12px;
  font-size: 13px;
}
.admin-role.on {
  background: var(--accent);
  color: var(--on-accent);
}
.admin-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 88px;
}
.admin-field span {
  font-size: 11px;
  color: var(--muted);
}
.admin-field input {
  width: 96px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  outline: none;
  padding: 6px 0;
  font-variant-numeric: tabular-nums;
}
.admin-field input:focus { border-bottom-color: var(--accent); }
.admin-create > button[type="submit"] {
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  min-height: 36px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 550;
}
.admin-create > button[type="submit"]:disabled { opacity: 0.45; }
.admin-mint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.admin-mint-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.admin-mint-key {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.02em;
  word-break: break-all;
}
.admin-mint-key:hover { color: var(--accent); }
.admin-mint span { color: var(--muted); font-size: 12px; }
.admin-mint-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.admin-text {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 36px;
  padding: 8px 6px;
  font-size: 13px;
}
.admin-text:hover { color: var(--ink); }
.admin-keys-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}
.admin-keys-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: -0.01em;
  color: var(--mid);
}
.admin-find { margin-top: 0; flex: 1; max-width: 280px; }
.admin-list { display: flex; flex-direction: column; margin-top: 4px; }
.admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.admin-title { display: flex; flex-direction: column; gap: 2px; min-width: 140px; flex: 1; }
.admin-title span { color: var(--muted); font-size: 12px; }
.admin-grant { display: flex; gap: 2px 8px; align-items: center; flex-wrap: wrap; }
.admin-grant input {
  width: 84px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  outline: none;
  padding: 6px 0;
  color: inherit;
  font-variant-numeric: tabular-nums;
}
.admin-grant input:focus { border-bottom-color: var(--accent); }
.admin-grant .admin-text { min-height: 32px; padding: 4px 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
html[data-motion="off"] *,
html[data-motion="off"] *::before,
html[data-motion="off"] *::after {
  animation: none !important;
  transition: none !important;
}
html[data-motion="off"] .menu-item::after,
html[data-motion="off"] .query button::after { display: none; }
@media (prefers-reduced-motion: reduce) {
  .sheet-card, .pane-view.swap, .record, .json-view, .toast { animation: none !important; }
}
