/* Shared chrome for the portal pages (login, invite, workspace list).
   The annotator surfaces keep their own denser stylesheet. */
:root {
  --bg: #16171c;
  --panel: #1e1f24;
  --panel-2: #26272e;
  --border: #3a3b42;
  --text: #e6e7ea;
  --muted: #9aa0aa;
  --accent: #6ea8fe;
  --danger: #f87171;
  --ok: #4ade80;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 960px; margin: 0 auto; padding: 32px 20px 64px; }
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }

header.top {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); padding: 14px 20px; background: var(--panel);
}
header.top .brand { font-weight: 700; letter-spacing: 0.02em; }
header.top .brand span { color: var(--accent); }
header.top .who { color: var(--muted); font-size: 0.85rem; }

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 22px;
}
.card.narrow { width: 100%; max-width: 400px; }

h1 { font-size: 1.35rem; margin: 0 0 4px; }
h2 { font-size: 1.05rem; margin: 0 0 12px; }
p.sub { color: var(--muted); margin: 0 0 20px; font-size: 0.9rem; }

label { display: block; font-size: 0.78rem; color: var(--muted); margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; padding: 9px 10px; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }

button, .btn {
  background: var(--accent); color: #0b1220; border: none; border-radius: 6px;
  padding: 9px 16px; font-size: 0.88rem; font-weight: 600; cursor: pointer;
  font-family: inherit; text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.55; cursor: default; filter: none; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
button.ghost:hover { color: var(--text); }

.msg { margin-top: 14px; font-size: 0.85rem; min-height: 1.2em; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.ws {
  position: relative; background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 16px 14px; color: inherit;
}
.ws:hover { border-color: #4a4b55; }
.ws .name { font-weight: 600; margin-bottom: 5px; padding-right: 26px; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws .meta { color: var(--muted); font-size: 0.76rem; display: flex; align-items: center;
  gap: 6px; flex-wrap: wrap; }

/* Delete is a quiet x in the corner, not a button competing with Open. It is the
   rarest action on the card and the only irreversible one; giving it equal
   visual weight invites the misclick the confirm dialog then has to catch. */
.ws .wsx {
  position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; padding: 0;
  background: transparent; border: none; border-radius: 5px; color: var(--muted);
  font-size: 1.15rem; line-height: 1; cursor: pointer; opacity: 0.45;
}
.ws .wsx:hover { opacity: 1; color: var(--danger); background: rgba(248,113,113,0.12); }

/* Actions on one row, single-word labels, wrapping only if they must. */
/* Wraps: a workspace can carry eight controls (Open, Codebook, Import,
   Rename, Duplicate, Clear, Data, Model) and forcing them onto one line
   made the labels collide. */
.ws .acts { display: flex; flex-wrap: wrap; gap: 5px; row-gap: 6px; margin-top: 13px; }
.ws .act {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  border-radius: 6px; padding: 5px 9px; font-size: 0.74rem; font-weight: 500;
  cursor: pointer; font-family: inherit; text-decoration: none; white-space: nowrap;
  flex: 0 1 auto; min-width: 0;
}
.ws .act:hover { color: var(--text); border-color: #55565f; }
.ws .act.primary { background: var(--accent); border-color: var(--accent); color: #0b1220;
  font-weight: 600; }
.ws .act.primary:hover { filter: brightness(1.08); color: #0b1220; }
.ws .act.warn:hover { color: #fbbf24; border-color: #fbbf24; }
.ws .act.off { opacity: 0.4; cursor: default; }
.ws .act:disabled { opacity: 0.5; cursor: default; }
.pill {
  display: inline-block; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 7px; border-radius: 10px; border: 1px solid var(--border); color: var(--muted);
}
.pill.text { border-color: #3d5a80; color: #8ab4f8; }
.pill.audio { border-color: #5a3d80; color: #c084fc; }
/* Someone else's workspace, visible only because you are an admin. Marked so a
   mixed list cannot be misread as all your own. */
.pill.admin { border-color: #c084fc44; color: #c084fc;
  background: rgba(192,132,252,0.14); font-size: 0.66rem; }

.bar { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 12px; }
.empty { color: var(--muted); text-align: center; padding: 48px 0; }

.row { display: flex; gap: 10px; align-items: flex-end; }
.row > * { flex: 1; }
.row > button { flex: 0 0 auto; }

dialog {
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 22px; width: min(560px, 92vw);
}
dialog::backdrop { background: rgba(0,0,0,0.6); }

.classrow { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.classrow input[type=text] { flex: 1; }
.classrow input[type=color] { width: 34px; height: 34px; padding: 2px; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 6px; }
.classrow .k { width: 46px; text-align: center; }
.classrow button { background: transparent; color: var(--muted); border: 1px solid var(--border); padding: 6px 9px; }
code { background: var(--panel-2); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; }

/* destructive actions */
button.ghost.danger { border-color: #6b3a3a; color: #f0a0a0; }
button.ghost.danger:hover { border-color: var(--danger); color: var(--danger); }
button.danger-btn { background: var(--danger); color: #2a0b0b; }
button.danger-btn:disabled { opacity: 0.4; }

/* a disabled surface should read as "not yet", not as broken */
select option:disabled { color: var(--muted); font-style: italic; }

/* working indicator: three dots, so a long silent call still looks alive */
.fp-dots { display: inline-flex; gap: 3px; }
.fp-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
  display: inline-block; animation: fpb 1.05s infinite ease-in-out; }
.fp-dots i:nth-child(2) { animation-delay: 0.16s; }
.fp-dots i:nth-child(3) { animation-delay: 0.32s; }
@keyframes fpb { 0%, 70%, 100% { opacity: 0.25; transform: translateY(0); }
                 35% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .fp-dots i { animation: none; opacity: 0.7; } }

/* Motivational signage. */
.morale { margin: 0 0 18px; padding: 9px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel-bg);
  font-size: 0.78rem; letter-spacing: 0.02em; opacity: 0.75;
  text-align: center; font-style: italic; }

/* Per-coder progress. Distinct ITEMS touched, not annotation rows — thirteen
   answers about one tweet is one item coded, and rows would read as near-done. */
.coders { margin: 8px 0 2px; display: flex; flex-direction: column; gap: 4px; }
.coder { display: flex; align-items: center; gap: 8px; font-size: 0.7rem; }
.who2 { flex: 0 0 96px; opacity: 0.75; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.bar2 { flex: 1; height: 5px; border-radius: 3px; background: var(--input-bg);
  overflow: hidden; }
.bar2 i { display: block; height: 100%; background: var(--accent); }
.num2 { flex: 0 0 auto; opacity: 0.6; font-variant-numeric: tabular-nums; }
.muted-i { opacity: 0.5; font-style: italic; }

/* Two labelled zones: work you do, and work you collect. The cards inside are
   identical, so the grouping has to be legible from the container rather than
   from a hairline rule between two otherwise identical grids. */
.zone { margin: 0 0 30px; }
.zone.theirs { border: 1px solid var(--border); border-radius: 12px;
  padding: 4px 16px 16px; background: rgba(255,255,255,0.015); }
.zone-head { display: flex; align-items: baseline; gap: 11px; margin: 18px 2px 14px; }
.zone-head h2 { font-size: 0.92rem; margin: 0; letter-spacing: 0.01em; }
.zone-sub { font-size: 0.74rem; opacity: 0.5; flex: 1; }
.zone-count { font-size: 0.68rem; font-weight: 700; opacity: 0.6;
  border: 1px solid var(--border); border-radius: 10px; padding: 1px 9px; }
.zone.theirs .zone-head h2 { color: #c084fc; }
.num2.none { opacity: 0.45; font-style: italic; }
