@import url('./athelgard-grand-theme.css');

:root {
  --bg: #06060e;
  --panel: #0c1020;
  --ink: #e8eef8;
  --muted: #8b9bb4;
  --gold: #d4af37;
  --cyan: #6ec8ff;
  --line: rgba(255, 255, 255, 0.1);
  --user: #1a2744;
  --her: #12182a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
}

body {
  font: 13px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cosmic, var(--bg));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

header {
  padding: 0;
  border-bottom: none;
  background: transparent;
}

header h1 {
  margin: 0;
}

#log {
  flex: 1;
  overflow: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 280px;
}

.msg {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.user {
  background: var(--user);
  border-color: rgba(110, 200, 255, 0.25);
  align-self: flex-end;
  max-width: 92%;
}

.msg.her {
  background: var(--her);
  border-color: rgba(212, 175, 55, 0.25);
}

.msg.meta {
  background: transparent;
  border-style: dashed;
  color: var(--muted);
  font-size: 11px;
}

.msg .who {
  display: block;
  font: 600 10px/1.2 Cinzel, Georgia, serif;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
  color: var(--gold);
}

.msg.user .who { color: var(--cyan); }

footer,
.desk-footer {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  background: var(--panel);
}

#ctx {
  font: 11px/1.3 monospace;
  color: var(--muted);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row {
  display: flex;
  gap: 6px;
}

#input {
  flex: 1;
  resize: none;
  min-height: 54px;
  max-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
}

#input:focus {
  outline: 1px solid rgba(110, 200, 255, 0.45);
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold);
  font: 600 11px/1 Cinzel, Georgia, serif;
  letter-spacing: 0.08em;
  padding: 8px 10px;
  cursor: pointer;
}

button.primary {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.35), rgba(110, 200, 255, 0.15));
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

.actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.actions button {
  flex: 1;
  min-width: 120px;
  font-size: 10px;
  padding: 6px 8px;
}

#interview {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: none;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

#interview.active { display: block; }

#buddyPanel {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

#buddyPanel.hidden { display: none; }

.interview-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(12, 16, 32, 0.8);
}

.interview-block h2 {
  margin: 0 0 8px;
  font: 600 11px/1.2 Cinzel, Georgia, serif;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-transform: uppercase;
}

.interview-block p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.career-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.career-grid button {
  text-align: left;
  width: 100%;
  padding: 10px 12px;
  font: 600 12px Inter, sans-serif;
  letter-spacing: 0;
}

.career-grid button.selected {
  border-color: var(--cyan);
  background: rgba(110, 200, 255, 0.12);
}

#customCareer, #goalInput {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
  margin-bottom: 8px;
}

#customCareer:focus, #goalInput:focus {
  outline: 1px solid rgba(110, 200, 255, 0.45);
}

.interview-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.interview-actions button { flex: 1; }

.tabs {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  max-width: 480px;
}

.tabs.hidden { display: none; }

.tab {
  flex: 1;
  padding: 6px 8px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tab.active {
  color: var(--cyan);
  border-color: rgba(110, 200, 255, 0.35);
  background: rgba(110, 200, 255, 0.08);
}

#bountyPanel {
  flex: 1;
  overflow: auto;
  padding: 12px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

#bountyPanel.hidden { display: none; }

.bounty-radar {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: rgba(212, 175, 55, 0.04);
}

.bounty-radar h3 {
  margin: 0 0 6px;
  font: 600 10px/1.2 Cinzel, Georgia, serif;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
}

.radar-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  padding: 6px 0;
  border-top: 1px dashed var(--line);
  font-size: 11px;
}

.radar-btns {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.radar-btns button {
  font-size: 10px;
  padding: 4px 6px;
}

.bounty-actions-radar {
  margin-bottom: 6px;
}

.bounty-actions-radar button {
  width: 100%;
}

.bounty-stats {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.bounty-next h3, .bounty-queue h3 {
  margin: 0 0 6px;
  font: 600 10px/1.2 Cinzel, Georgia, serif;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
}

.target-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
}

.target-card.selected { border-color: rgba(110, 200, 255, 0.35); }

.muted { color: var(--muted); }
.warn { color: #ffb86c; }

.queue-row {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  gap: 6px;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  margin-bottom: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font-size: 11px;
  cursor: pointer;
}

.queue-row.selected {
  border-color: var(--cyan);
  background: rgba(110, 200, 255, 0.08);
}

.q-pri { color: var(--gold); font-weight: 600; }
.q-id { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-st { color: var(--muted); }
.q-issue { color: var(--cyan); }

.bounty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bounty-actions button {
  font-size: 11px;
  padding: 6px 8px;
}

.bounty-hint {
  margin: 0;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.4;
}

.hidden { display: none !important; }

.lean-prompts {
  padding: 8px 16px 0;
  border-top: 1px dashed var(--line);
  background: rgba(12, 16, 32, 0.6);
}

.lean-prompts-label {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lean-prompt-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}

.lean-prompt-grid button {
  text-align: left;
  font-size: 11px;
  line-height: 1.35;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.lean-prompt-grid button:hover {
  border-color: rgba(212, 175, 55, 0.45);
}

.lean-prompt-grid button .lp-key {
  color: var(--gold);
  font-weight: 600;
  margin-right: 6px;
}

.lean-prompt-grid button .lp-mode {
  color: var(--cyan);
  font-size: 10px;
}

#leanPromptCustom {
  width: 100%;
  margin-bottom: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

.bounty-high-value {
  margin-bottom: 10px;
}

.bounty-high-value h3 {
  margin: 0 0 6px;
  font: 600 10px/1.2 Cinzel, Georgia, serif;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
}

.hv-row {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  margin-bottom: 4px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 6px;
  background: rgba(212, 175, 55, 0.06);
  color: var(--ink);
  font-size: 11px;
  cursor: pointer;
}

.hv-row .hv-pts {
  color: var(--gold);
  font-weight: 600;
  margin-right: 6px;
}

kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 10px;
  color: var(--cyan);
}

@media (min-width: 900px) {
  #interview { padding: 24px; }
  #bountyPanel, #buddyPanel, #proofPanel { padding-left: 24px; padding-right: 24px; }
}

.desk-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#interview.active,
#buddyPanel:not(.hidden),
#bountyPanel:not(.hidden),
#proofPanel:not(.hidden) {
  flex: 1;
  min-height: 0;
}
