.team-board {
  --team-accent: var(--tavern-gold, #dcc48e);
  --team-ink: var(--tavern-text, #f0e9db);
  --team-muted: #d0c5b1;
  --team-line: #75664d;
  --team-space: 1rem;
  color: var(--team-ink);
  font-size: 1rem;
  line-height: 1.5;
}
.team-board * { box-sizing: border-box; min-width: 0; }
.team-board h3 { font-size: 1.3rem; margin: 1.75rem 0 .5rem; }
.team-board h4 { font-size: 1.1rem; margin: 0; }
.team-board p { max-width: 72ch; margin: .5rem 0 1rem; }
.team-board small { display: block; color: var(--team-muted); font-size: .8rem; }
.team-board button, .team-board input, .team-board select { font: inherit; }
.team-board button { min-height: 44px; cursor: pointer; }
.team-board button:disabled { cursor: not-allowed; opacity: .55; }
.team-board :focus-visible { outline: 2px solid var(--team-accent); outline-offset: 3px; }
.team-board ::selection { background: #dcc48e; color: #201c15; }
.team-board input, .team-board select {
  color: var(--team-ink); background: #211e19; border: 1px solid var(--team-line);
  border-radius: 8px; min-height: 44px; padding: .5rem; width: 100%; color-scheme: dark;
  caret-color: var(--team-accent);
}
.team-board-header, .team-roster-heading { display: flex; justify-content: space-between; gap: 1.5rem; align-items: flex-start; }
.team-board-header h3, .team-roster-heading h3 { margin-top: 0; }
.team-board-header label { flex: 0 0 200px; }
.team-day-nav, .team-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.team-day-nav { margin: 1rem 0; }
.team-draft-toolbar { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1rem 0; border-block: 1px solid var(--team-line); }
.team-draft-toolbar strong { font-weight: 500; }
.team-feedback:empty, .team-person[hidden], .team-search-empty[hidden] { display: none; }
.team-error { background: #462b27; color: #ffe5de; padding: 1rem; border-radius: 10px; }
.team-plan-confirm { padding: 1rem; background: #2d3527; border-radius: 10px; }
.team-plan-confirm label { display: flex; gap: .75rem; align-items: center; margin-bottom: .75rem; }
.team-plan-confirm input { width: 22px; min-height: 22px; }
.team-roster { margin-block: 1.5rem 2rem; }
.team-roster-heading label { flex: 0 0 240px; font-size: .9rem; }
.team-roster-heading p { color: var(--team-muted); font-size: .9rem; }
.team-person-grid {
  display: flex; align-items: flex-start; gap: 1rem; overflow-x: auto; padding: .25rem .25rem .75rem;
  scroll-padding-inline: .25rem; scrollbar-color: #94815d #231f19; overscroll-behavior-x: contain;
}
.team-person { flex: 0 0 250px; background: #27231d; border: 1px solid var(--team-line); border-radius: 12px; padding: .75rem; transition: border-color 150ms ease-out; }
.team-person[draggable=true], .team-assigned-person[draggable=true] { cursor: grab; }
.team-person:hover, .team-person[data-selected=true] { border-color: var(--team-accent); }
.team-person[data-selected=true] { background: #3b3224; }
.team-person-head, .team-assigned-head { display: flex; gap: .75rem; align-items: center; margin-bottom: .75rem; }
.team-person-head h4 { font-size: 1rem; overflow-wrap: anywhere; }
.team-person-head p { font-size: .8rem; color: var(--team-muted); margin: .25rem 0 0; }
.team-portrait, .team-initials { display: block; flex: none; width: 48px; height: 58px; border-radius: 8px; }
.team-portrait { background-image: var(--portrait-sheet); background-size: 500% 400%; background-position: var(--portrait-x) var(--portrait-y); background-repeat: no-repeat; }
.team-initials { display: grid; place-items: center; background: #393022; color: #eddcb6; font-weight: 600; }
.team-skills { display: flex; gap: .25rem; flex-wrap: wrap; }
.team-skills button { padding: .25rem .5rem; border: 1px solid #8c7958; border-radius: 8px; background: transparent; color: var(--team-ink); display: flex; gap: .5rem; align-items: center; font-size: .85rem; }
.team-skills button:hover { background: #3c3224; }
.team-skills strong { font-variant-numeric: tabular-nums; color: #f4d795; }
.team-person-details { margin-block: .5rem; font-size: .85rem; }
.team-person-details summary { min-height: 44px; display: list-item; padding-block: .5rem; cursor: pointer; color: #eed6a5; }
.team-contract, .team-person-today { color: var(--team-muted); font-size: .82rem; }
.team-person > button { width: 100%; font-size: .85rem; }
.team-picked { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: 1rem; margin-bottom: 1.5rem; background: #353020; border-radius: 10px; }
.team-role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.team-role {
  display: flex; flex-direction: column; min-height: 320px; padding: 1rem; border: 1px solid var(--team-line);
  border-radius: 12px; background: #201f1a; transition: border-color 150ms ease-out, background-color 150ms ease-out;
}
.team-role[data-compatible=true], .team-role[data-drag-compatible=true] { border-color: #b9cd9d; }
.team-role[data-drag-over=true][data-drag-compatible=true] { outline: 2px solid #b9cd9d; outline-offset: 2px; background: #30382a; }
.team-role[data-drag-over=true][data-drag-compatible=false] { border-color: #dfab9d; background: #3a2823; }
.team-role-heading { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; }
.team-role-heading > span { font-size: .75rem; color: #f2ce9b; text-align: right; }
.team-role[data-covered=true] .team-role-heading > span { color: #c5dfa9; }
.team-role > p, .team-role-footer p { font-size: .85rem; color: var(--team-muted); margin-bottom: .75rem; }
.team-role-slot { flex: 1; min-height: 164px; }
.team-empty-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .5rem; min-height: 180px; padding: 1rem; border: 1px dashed #978468; border-radius: 10px; color: #d8c6a6; }
.team-empty-slot strong { font-size: .95rem; font-weight: 500; }
.team-empty-slot span { max-width: 24ch; font-size: .8rem; }
.team-assignees { display: flex; flex-direction: column; gap: .75rem; }
.team-assigned-person { padding: .75rem; border: 1px solid #8f7a55; border-radius: 10px; background: #332e23; }
.team-assigned-person[data-state=pending] { border-style: dashed; background: #3b3323; }
.team-assigned-person[data-state=draft] small { color: #f3d497; }
.team-assigned-head .team-portrait, .team-assigned-head .team-initials { width: 54px; height: 66px; }
.team-assigned-head h5 { font: inherit; font-weight: 600; font-size: 1rem; margin: 0 0 .25rem; overflow-wrap: anywhere; }
.team-assigned-head span { font-size: .8rem; }
.team-assigned-hours { display: flex; flex-wrap: wrap; gap: .5rem; }
.team-assigned-hours button { flex: 1 1 90px; padding: .4rem; border: 1px solid #b39b68; border-radius: 7px; color: #fff1d6; background: #4f4027; font-size: .85rem; font-variant-numeric: tabular-nums; }
.team-assigned-hours button:hover { background: #675232; }
.team-assigned-hours small { color: inherit; font-size: .7rem; }
.team-assigned-person > button { width: 100%; margin-top: .25rem; font-size: .8rem; min-height: 44px; padding: .25rem; background: transparent; }
.team-role-footer { padding-top: 1rem; }
.team-role-footer > button { width: 100%; font-size: .9rem; }
.team-role-footer .team-gap { color: #f1cba0; font-variant-numeric: tabular-nums; }
.team-optional, .team-bonus-help { margin-top: 2rem; padding-block: 1rem; border-block-start: 1px solid var(--team-line); }
.team-optional > summary, .team-bonus-help > summary { cursor: pointer; min-height: 44px; font-weight: 600; }
.team-shift-editor { margin: 1rem 0 0; padding-top: 1rem; border-block-start: 1px solid #bba16e; scroll-margin-top: 1.5rem; }
.team-shift-editor h3 { margin-top: 0; font-size: 1.05rem; }
.team-editor-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.team-editor-fields label:nth-child(-n+2) { grid-column: 1 / -1; }
.team-editor-fields label { font-size: .85rem; }
.team-repeat { margin: 1rem 0; padding: .5rem; border: 1px solid #81704f; border-radius: 8px; display: flex; gap: .5rem; flex-wrap: wrap; }
.team-repeat legend { padding-inline: .25rem; font-size: .8rem; }
.team-repeat label { display: flex; gap: .25rem; align-items: center; min-height: 44px; font-size: .8rem; }
.team-repeat input { width: 20px; min-height: 20px; }
.team-repeat p { flex-basis: 100%; font-size: .8rem; }
.team-shift-editor .team-actions > * { width: 100%; font-size: .85rem; }
.team-timetable { margin-block: 2rem; }
.team-timeline-scroll { overflow: auto; scrollbar-color: #94815d #231f19; }
.team-timeline { min-width: 720px; padding: 1rem .75rem .75rem 0; }
.team-timeline-head, .team-time-row { display: grid; grid-template-columns: 150px 1fr; gap: 1rem; align-items: center; }
.team-timeline-head { margin-bottom: .5rem; font-size: .8rem; color: var(--team-muted); }
.team-timeline-head > div { position: relative; height: 26px; }
.team-timeline-head > div span { position: absolute; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.team-time-row { padding: .5rem 0; border-top: 1px solid #5a503f; }
.team-time-row > strong { font-size: .88rem; font-weight: 500; }
.team-time-track { position: relative; min-height: 58px; background-color: #211e19; background-image: repeating-linear-gradient(to right, transparent, transparent calc(8.333% - 1px), #544936 calc(8.333% - 1px), #544936 8.333%); border-radius: 6px; }
.team-time-bar { position: absolute; top: 3px; bottom: 3px; padding: .25rem; overflow: hidden; background: #4f4027; border: 1px solid #b39b68; border-radius: 6px; color: #fff1d6; text-align: center; font-size: .75rem !important; line-height: 1.2; }
.team-time-bar span, .team-time-bar small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: inherit; font-size: inherit; }
.team-time-bar:hover { background: #675232; }
.team-mobile-shifts { display: none; }
/* Source cards stay beside the role slots while dragging on desktop. */
.team-planning-columns { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 1.5rem; align-items: start; margin-top: 1.5rem; }
.team-planning-columns .team-roster { position: sticky; top: 1rem; margin: 0; }
.team-planning-columns .team-roster-heading { display: block; }
.team-planning-columns .team-roster-heading label { display: block; margin-bottom: .75rem; }
.team-planning-columns .team-person-grid { flex-direction: column; max-height: min(680px, 70vh); overflow: auto; overscroll-behavior: contain; }
.team-planning-columns .team-person { width: 100%; flex: none; }
.team-reparts > .team-assignments > h3 { margin-top: 0; }
@media (max-width: 1000px) {
  .team-planning-columns { grid-template-columns: 1fr; }
  .team-planning-columns .team-roster { position: static; }
  .team-planning-columns .team-roster-heading { display: flex; }
  .team-planning-columns .team-person-grid { flex-direction: row; max-height: none; overflow-x: auto; }
  .team-planning-columns .team-person { width: 250px; flex: 0 0 250px; }
}
@media (max-width: 1100px) {
  .team-role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .team-board { font-size: .95rem; }
  .team-board-header, .team-roster-heading, .team-planning-columns .team-roster-heading { display: block; }
  .team-board-header label, .team-roster-heading label { display: block; margin-block: .75rem; }
  .team-draft-toolbar, .team-picked { display: block; }
  .team-draft-toolbar > .team-actions, .team-picked > button { margin-top: .75rem; }
  .team-role-grid { grid-template-columns: 1fr; }
  .team-person { flex-basis: 230px; }
  .team-role { min-height: 280px; }
  .team-timeline { min-width: 0; padding: 0; }
  .team-timeline-head, .team-time-track { display: none; }
  .team-time-row { display: block; }
  .team-mobile-shifts { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
  .team-mobile-shifts button { font-size: .85rem; }
  .team-timeline-scroll { overflow: visible; }
  .team-time-row > strong { font-size: 1rem; }
  .team-actions > *, .team-day-nav > * { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .team-board * { transition: none !important; scroll-behavior: auto !important; }
}
