:root {
  --bg: #111418;
  --card: #1b2027;
  --line: #2a313b;
  --fg: #e8edf2;
  --muted: #8b97a6;
  --accent: #3b82f6;
  --ok: #22c55e;
  --err: #ef4444;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 14px; }
.err { color: var(--err); font-size: 14px; }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header h1 { font-size: 20px; margin: 8px 0 16px; }

.icon-btn {
  background: none; border: none; color: var(--muted);
  font-size: 22px; cursor: pointer;
}

textarea#note {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
}

.actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.btn {
  appearance: none;
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 12px;
  font-size: 16px;
  cursor: pointer;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; width: 100%; }
.btn.recording { background: var(--err); border-color: var(--err); color: #fff; }

.queue { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }

.item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}
.item .row { display: flex; justify-content: space-between; gap: 8px; }
.item .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .status { flex: none; }
.item.ok .status { color: var(--ok); }
.item.err .status { color: var(--err); }
.bar { height: 4px; background: var(--line); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }

/* token gate */
.gate {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--bg);
}
.gate-card {
  width: 100%; max-width: 360px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 24px;
}
.gate-card h2 { margin: 0 0 6px; }
.gate-card input {
  width: 100%; margin: 14px 0;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; font: inherit;
}
