/* Neutral, Notion-like shell. Mobile-first. Black / grey / white. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #191919;
  --muted: #6b6b6b;
  --line: #e9e9e7;
  --hover: #f4f4f2;
  --accent: #111111;
  --danger: #b42318;
  --radius: 8px;
  --gutter: 16px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 1.5rem; margin: 0 0 4px; font-weight: 650; }
h2 { font-size: 1.05rem; margin: 0 0 12px; font-weight: 600; }
p { margin: 0 0 8px; }
a { color: inherit; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 10px var(--gutter);
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; text-decoration: none; }
.workspace-chip {
  text-decoration: none; font-size: 0.9rem;
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;
  max-width: 50vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.workspace-chip:hover { background: var(--hover); }
.topnav { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 0.9rem; }
.topnav a { color: var(--muted); text-decoration: none; }
.topnav a:hover { color: var(--text); }

.impersonation-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px var(--gutter);
  padding-top: max(8px, env(safe-area-inset-top));
  background: #111111; color: #ffffff; font-size: 0.9rem;
}
.impersonation-bar .button { background: #ffffff; color: #111111; border-color: #ffffff; }
.button.small { padding: 4px 10px; font-size: 0.85rem; }

.search { display: flex; gap: 8px; margin-bottom: 12px; }
.search input { flex: 1; }

.page { max-width: 960px; margin: 0 auto; padding: var(--gutter); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--gutter);
  margin-bottom: var(--gutter);
}
.card.narrow { max-width: 420px; margin: 10vh auto 0; }

.stack { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-size: 0.9rem; color: var(--muted); }
input[type="email"], input[type="password"], input[type="text"], select, textarea {
  font: inherit; color: var(--text);
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.button {
  font: inherit; cursor: pointer;
  padding: 8px 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: #fff; color: var(--text);
}
.button:hover { background: var(--hover); }
.button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.button.primary:hover { opacity: 0.9; }
.link-button { font: inherit; background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; }
.link-button:hover { color: var(--text); }

.list { list-style: none; margin: 0; padding: 0; }
.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.list-row:first-child { border-top: 0; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.error { color: var(--danger); }
.tag {
  display: inline-block; font-size: 0.75rem; padding: 1px 6px; margin-right: 6px;
  border-radius: 4px; background: var(--hover); color: var(--muted);
}

.messages { list-style: none; padding: 0; margin: 0 0 var(--gutter); }
.message { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
.message.error { border-color: var(--danger); }
