.tcr-root {
  position: fixed;
  inset: 0;
  z-index: 10000;
  color: #122033;
}

body.tcr-active .modal-panel,
body.tcr-active .modal-panel--task-create,
body.tcr-active .modal-backdrop,
body.tcr-active .drawer-panel,
body.tcr-active .drawer-backdrop,
body.tcr-active [role="dialog"]:not(.tcr-modal),
body.tcr-active [aria-modal="true"]:not(.tcr-modal) {
  display: none !important;
}

.tcr-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 24, 39, 0.46);
}

.tcr-modal {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: 16px auto;
  overflow: hidden;
  border: 1px solid #c9d6e7;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 28px 80px -42px rgba(13, 24, 39, 0.8);
}

.tcr-modal header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e2e9f2;
  background: #f8fbff;
}

.tcr-modal h2 {
  margin: 0 0 4px;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

.tcr-modal header p,
.tcr-note,
.tcr-error {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.tcr-close {
  width: 34px;
  height: 34px;
  min-width: 34px !important;
  padding: 0 !important;
  border: 1px solid #cbd6e6 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #334155 !important;
  box-shadow: none !important;
  font-size: 18px !important;
  line-height: 1 !important;
}

.tcr-content {
  overflow: auto;
  padding: 20px 24px;
}

.tcr-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tcr-choice-card {
  position: relative;
  display: grid !important;
  align-content: end;
  gap: 8px;
  min-height: 190px;
  overflow: hidden;
  padding: 24px !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #122033 !important;
  text-align: left !important;
  box-shadow: 0 18px 42px -32px rgba(15, 23, 42, 0.8) !important;
}

.tcr-choice-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.9;
  pointer-events: none;
}

.tcr-choice-single::before {
  background: linear-gradient(135deg, #e7f8f1 0%, #f8fbff 50%, #dceeff 100%);
}

.tcr-choice-recurring::before {
  background: linear-gradient(135deg, #fff4dc 0%, #fffaf1 48%, #e5f0ff 100%);
}

.tcr-choice-card:hover {
  border-color: #315d95 !important;
  transform: translateY(-1px);
}

.tcr-choice strong {
  position: relative;
  display: block;
  font-size: 21px;
  letter-spacing: 0;
}

.tcr-choice small,
.tcr-choice em {
  position: relative;
  display: block;
  font-size: 13px;
  line-height: 1.45;
}

.tcr-choice small {
  color: #334155;
  font-weight: 700;
}

.tcr-choice em {
  color: #475569;
  font-style: normal;
}

.tcr-choice-mark {
  position: absolute;
  top: 18px;
  left: 20px;
  display: grid !important;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  color: #ffffff !important;
  font-size: 20px !important;
  font-weight: 800;
  box-shadow: 0 14px 32px -20px rgba(15, 23, 42, 0.9);
}

.tcr-choice-single .tcr-choice-mark {
  background: #13845f;
}

.tcr-choice-recurring .tcr-choice-mark {
  background: #b45309;
}

.tcr-loading {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 150px;
  padding: 24px;
  border: 1px solid #d8e1ee;
  border-radius: 8px;
  background: #fbfdff;
  text-align: center;
}

.tcr-loading strong {
  font-size: 16px;
}

.tcr-loading span {
  color: #64748b;
  font-size: 13px;
}

.tcr-form {
  display: grid;
  gap: 16px;
}

.tcr-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tcr-field {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.tcr-wide {
  grid-column: 1 / -1;
}

.tcr-field > span {
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.tcr-field input,
.tcr-field select,
.tcr-field textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #cbd6e6;
  border-radius: 8px;
  background: #ffffff;
  color: #122033;
  font: inherit;
  letter-spacing: 0;
}

.tcr-field textarea {
  resize: vertical;
}

.tcr-search-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: none;
  max-height: 210px;
  overflow: auto;
  border: 1px solid #cbd6e6;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 40px -28px rgba(15, 23, 42, 0.9);
  z-index: 3;
}

.tcr-search-menu [hidden] {
  display: none !important;
}

.tcr-search-field:focus-within .tcr-search-menu,
.tcr-assignee-picker:focus-within .tcr-search-menu {
  display: grid;
}

.tcr-search-menu button,
.tcr-search-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  width: 100%;
  padding: 6px 10px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  color: #334155;
  font-size: 12px;
  text-align: left !important;
  box-shadow: none !important;
}

.tcr-search-menu button:hover,
.tcr-search-menu label:hover {
  background: #eef6ff !important;
}

.tcr-assignee-picker {
  max-width: none;
}

.tcr-assignee-picker .tcr-search-menu {
  max-height: 176px;
}

.tcr-assignee-menu input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-height: 14px;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
}

.tcr-selected-users {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 0;
  max-height: 50px;
  overflow: auto;
}

.tcr-selected-users span,
.tcr-selected-users small {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid #cbd6e6;
  border-radius: 8px;
  background: #f8fbff;
  color: #334155;
  font-size: 11px;
}

.tcr-field input[readonly] {
  background: #f4f7fb;
  color: #475569;
  cursor: default;
}

.tcr-series-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d8e1ee;
  border-radius: 8px;
  background: #fbfdff;
}

.tcr-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.tcr-section-head strong,
.tcr-section-head span {
  display: block;
}

.tcr-section-head strong {
  color: #122033;
  font-size: 15px;
}

.tcr-section-head span {
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
}

.tcr-note-alert {
  padding: 10px 12px;
  border: 1px solid #f0c36d;
  border-radius: 8px;
  background: #fff8e6;
  color: #8a5a00;
}

.tcr-preview {
  overflow: auto;
  border: 1px solid #d8e1ee;
  border-radius: 8px;
  background: #ffffff;
}

.tcr-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e9f2;
}

.tcr-preview-head span {
  color: #64748b;
  font-size: 12px;
}

.tcr-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.tcr-preview th,
.tcr-preview td {
  padding: 6px 8px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  white-space: nowrap;
}

.tcr-preview th {
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  text-transform: uppercase;
}

.tcr-preview input {
  min-height: 30px;
  width: 100%;
  min-width: 112px;
  padding: 5px 7px;
  border: 1px solid #cbd6e6;
  border-radius: 6px;
  background: #ffffff;
  color: #122033;
  font: inherit;
}

.tcr-preview input[name="instance_period_tag"] {
  min-width: 92px;
}

.tcr-row-remove {
  display: inline-grid !important;
  place-items: center;
  width: 28px !important;
  min-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 !important;
  border: 1px solid #f1c7c7 !important;
  border-radius: 6px !important;
  background: #fff5f5 !important;
  color: #a61b1b !important;
  box-shadow: none !important;
  font-size: 16px !important;
  line-height: 1 !important;
}

.tcr-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.tcr-actions button {
  min-height: 38px !important;
  padding: 8px 14px !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}

.tcr-error {
  padding: 12px 24px;
  border-top: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

@media (max-width: 820px) {
  .tcr-modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    margin: 8px;
  }

  .tcr-choice,
  .tcr-grid {
    grid-template-columns: 1fr;
  }

  .tcr-content {
    padding: 16px;
  }
}
