:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-hover: #1a1a2e;
  --border: #2a2a3e;
  --text: #e0e0e8;
  --text-dim: #6a6a80;
  --accent: #00ff88;
  --accent-dim: #00cc6a;
  --blue: #4488ff;
  --yellow: #ffcc00;
  --red: #ff4455;
  --green: #00ff88;
  --gray: #888899;
  --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px;
}

.container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}

h2 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 12px;
}

.subtitle {
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 32px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

input, select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 4px;
  width: 100%;
  outline: none;
}

input:focus, select:focus {
  border-color: var(--accent);
}

label {
  display: block;
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

button {
  background: var(--accent);
  color: var(--bg);
  border: none;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.15s;
}

button:hover { opacity: 0.85; }
button:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-open { background: #00ff8822; color: var(--green); }
.badge-closing { background: #ffcc0022; color: var(--yellow); }
.badge-closed { background: #ff445522; color: var(--red); }

.key-display {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px;
  font-size: 12px;
  word-break: break-all;
  position: relative;
}

.key-display .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--border);
  color: var(--text);
  padding: 4px 8px;
  font-size: 11px;
}

.msg-instruction { border-left: 3px solid var(--blue); }
.msg-response { border-left: 3px solid var(--green); }
.msg-confirmation { border-left: 3px solid var(--gray); }
.msg-query { border-left: 3px solid var(--yellow); }
.msg-context { border-left: 3px solid var(--text-dim); }
.msg-close { border-left: 3px solid var(--red); }

.hidden { display: none; }

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin: 16px 0;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.1s linear;
  width: 0%;
}

.entropy-canvas {
  width: 100%;
  height: 200px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: crosshair;
  touch-action: none;
}
