.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(2px);
}

.task-dialog {
  display: grid;
  gap: 14px;
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.28);
}

.card-task-dialog {
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  max-height: min(78vh, 760px);
  padding: 14px;
}

.card-task-dialog .dialog-header {
  margin: -14px -14px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  padding: 12px 14px 10px;
  backdrop-filter: blur(10px);
}

.dialog-scroll-body {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 2px;
}

.card-task-dialog .dialog-header h2 {
  font-size: 19px;
}

.dialog-header-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 3px;
}

.dialog-header-status-row .section-kicker {
  margin: 0;
}

.dialog-header-meta {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.card-task-dialog .rich-editor {
  min-height: 90px;
}

.card-task-dialog .dialog-actions {
  margin: 0 -14px -14px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  padding: 8px 14px 10px;
  backdrop-filter: blur(10px);
}

.task-delete-link {
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--red);
  padding: 0;
  font-size: 12px;
  font-weight: 850;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dialog-header h2 {
  margin: 0;
  font-size: 22px;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: #eef3f9;
  color: #26354f;
  font-size: 20px;
  font-weight: 900;
}

.editor-shell {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
}

.editor-toolbar {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.editor-toolbar button {
  min-width: 34px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: #ffffff;
  color: #26354f;
  font-weight: 900;
}

.rich-editor {
  min-height: 180px;
  padding: 12px;
  outline: none;
  line-height: 1.6;
}

.rich-editor:empty::before {
  color: #9aa6b8;
  content: attr(data-placeholder);
}

.rich-editor img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  margin: 10px 0;
  border-radius: 8px;
  object-fit: contain;
}

.attachment-panel {
  display: grid;
  gap: 10px;
  border: 1px dashed #c8d2df;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.attachment-panel.disabled {
  opacity: 0.78;
}

.attachment-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.attachment-panel-header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.attachment-panel-header strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.attachment-panel-header span,
.attachment-empty {
  color: var(--faint);
  font-size: 12px;
  font-weight: 750;
}

.attachment-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  white-space: nowrap;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
  color: var(--blue);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
  transition: transform 120ms ease, box-shadow 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.attachment-add-button .menu-svg-icon {
  width: 14px;
  height: 14px;
}

.attachment-add-button:hover:not(:disabled) {
  border-color: rgba(37, 99, 235, 0.36);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.16);
  transform: translateY(-1px);
}

.attachment-add-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: none;
}

.attachment-empty {
  display: grid;
  min-height: 46px;
  place-items: center;
  border: 1px dashed #d5deea;
  border-radius: 8px;
  background: #ffffff;
}

.attachment-list {
  display: grid;
  gap: 8px;
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
}

.attachment-item a {
  display: grid;
  flex: 1;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.attachment-pending-file {
  display: grid;
  flex: 1;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.attachment-item img,
.attachment-file-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #eef4ff;
}

.attachment-item img {
  object-fit: cover;
}

.attachment-file-icon {
  display: grid;
  place-items: center;
  color: var(--blue);
  font-size: 10px;
  font-weight: 900;
}

.attachment-item strong,
.attachment-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-item strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.attachment-item small {
  color: var(--faint);
  font-size: 11px;
  font-weight: 750;
}

.attachment-item button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
}

.attachment-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 31px;
  min-height: 28px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--blue);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 850;
}

.attachment-count-icon {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.attachment-count b {
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
}
