@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,300;0,400;0,500;1,400&display=swap');

:root {
  --bg:          #0A0A0A;
  --surface:     #111111;
  --surface-2:   #181818;
  --border:      rgba(255,255,255,0.06);
  --border-mid:  rgba(255,255,255,0.11);
  --text:        #ADADAD;
  --text-dim:    #484848;
  --text-bright: #EFEFEF;
  --accent:      #4DFFD2;
  --accent-bg:   rgba(77,255,210,0.08);
  --accent-border: rgba(77,255,210,0.25);
  --red:         #FF5A5A;
  --yellow:      #FFD97D;
  --font:        'IBM Plex Mono', 'Courier New', monospace;
  --r:           2px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.6;
  height: 100vh;
  overflow: hidden;
}

/* ── Header ─────────────────────────────────────── */
header {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-shrink: 0;
  height: 48px;
  justify-content: space-between;
  padding: 0 24px;
}

.breadcrumb {
  color: var(--text-bright);
  font-size: 12px;
  letter-spacing: 0.03em;
}
.breadcrumb .sep { color: var(--text-dim); margin: 0 6px; }

.header-right {
  align-items: center;
  color: var(--text-dim);
  display: flex;
  font-size: 11px;
  gap: 20px;
}

.status-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 5px;
  box-shadow: 0 0 6px var(--accent);
}

/* ── Tab nav ─────────────────────────────────────── */
nav.tabs {
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-shrink: 0;
  padding: 0 20px;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--font);
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 11px 14px;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: var(--text-bright); }
.tab-btn.active { border-bottom-color: var(--accent); color: var(--accent); }

/* ── Main / panels ───────────────────────────────── */
main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.tab-panel {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 28px 40px;
}
.tab-panel.active { display: block; }

#tab-chat.active {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

/* ── Section heading ─────────────────────────────── */
.section-head {
  color: var(--text-dim);
  font-size: 9px;
  letter-spacing: 0.14em;
  margin-bottom: 14px;
  text-transform: uppercase;
}

/* ── Server strip ────────────────────────────────── */
.server-strip {
  border: 1px solid var(--border);
  border-radius: var(--r);
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 28px;
  overflow: hidden;
}

.strip-item {
  border-right: 1px solid var(--border);
  padding: 12px 20px;
  flex: 1;
  min-width: 120px;
}
.strip-item:last-child { border-right: none; }

.strip-label {
  color: var(--text-dim);
  font-size: 9px;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.strip-value {
  color: var(--text-bright);
  font-size: 13px;
}
.strip-value.ok  { color: var(--accent); }
.strip-value.dim { color: var(--text-dim); }

/* ── Overview grid ───────────────────────────────── */
.overview-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: 240px 1fr;
  margin-bottom: 28px;
}

/* ── Activity bars ───────────────────────────────── */
.activity-rows { display: flex; flex-direction: column; gap: 6px; }

.activity-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 72px 1fr 24px;
}

.act-label {
  color: var(--text);
  font-size: 10px;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.act-track {
  background: var(--surface-2);
  border-radius: 2px;
  height: 3px;
  overflow: hidden;
}

.act-bar {
  background: var(--accent);
  border-radius: 2px;
  height: 100%;
  transition: width 0.7s cubic-bezier(0.4,0,0.2,1);
  width: 0;
}

.act-count {
  color: var(--text-dim);
  font-size: 9px;
  text-align: right;
}

/* ── Changelog ───────────────────────────────────── */
.changelog { display: flex; flex-direction: column; gap: 14px; }

.cl-group {}

.cl-date {
  color: var(--text-dim);
  font-size: 9px;
  letter-spacing: 0.1em;
  margin-bottom: 5px;
}

.cl-entry {
  display: flex;
  gap: 10px;
  margin-bottom: 3px;
  align-items: baseline;
}

.cl-proj {
  color: var(--accent);
  flex-shrink: 0;
  font-size: 10px;
  min-width: 64px;
  opacity: 0.8;
}

.cl-text {
  color: var(--text);
  font-size: 11px;
  line-height: 1.5;
}

/* ── Scan ────────────────────────────────────────── */
.scan-section { border-top: 1px solid var(--border); padding-top: 24px; }

.scan-header {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

#scan-status {
  color: var(--text-dim);
  font-size: 10px;
}

.scan-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  display: none;
  padding: 18px 20px;
}
.scan-result.visible { display: block; }

