:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #04110f;
  color: #effbf7;
  --surface: rgba(13, 42, 37, 0.78);
  --surface-strong: #123d35;
  --line: rgba(170, 255, 224, 0.14);
  --muted: #94b8ac;
  --accent: #71f6c5;
  --accent-dark: #062119;
  --danger: #ff8d83;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% 0%, rgba(54, 196, 149, 0.22), transparent 32rem),
    linear-gradient(160deg, #061815 0%, #03100e 60%);
}

button, textarea { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

.shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 32px 20px 56px;
}

.topbar, .connection-card, .panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar { align-items: flex-start; margin-bottom: 24px; }

.eyebrow, .label {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1 { max-width: 520px; margin-bottom: 0; font-size: clamp(2rem, 8vw, 3.7rem); line-height: 0.98; letter-spacing: -0.055em; }
h2 { margin-bottom: 0; font-size: 1.25rem; letter-spacing: -0.02em; }

.connection-dot {
  width: 13px;
  height: 13px;
  margin-top: 9px;
  border-radius: 50%;
  background: #55736a;
  box-shadow: 0 0 0 7px rgba(117, 150, 140, 0.12);
}

.connection-dot.connected { background: var(--accent); box-shadow: 0 0 0 7px rgba(113, 246, 197, 0.13), 0 0 22px var(--accent); }

.connection-card, .activity-card, .panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.connection-card { padding: 17px 18px; }
.status { margin: 0; font-weight: 700; }

.primary-button, .ghost-button, .shortcut, .control, .tab {
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

.primary-button {
  padding: 13px 17px;
  background: var(--accent);
  color: var(--accent-dark);
  font-weight: 850;
}

.wide { width: 100%; margin-top: 12px; }
.primary-button:active, .shortcut:active, .control:active { transform: scale(0.98); }
button:disabled { cursor: not-allowed; opacity: 0.42; }

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 22px 0 10px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(5, 24, 20, 0.72);
}

.tab { padding: 11px 8px; background: transparent; color: var(--muted); font-weight: 750; }
.tab.active { background: var(--surface-strong); color: #fff; }

.panel { display: none; padding: 22px; }
.panel.active { display: block; }
.panel-heading { margin-bottom: 20px; }

.ghost-button { padding: 10px 12px; background: transparent; color: var(--accent); border: 1px solid var(--line); font-size: 0.82rem; font-weight: 700; }

.input-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 0.84rem; font-weight: 700; }

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: none;
  padding: 14px;
  background: rgba(2, 18, 15, 0.75);
  color: #fff;
  line-height: 1.45;
}

textarea:focus { border-color: rgba(113, 246, 197, 0.55); box-shadow: 0 0 0 3px rgba(113, 246, 197, 0.08); }

.shortcut-grid, .control-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }

.shortcut, .control { min-height: 62px; padding: 13px; background: #153f37; color: #effbf7; font-weight: 760; text-align: left; }
.shortcut { text-align: center; }
.control span { display: block; margin-bottom: 5px; color: var(--accent); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; }
.control.danger span { color: var(--danger); }

.empty-state { padding: 20px 4px; text-align: center; }
.empty-state p:last-child { max-width: 450px; margin: 12px auto 0; color: var(--muted); line-height: 1.6; }

.activity-card { margin-top: 12px; padding: 17px 20px; }
.activity-card p:last-child { margin: 0; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.84rem; overflow-wrap: anywhere; }

@media (max-width: 520px) {
  .shell { padding: 24px 14px 40px; }
  .connection-card { align-items: stretch; flex-direction: column; }
  .connection-card .primary-button { width: 100%; }
  .panel { padding: 18px; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
}
