.period-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
  font-family: var(--font-sans);
}

.period-modal .period-overlay {
  position: absolute;
  inset: 0;
  background: rgba(18,20,22,0.56);
  backdrop-filter: blur(6px) saturate(1.04);
  opacity: 0;
  transition: opacity .28s ease;
  pointer-events: auto;
}

.period-modal .period-sheet {
  display: flex;
  flex-direction: column;
  max-width: 480px;
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 110%);
  width: min(448px, 96%);
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  background: var(--card);
  box-shadow: 0 -18px 40px rgba(10,20,40,0.18);
  transition: transform .36s cubic-bezier(.2,.9,.25,1), opacity .22s ease;
  opacity: 0;
  pointer-events: auto;
  overflow: hidden;
}

.period-modal.open .period-overlay { opacity: 1; }
.period-modal.open .period-sheet { transform: translate(-50%, 0%); opacity: 1; }

.period-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 6px;
}

.period-sheet__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.period-sheet__close {
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
  padding: 8px;
  cursor: pointer;
  color: var(--text);
}

.period-sheet__body {
  padding: 0px 20px 40px;
  display: flex;
  flex-direction: column;
}

.period-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.period-option {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--white);
  border: 1px solid var(--border-light);
  box-shadow: var(--card-shadow-soft);
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition:
    transform .18s cubic-bezier(.2,.9,.2,1),
    box-shadow .18s ease,
    background-color .18s ease,
    border-color .18s ease;
  position: relative;
  overflow: hidden;
}

.period-option:hover,
.period-option:focus {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(10,20,40,0.08);
  outline: none;
}

.period-option[aria-selected="true"],
.period-option.active {
  background: linear-gradient(90deg, rgba(37,122,230,0.10), rgba(31,195,255,0.04));
  border-color: rgba(37,122,230,0.18);
  box-shadow: 0 14px 34px rgba(37,122,230,0.06);
}

.period-option::after {
  content: "";
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-block;
  background: transparent;
  transform: scale(.6);
  opacity: 0;
  transition: transform .22s cubic-bezier(.2,.9,.25,1), opacity .18s ease;
  flex: 0 0 28px;
  margin-left: 8px;
}

.period-option[aria-selected="true"]::after,
.period-option.active::after {
  background: linear-gradient(180deg, rgba(37,122,230,1), rgba(20,90,180,1));
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="white" d="M20.285 6.708l-11.39 11.39-5.178-5.177 1.415-1.414 3.763 3.763 9.975-9.975z"/></svg>') center/60% no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="white" d="M20.285 6.708l-11.39 11.39-5.178-5.177 1.415-1.414 3.763 3.763 9.975-9.975z"/></svg>') center/60% no-repeat;
  transform: scale(1);
  opacity: 1;
}

.period-option:focus-visible {
  box-shadow: 0 0 0 4px rgba(37,122,230,0.12);
  outline: none;
}

.period-custom {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 50px;
  padding: 14px 14px;
  font-weight: 500;
  background: var(--panel);
  color: var(--white);
  border: none;
  box-shadow: 0 8px 22px rgba(10,20,40,0.12);
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease;
  gap: 10px;
}

.period-custom:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(10,20,40,0.14); }

.period-modal[aria-hidden="true"] { visibility: hidden; }
.period-modal[aria-hidden="false"] { visibility: visible; }
