*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0f1117;
  --surface:  #1a1d27;
  --border:   #2a2d3e;
  --accent:   #6c63ff;
  --accent2:  #a78bfa;
  --text:     #e2e8f0;
  --muted:    #64748b;
  --danger:   #ef4444;
  --radius:   12px;
  --font:     'Inter', system-ui, sans-serif;
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }

body { display: flex; flex-direction: column; }

/* ── Header ─────────────────────────────────────────────── */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; font-weight: 700; letter-spacing: -.3px; }
.logo svg { color: var(--accent); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); transition: background .3s; }
.status-dot.connected { background: #22c55e; }
.status-dot.error     { background: var(--danger); }

/* ── Input area ─────────────────────────────────────────── */
.input-area {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.textarea-wrap { position: relative; }
textarea {
  width: 100%; min-height: 90px; max-height: 200px;
  padding: 12px 14px; padding-right: 48px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: var(--font); font-size: .9rem; line-height: 1.5;
  resize: vertical; outline: none; transition: border-color .2s;
}
textarea:focus { border-color: var(--accent); }
textarea::placeholder { color: var(--muted); }
.send-btn {
  position: absolute; bottom: 10px; right: 10px;
  width: 32px; height: 32px;
  background: var(--accent); border: none; border-radius: 8px;
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s, transform .1s;
}
.send-btn:hover  { background: var(--accent2); }
.send-btn:active { transform: scale(.93); }

/* ── Clips list ─────────────────────────────────────────── */
.clips-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px 4px;
}
.clips-header span { font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.clear-btn {
  font-size: .75rem; color: var(--muted); background: none; border: none;
  cursor: pointer; padding: 2px 6px; border-radius: 6px;
  transition: color .2s, background .2s;
}
.clear-btn:hover { color: var(--danger); background: rgba(239,68,68,.1); }

#clips-list { flex: 1; overflow-y: auto; padding: 8px 20px 20px; display: flex; flex-direction: column; gap: 10px; }

.clip-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  display: flex; align-items: flex-start; gap: 10px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.clip-content { flex: 1; font-size: .88rem; line-height: 1.55; word-break: break-word; white-space: pre-wrap; }
.clip-content a { color: var(--accent2); text-decoration: none; }
.clip-content a:hover { text-decoration: underline; }

.clip-actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn {
  width: 28px; height: 28px; border: none; border-radius: 7px;
  background: transparent; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .2s, background .2s;
}
.icon-btn:hover { color: var(--text); background: var(--border); }
.icon-btn.danger:hover { color: var(--danger); background: rgba(239,68,68,.1); }

.clip-time { font-size: .72rem; color: var(--muted); margin-top: 5px; }

/* ── Empty state ────────────────────────────────────────── */
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); text-align: center; padding: 40px; }
.empty svg { opacity: .4; }
.empty p { font-size: .9rem; }

/* ── Toast ──────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(60px);
  background: #22c55e; color: #fff; font-size: .85rem; font-weight: 600;
  padding: 8px 20px; border-radius: 999px;
  opacity: 0; transition: all .25s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none; z-index: 100;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }