.todo-modal-open {
  overflow: hidden;
}

.todo-modal-host {
  position: relative;
  z-index: 2000;
}

.todo-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 25, 0.45);
}

.todo-modal-backdrop[hidden],
.todo-modal-shell[hidden] {
  display: none !important;
}

.todo-modal-shell {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(560px, calc(100vw - 2rem));
  max-height: min(80vh, 760px);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #eceae5;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.todo-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #f0efeb;
}

.todo-modal-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a19;
}

.todo-modal-close {
  border: 1px solid #eceae5;
  border-radius: 5px;
  background: #ffffff;
  color: #6b6a66;
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
}

.todo-modal-content {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
}

.todo-modal-add {
  display: grid;
  grid-template-columns: 1fr 180px auto;
  gap: 8px;
}

.todo-modal-add input,
.todo-modal-add select {
  border: 1px solid #eceae5;
  border-radius: 5px;
  padding: 6px 8px;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
}

.todo-modal-add button {
  border: none;
  border-radius: 5px;
  background: #1a1a19;
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  cursor: pointer;
}

.todo-modal-items {
  flex: 1;
  min-height: 180px;
  overflow: auto;
  border-top: 1px solid #f0efeb;
  padding-top: 8px;
}

.todo-modal-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f5f4f1;
}

.todo-modal-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}

.todo-modal-item-title {
  font-size: 13px;
  color: #1a1a19;
}

.todo-modal-item-title[data-complete="true"] {
  text-decoration: line-through;
  color: #9a9892;
}

.todo-modal-item-owner {
  font-size: 11px;
  color: #6b6a66;
}

.todo-modal-item-remove {
  border: none;
  background: transparent;
  color: #b5554a;
  font-size: 12px;
  cursor: pointer;
}

.todo-modal-item-popup {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 25, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.todo-modal-item-popup[hidden] {
  display: none !important;
}

.todo-modal-item-popup-card {
  width: min(360px, 100%);
  background: #fff;
  border: 1px solid #eceae5;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.todo-modal-item-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.todo-modal-item-popup-header button {
  border: 1px solid #eceae5;
  background: #fff;
  color: #6b6a66;
  border-radius: 5px;
  font-size: 11px;
  padding: 4px 8px;
  cursor: pointer;
}

.todo-modal-item-popup-body label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: #6b6a66;
}

.todo-modal-item-popup-body input,
.todo-modal-item-popup-body select {
  border: 1px solid #eceae5;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}

.todo-modal-item-popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.todo-modal-item-popup-actions button {
  border: 1px solid #eceae5;
  border-radius: 5px;
  background: #fff;
  color: #1a1a19;
  font-size: 12px;
  padding: 5px 9px;
  cursor: pointer;
}