.scan-block { margin-bottom: 16px; }
.scan-block:last-child { margin-bottom: 0; }

.scan-block-title {
  color: var(--accent);
  font-size: 9px;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.scan-block p,
.scan-block li {
  color: var(--text);
  font-size: 11px;
  line-height: 1.7;
}

.scan-block ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.scan-block li::before { content: '— '; color: var(--text-dim); }

/* ── Buttons ─────────────────────────────────────── */
.btn {
  background: transparent;
  border: 1px solid var(--border-mid);
  border-radius: var(--r);
  color: var(--text-bright);
  cursor: pointer;
  font-family: var(--font);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 7px 14px;
  transition: border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { cursor: not-allowed; opacity: 0.35; }
.btn.accent { border-color: var(--accent-border); color: var(--accent); }

/* ── Projects grid ───────────────────────────────── */
.project-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  transition: border-color 0.15s;
  text-decoration: none;
  display: block;
  color: inherit;
}
.project-card:hover { border-color: var(--border-mid); }

.card-top {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.card-name {
  color: var(--text-bright);
  font-size: 13px;
  font-weight: 500;
}

.card-badge {
  border-radius: 2px;
  font-size: 9px;
  letter-spacing: 0.07em;
  padding: 2px 7px;
}
.badge-active      { background: rgba(77,255,210,0.1);  color: var(--accent); }
.badge-live        { background: rgba(255,255,255,0.05); color: var(--text-dim); }
.badge-placeholder { background: rgba(255,255,255,0.03); color: var(--text-dim); }
.badge-external    { background: rgba(255,217,125,0.1);  color: var(--yellow); }

.card-domain {
  color: var(--text-dim);
  font-size: 10px;
  margin-bottom: 10px;
}

.card-desc {
  color: var(--text);
  font-size: 11px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.card-stack {
  color: var(--text-dim);
  font-size: 10px;
}

/* ── Todos ───────────────────────────────────────── */
.todo-add {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.todo-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text-bright);
  flex: 1;
  font-family: var(--font);
  font-size: 12px;
  outline: none;
  padding: 8px 12px;
  transition: border-color 0.15s;
}
.todo-input::placeholder { color: var(--text-dim); }
.todo-input:focus { border-color: var(--accent); }

.todo-list { display: flex; flex-direction: column; gap: 4px; }

.todo-empty {
  color: var(--text-dim);
  font-size: 11px;
  padding: 12px 0;
}

.todo-item {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  transition: opacity 0.2s;
}
.todo-item.done { opacity: 0.4; }

.todo-cb {
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  height: 13px;
  width: 13px;
}

.todo-text {
  color: var(--text);
  flex: 1;
  font-size: 12px;
}
.todo-item.done .todo-text {
  color: var(--text-dim);
  text-decoration: line-through;
}

.todo-del {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s;
}
.todo-del:hover { color: var(--red); }

/* ── Chat ────────────────────────────────────────── */
.chat-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 28px;
}

.chat-msg { max-width: 700px; }
.chat-msg.user { align-self: flex-end; }

.msg-label {
  color: var(--text-dim);
  font-size: 9px;
  letter-spacing: 0.1em;
  margin-bottom: 5px;
  text-align: right;
}
.chat-msg.assistant .msg-label { text-align: left; }

.msg-body {
  border-radius: var(--r);
  font-size: 12px;
  line-height: 1.75;
  padding: 11px 15px;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-msg.user .msg-body {
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  color: var(--text-bright);
}
.chat-msg.assistant .msg-body {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.chat-input-area {
  border-top: 1px solid var(--border);
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  padding: 16px 28px;
}

.chat-textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text-bright);
  flex: 1;
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.6;
  max-height: 180px;
  min-height: 42px;
  outline: none;
  padding: 10px 13px;
  resize: none;
  transition: border-color 0.15s;
}
.chat-textarea::placeholder { color: var(--text-dim); }
.chat-textarea:focus { border-color: var(--accent); }

.chat-hint {
  color: var(--text-dim);
  font-size: 9px;
  margin-top: 6px;
  padding: 0 28px 10px;
  flex-shrink: 0;
}

/* ── Footer ──────────────────────────────────────── */
footer {
  align-items: center;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  display: flex;
  flex-shrink: 0;
  font-size: 10px;
  height: 30px;
  justify-content: flex-end;
  padding: 0 24px;
}

/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
