:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --border: #e8e8e8;
  --border-strong: #d4d4d4;
  --text: #111111;
  --text-secondary: #555555;
  --text-muted: #888888;
  --hover: #f0f0f0;
  --active: #e8e8e8;
  --accent: #222222;
  --accent-hover: #333333;
  --danger: #8b2e2e;
  --danger-hover: #a33;
  --radius: 6px;
  --sidebar-width: 220px;
  --members-width: 260px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --control-height: 32px;
  --focus-ring: 2px solid var(--text);
  color-scheme: light;
  font: 14px/1.5 var(--font-sans);
}

.tc-brand-mark {
  display: block;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  padding: 3px;
  border-radius: 5px;
  background: #111;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
}

#root {
  min-height: 100vh;
}

button {
  font: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.tc-surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.tc-field {
  box-sizing: border-box;
  min-height: var(--control-height);
  padding: 5px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
}

.icon-btn:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text);
}

.icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height);
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

.btn:hover:not(:disabled) {
  background: var(--hover);
}

.btn-sm {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 0.85em;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
}

.btn-danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}

.error {
  color: var(--danger);
  font-size: 0.9em;
}

.muted {
  color: var(--text-muted);
  font-size: 0.9em;
}

.link {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
}

.link:hover {
  color: var(--text);
  text-decoration: underline;
}

.role-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.75em;
  text-transform: lowercase;
  background: var(--hover);
  color: var(--text-secondary);
}

.role-pill.owner {
  background: #eee;
  color: var(--text);
}

.role-pill.invited {
  opacity: 0.7;
}
