/* Research desk — intake modal + Settings verdict (light/dark via app tokens) */

.rd-overlay {
  position: fixed;
  inset: 0;
  z-index: 12050;
  background: var(--overlay-scrim, rgba(0, 0, 0, 0.55));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.rd-modal {
  width: min(920px, 100%);
  max-height: min(92vh, 880px);
  overflow: auto;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--glow-lg);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 24px 18px;
}

.rd-rail {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.rd-brand {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.rd-brand span {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-left: 8px;
}

.rd-steps {
  display: flex;
  gap: 5px;
  margin-left: auto;
}

.rd-steps i {
  display: block;
  width: 30px;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
}

.rd-steps i.done { background: var(--neon-cyan); }
.rd-steps i.now { background: var(--text-primary); }

.rd-clock {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.rd-eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  margin: 0 0 8px;
}

.rd-eyebrow.alt { color: var(--text-muted); }

.rd-modal h1,
.rd-embed h1,
.rd-review h1 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 650;
  letter-spacing: -0.022em;
  margin: 0 0 8px;
  line-height: 1.2;
  max-width: 26ch;
}

.rd-sub {
  margin: 0 0 14px;
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 66ch;
}

.rd-why {
  font-size: 12px;
  color: var(--text-muted);
  border-left: 2px solid var(--border);
  padding-left: 10px;
  max-width: 66ch;
  line-height: 1.6;
  margin: 12px 0 0;
}

.rd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.rd-tile {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 15px 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  min-width: 0;
}

.rd-tile:hover { border-color: var(--border-active); }
.rd-tile[aria-pressed="true"] {
  border-color: var(--neon-cyan);
  background: color-mix(in srgb, var(--neon-cyan) 12%, var(--bg-card));
}

.rd-tile-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.rd-tile-name {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1;
}

.rd-tile[aria-pressed="true"] .rd-tile-name { color: var(--neon-cyan); }

.rd-tile-clock {
  font-size: 9.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rd-tile-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.rd-tile-keys {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  line-height: 1.6;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: auto;
}

.rd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: min(42vh, 320px);
  overflow-y: auto;
  padding-right: 2px;
}

.rd-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 13px;
  font-size: 13.5px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.rd-chip:hover { border-color: var(--border-active); }
.rd-chip[aria-pressed="true"] {
  background: color-mix(in srgb, var(--neon-cyan) 14%, var(--bg-card));
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  font-weight: 550;
}

.rd-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.rd-field-label {
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rd-seg {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
  width: fit-content;
  max-width: 100%;
}

.rd-seg button {
  background: transparent;
  border: 0;
  border-right: 1px solid var(--border);
  padding: 9px 15px;
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  color: inherit;
  white-space: nowrap;
}

.rd-seg button:last-child { border-right: 0; }
.rd-seg button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--neon-cyan) 14%, var(--bg-card));
  color: var(--neon-cyan);
  font-weight: 650;
}

.rd-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.rd-btn {
  border: 1px solid var(--neon-cyan);
  background: var(--neon-cyan);
  color: var(--bg-primary);
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 650;
  font-size: 14px;
}

html[data-theme="light"] .rd-btn { color: #fff; }
html[data-theme="light"] .rd-btn.ghost { color: var(--text-secondary); }

.rd-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.rd-btn.ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
  font-weight: 500;
}
.rd-btn.ghost:hover { border-color: var(--border-active); color: var(--text-primary); }

.rd-verdict {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  overflow: hidden;
}

.rd-verdict-top {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.rd-verdict-top h2 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 750;
  letter-spacing: -0.035em;
  margin: 0;
  line-height: 1;
}

.rd-verdict-top p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 58ch;
}

.rd-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rd-meta b { color: var(--text-primary); font-weight: 550; }

.rd-halves {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.rd-half { padding: 16px 22px; }
.rd-half + .rd-half {
  border-left: 1px solid var(--border);
  background: var(--bg-hover);
}

.rd-half h3 {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 12px;
  font-weight: 500;
}

.rd-half ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rd-half li {
  display: flex;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.5;
}

.rd-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--neon-cyan);
  flex: none;
  margin-top: 7px;
}

.rd-dot.no { background: var(--loss); }

.rd-switcher { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }

.rd-sw {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 14px;
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: inherit;
}

.rd-sw:hover { border-color: var(--border-active); }
.rd-sw[aria-pressed="true"] {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}
.rd-sw.mine { border-color: var(--neon-cyan); color: var(--neon-cyan); }
.rd-sw.mine[aria-pressed="true"] {
  background: var(--neon-cyan);
  color: var(--bg-primary);
  border-color: var(--neon-cyan);
}

html[data-theme="light"] .rd-sw.mine[aria-pressed="true"] { color: #fff; }

.rd-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  margin-top: 18px;
}

.rd-panel h3 {
  font-size: 16px;
  font-weight: 650;
  margin: 0 0 6px;
}

.rd-panel p {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.rd-taglist { display: flex; flex-wrap: wrap; gap: 6px; }
.rd-tag {
  font-size: 10.5px;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--neon-cyan) 14%, var(--bg-card));
  color: var(--neon-cyan);
}
.rd-tag.none {
  background: var(--bg-hover);
  color: var(--text-muted);
}

/* Settings verdict */
.rd-settings-wrap { position: relative; padding: 0; overflow: hidden; }
.rd-settings-inner { padding: 16px 18px 18px; }
.rd-settings-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.rd-locked {
  position: relative;
}

.rd-locked .rd-settings-inner {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
}

.rd-lock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  background: color-mix(in srgb, var(--bg-elevated) 42%, transparent);
}

.rd-lock p {
  margin: 0;
  max-width: 42ch;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

.rd-embed {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  height: 100%;
}

.rd-embed #rd-stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.rd-embed .rd-bar {
  flex: none;
}

@media (max-width: 820px) {
  .rd-half + .rd-half { border-left: 0; border-top: 1px solid var(--border); }
}
