.team-period-control {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 156px;
}

.team-period-control > span {
  padding-left: 2px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.team-period-trigger {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 156px;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 0 16px;
  background: rgba(255, 253, 248, 0.9);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 5px 18px rgba(28, 24, 18, 0.025);
}

.team-period-trigger:hover,
.team-period-trigger[aria-expanded="true"] {
  border-color: #bfb5a7;
  background: #fffdf8;
}

.team-period-trigger strong {
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
}

.team-period-trigger svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  transition: transform 140ms ease;
}

.team-period-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

#teamPeriod {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.team-period-popover {
  position: absolute;
  z-index: 80;
  top: calc(100% + 10px);
  right: 0;
  width: min(390px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffdf8;
  box-shadow: 0 24px 60px rgba(28, 24, 18, 0.18);
}

.team-period-popover[hidden] {
  display: none;
}

.team-period-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 14px;
}

.team-period-presets button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f3ea;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.team-period-presets button:hover,
.team-period-presets button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.team-period-calendar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.team-period-calendar-title strong {
  font-size: 12px;
  font-weight: 600;
}

.team-period-calendar-title span {
  color: var(--muted);
  font-size: 10px;
}

.team-period-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.team-period-fields label {
  display: grid;
  gap: 6px;
}

.team-period-fields label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.team-period-fields input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.team-period-fields input:focus {
  border-color: var(--ink);
  outline: 2px solid rgba(17, 17, 15, 0.08);
  outline-offset: 1px;
}

.team-period-error {
  min-height: 17px;
  margin: 9px 1px 0;
  color: var(--red, #a74637);
  font-size: 10px;
  line-height: 1.4;
}

.team-period-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.team-period-actions button {
  min-height: 38px;
  border-radius: 10px;
  padding: 0 13px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.team-period-actions .secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.team-period-actions .primary {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
}

@media (max-width: 700px) {
  .team-period-control {
    min-width: 0;
  }

  .team-period-trigger {
    min-width: 138px;
    min-height: 50px;
    padding-inline: 13px;
  }

  .team-period-trigger strong {
    font-size: 14px;
  }

  .team-period-popover {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100dvh - 24px);
    overflow: auto;
  }
}
