/* The team workspace (js/team.js): the Ekip section of the settings, the invite screen, the account menu's
   switcher and the board's notes line. Loaded after the app's sheets, so every selector names a team-*
   class: a rule naming only shared classes would restyle the rest of the app (tests/team.test.mjs). */

/* ---------- the Ekip section ---------- */
.team-form { display: flex; align-items: end; gap: 8px; max-width: 560px; }
.team-field { display: grid; flex: 1; gap: 8px; min-width: 0; }
.team-input {
  width: 100%; height: var(--control-h); padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-1);
  background: var(--surface); color: var(--ink); font: inherit; font-size: var(--t-body);
  transition: border-color 120ms ease, box-shadow var(--dur-ui) var(--ease-out);
}
.team-input:hover:not(:disabled) { border-color: var(--ink-muted); }
.team-input:focus-visible { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-wash); }
.team-input:disabled { opacity: .5; cursor: not-allowed; }
.team-form .btn { flex: none; }
.team-line { min-height: 0; margin: 0; color: var(--ink-muted); font-size: var(--t-meta); line-height: 1.5; }
.team-line:empty { display: none; }
.team-line.is-warning { color: var(--danger); }
.team-warning { margin: 0; color: var(--ink); font-size: var(--t-body); }
.team-solo { margin: 0; color: var(--ink-muted); }
.team-solo a { color: var(--accent); text-decoration: none; }
.team-solo a:hover { text-decoration: underline; text-underline-offset: 3px; }

.team-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.team-h { font-size: var(--t-body); font-weight: 700; }
.team-seats { color: var(--ink-muted); font-size: var(--t-meta); }
.team-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); }
.team-row { display: grid; grid-template-columns: minmax(0, 1fr) 112px 136px 128px; align-items: center; gap: 16px; min-height: 48px; padding: 8px 16px; }
.team-row + .team-row { border-top: 1px solid var(--line); }
.team-who { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.team-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-body); }
.team-me { flex: none; color: var(--ink-muted); font-size: var(--t-meta); }
.team-role { color: var(--ink-muted); font-size: var(--t-meta); }
.team-row.is-invite .team-email, .team-row.is-invite .team-role { color: var(--ink-muted); }
.team-date { color: var(--ink-muted); font-size: var(--t-meta); white-space: nowrap; }
.team-quiet { justify-self: end; }
.team-row.is-usage { grid-template-columns: minmax(0, 1fr) 112px 128px; }
.team-row.is-gone .team-email, .team-row.is-gone .team-role { color: var(--ink-muted); }
.team-credits { justify-self: end; font-size: 12px; white-space: nowrap; }
.team-quiet.is-armed { color: var(--danger); }
.team-quiet.is-armed:hover:not(:disabled) { color: var(--danger); }
.team-leave { justify-self: start; }

.team-link { display: grid; gap: 8px; max-width: 560px; padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--r-2); background: var(--surface); }
.team-link[hidden] { display: none; }
.team-link-field { font-family: var(--font-mono); font-size: var(--t-meta); }
.team-link .btn .i { width: 14px; height: 14px; }

/* ---------- the invite screen (/app/davet) ---------- */
.team-invite { display: grid; place-items: center; min-height: 100%; padding: 48px 16px; background: var(--page); }
.team-invite[hidden] { display: none; }
.team-invite-card { display: grid; gap: 12px; width: min(440px, 100%); }
.team-invite-kicker { margin: 0; color: var(--ink-muted); font: var(--label-weight) var(--t-label)/1.3 var(--font-label); letter-spacing: var(--label-track); text-transform: uppercase; font-variation-settings: var(--label-vary); }
.team-invite-card h1 { margin: 0; font-size: var(--t-page); font-weight: 700; line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; overflow-wrap: anywhere; }
.team-invite-text { margin: 0; color: var(--ink-muted); font-size: var(--t-body); line-height: 1.5; overflow-wrap: anywhere; }
.team-invite-text:empty { display: none; }
.team-invite-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.team-invite-status { margin: 0; color: var(--danger); font-size: var(--t-body); }
.team-invite-status:empty { display: none; }

