:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-elev: #f7f7f9;
  --fg: #1c1c1e;
  --fg-muted: #6b6b70;
  --border: rgba(0, 0, 0, 0.1);
  --accent: #007aff;
  --green: #34c759;
  --yellow: #ffcc00;
  --red: #ff453a;
  --gray: #8e8e93;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e;
    --bg-elev: #2c2c2e;
    --fg: #f2f2f7;
    --fg-muted: #aeaeb2;
    --border: rgba(255, 255, 255, 0.12);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 13px -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 16px;
  gap: 16px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.brand__undock, .brand__dock {
  margin-left: auto;
  font-size: 12px;
}

.brand__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gray);
}

.brand__dot[data-color="green"] { background: var(--green); }
.brand__dot[data-color="yellow"] { background: var(--yellow); }
.brand__dot[data-color="red"] { background: var(--red); }
.brand__dot[data-color="gray"] { background: var(--gray); }

.panel__status {
  margin: 0;
  font-weight: 500;
}

.panel__session {
  margin: 0;
  color: var(--fg-muted);
  font-size: 12px;
}

.panel__error {
  margin: 4px 0 0 0;
  color: var(--red);
  font-size: 12px;
  white-space: pre-line; /* error + troubleshooting hint on separate lines */
}

.panel__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--fg);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.action:hover { background: rgba(0, 122, 255, 0.08); }
.action:disabled { opacity: 0.5; cursor: not-allowed; }

.action--primary {
  background: var(--accent);
  color: white;
  border-color: transparent;
}

.action--primary:hover { background: #0a6bdc; }

.action__title { font-weight: 600; }
.action__subtitle { font-size: 11px; opacity: 0.8; }

.panel__recent {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.panel__recent-title {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
}

.recent {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recent__item {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elev);
}

.recent__title { margin: 0; font-weight: 600; }
.recent__meta { margin: 2px 0 0 0; color: var(--fg-muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.recent__empty { color: var(--fg-muted); font-size: 12px; }

.panel__footer {
  display: flex;
  justify-content: flex-end;
}

.link {
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.link:hover { text-decoration: underline; }

.panel__mode {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 14px;
}

.mode__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
}

.mode__select {
  font: inherit;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--fg);
}

.mode__select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.mode__blurb {
  margin: 2px 0 0 0;
  color: var(--fg-muted);
  font-size: 11px;
  line-height: 1.35;
}
