/* The team web page (Sprint Z Task 8): phone first, light and dark, the app's amber for the owner badge. */
:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --line: #dedbd3;
  --text: #1d1f24;
  --muted: #5f6570;
  --accent: #f2b84b;       /* the app's timecode amber */
  --accent-ink: #1a1405;
  --accent-text: #8a5a00;  /* amber dark enough to read on white */
  --danger: #b3261e;
  --radius: 10px;
  --font-ui: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181d;
    --surface: #1e2128;
    --line: #2c313a;
    --text: #e9eaec;
    --muted: #9aa1ab;
    --accent-text: #f2b84b;
    --danger: #e5645a;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left));
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 12px;
}
h1 { margin: 0; font-size: 1.4rem; line-height: 1.25; }
.top-actions { display: flex; gap: 8px; }

button {
  font: inherit;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 10px 16px;
  min-height: 44px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
button:disabled { opacity: 0.6; cursor: progress; }
button.quiet {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
  padding: 6px 12px;
  min-height: 36px;
  font-size: 0.9rem;
}
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.login form {
  display: grid;
  gap: 6px;
  max-width: 24rem;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.login label { font-weight: 600; font-size: 0.9rem; margin-top: 6px; }
.login input {
  font: inherit;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}
.login button { margin-top: 12px; }

.hint { color: var(--muted); font-size: 0.875rem; margin: 8px 0; }
.note { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.error { color: var(--danger); font-weight: 600; margin: 8px 0; }

/* The owner badge: the app's pill with a dot (public/css/theme.css .owner-badge). */
.owner {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.1rem 0.65rem 0.1rem 0.5rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent-text);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.owner::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}
/* The group's heading: the same badge, filled and larger — whose projects follow. */
.owner-lg {
  font-size: 1rem;
  padding: 0.2rem 0.85rem 0.2rem 0.65rem;
  background: var(--accent);
  color: var(--accent-ink);
}

.group { margin-top: 20px; }
.group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; min-width: 0; }
.count { color: var(--muted); font-size: 0.875rem; white-space: nowrap; }

.projects { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.project {
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.project-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-width: 0; }
.project-name { min-width: 0; overflow-wrap: anywhere; font-size: 1.02rem; line-height: 1.35; }
.project-head .owner { flex: none; max-width: 45%; }
.project-status { margin: 6px 0 0; overflow-wrap: anywhere; }
.project-meta { margin: 2px 0 0; color: var(--muted); font-size: 0.875rem; overflow-wrap: anywhere; }
.project-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent-text);
  font-weight: 600;
  text-underline-offset: 3px;
}