/* ---------- the switcher in the account menu ---------- */
.team-switch { display: grid; gap: 2px; padding: 4px 0 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.team-switch[hidden] { display: none; }
.team-switch-label { margin: 0; padding: 4px 10px; color: var(--ink-muted); font: var(--label-weight) var(--t-label)/1.3 var(--font-label); letter-spacing: var(--label-track); text-transform: uppercase; font-variation-settings: var(--label-vary); }
.team-switch-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 32px; padding: 0 10px;
  border: 0; border-radius: var(--r-1); background: transparent; color: var(--ink); font: inherit; font-size: var(--t-body); text-align: left; cursor: pointer;
}
.team-switch-item:hover:not(:disabled) { background: var(--wash-2); }
.team-switch-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.team-switch-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-switch-role { flex: none; color: var(--ink-muted); font: var(--label-weight) var(--t-label)/1 var(--font-label); letter-spacing: var(--label-track); text-transform: uppercase; font-variation-settings: var(--label-vary); }
.team-switch-item .i { flex: none; color: var(--accent); visibility: hidden; }
.team-switch-item[aria-checked="true"] .i { visibility: visible; }
.team-switch-item[aria-checked="true"] { cursor: default; }

/* the credit chip names the team it counts for */
.team-chip-name { max-width: 120px; overflow: hidden; color: var(--ink-muted); font-size: var(--t-meta); text-overflow: ellipsis; white-space: nowrap; }
.team-chip-name:empty { display: none; }

/* the board: notes and hand-drawn arrows stay in this browser; a line under the board's bar */
.team-notes-line { position: absolute; left: 50%; top: 60px; z-index: 5; translate: -50% 0; margin: 0; color: var(--ink-muted); font-size: var(--t-meta); white-space: nowrap; pointer-events: none; }
.team-notes-line[hidden] { display: none; }

/* ---------- the Çizgi kalınlıkları section (js/house-style.js): the form beside the sample flat ---------- */
.team-lines-lede { margin: 0; max-width: 60ch; color: var(--ink-muted); font-size: var(--t-body); line-height: 1.5; }
.team-lines { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); align-items: start; gap: 24px; }
.team-lines-form { display: grid; gap: 8px; }
.team-lines-row { display: grid; grid-template-columns: 72px 104px minmax(0, 1fr); align-items: center; gap: 12px; }
.team-lines-name { font-size: var(--t-body); font-weight: 600; }
.team-lines-unit { display: flex; align-items: center; gap: 8px; min-width: 0; }
.team-lines-pt { flex: none; color: var(--ink-muted); font-size: var(--t-meta); }
.team-lines-input { min-width: 0; text-align: right; font-variant-numeric: tabular-nums; }
.team-lines-dash .team-lines-input { flex: 1; min-width: 88px; text-align: left; }
.team-lines-input[aria-invalid="true"] { border-color: var(--danger); }
.team-lines-input[aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent); }
.team-lines-warn { color: var(--ink); }
.team-lines-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.team-lines-art { display: grid; gap: 8px; margin: 0; }
.team-lines-stage { display: grid; place-items: center; height: min(560px, 62vh); padding: 24px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--wb-paper); }
.team-lines-wait { margin: 0; color: var(--wb-paper-muted); font-size: var(--t-meta); }
.team-lines-stage svg { width: 100%; height: 100%; }
.team-lines-caption { color: var(--ink-muted); font-size: var(--t-meta); }
.team-lines-read-row { grid-template-columns: minmax(0, 1fr) auto; }

@media (max-width: 620px) {
  .team-form { flex-direction: column; align-items: stretch; }
  .team-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .team-row.is-usage { grid-template-columns: minmax(0, 1fr) auto; }
  .team-who { grid-column: 1 / -1; }
  .team-date { display: none; }
  .team-action-gap { display: none; }
  .team-notes-line { display: none; }   /* a phone has no note tool */
  .team-lines { grid-template-columns: minmax(0, 1fr); }
  .team-lines-stage { height: auto; aspect-ratio: 4 / 5; }
  .team-lines-row { grid-template-columns: 64px 96px minmax(0, 1fr); }
}
