.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .4);
  backdrop-filter: blur(2px);
}
.overlay[hidden] { display: none; }

.modal {
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 22px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}

.modal-title {
  margin: 0 0 18px;
  font-size: 17px;
  font-weight: 700;
}

.field { margin-bottom: 14px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

label {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 600;
}

.hint {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
label .hint { margin-left: 6px; }

input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
textarea { resize: vertical; min-height: 64px; }

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.seg {
  display: flex;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.seg-item {
  flex: 1;
  padding: 8px 4px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: .15s;
}
.seg-item:last-child { border-right: 0; }
.seg-item:hover { color: var(--text); }
.seg-item.is-active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.weekdays {
  display: flex;
  gap: 6px;
}
.wd {
  flex: 1;
  aspect-ratio: 1;
  max-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: .15s;
}
.wd:hover { border-color: var(--accent); }
.wd.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.color-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-btn {
  width: 44px;
  height: 44px;
  border: 3px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: .15s;
  position: relative;
}

.color-btn:active {
  transform: scale(.9);
}

.color-btn.is-active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--card);
}

.color-btn[data-color="green"] { background: var(--c-green); }
.color-btn[data-color="yellow"] { background: var(--c-yellow); }
.color-btn[data-color="orange"] { background: var(--c-orange); }
.color-btn[data-color="red"] { background: var(--c-red); }
.color-btn[data-color="pink"] { background: var(--c-pink); }
.color-btn[data-color="purple"] { background: var(--c-purple); }
.color-btn[data-color="blue"] { background: var(--c-blue); }
.color-btn[data-color="cyan"] { background: var(--c-cyan); }


.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

.overlay-confirm { z-index: 60; }

.modal-confirm {
  max-width: 380px;
  padding: 20px;
}

.confirm-message {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  word-break: break-word;
}
