/* 2026-06-12 v11: DOM-confirmed final UI fixes */

/* Issue title: make editable button follow the same fitting classes as readonly span */
.issue-table td.issue-title-col {
  vertical-align: middle !important;
}

.issue-table .inline-title-editor {
  min-height: 30px !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
}

.issue-table .inline-title,
.issue-table .inline-static-title,
.issue-table .inline-title-view,
.issue-table .inline-title-textarea {
  width: 100% !important;
  box-sizing: border-box !important;
  text-align: left !important;
  font-weight: 700 !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

.issue-table .inline-title-view,
.issue-table .inline-static-title {
  display: block !important;
  min-height: 30px !important;
  height: auto !important;
  padding: 5px 6px !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text) !important;
  line-height: 14.74px !important;
  font-size: 12.5px !important;
}

.issue-table .inline-title-view.title-fit-1,
.issue-table .inline-static-title.title-fit-1 {
  font-size: 11.7px !important;
}

.issue-table .inline-title-view.title-fit-2,
.issue-table .inline-static-title.title-fit-2 {
  font-size: 11px !important;
  line-height: 14.74px !important;
}

.issue-table .inline-title-view.title-fit-wrap,
.issue-table .inline-static-title.title-fit-wrap {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.issue-table .inline-title-textarea {
  min-height: 34px !important;
  padding: 4px 6px !important;
  line-height: 14.74px !important;
  resize: none !important;
}

/* Text modal: keep attachment panel compact inside modal */
.text-modal-card {
  width: min(980px, calc(100vw - 56px)) !important;
}

.text-modal-rich,
.text-modal-input {
  min-height: 88px !important;
  max-height: min(48vh, 420px) !important;
  padding: 14px 16px !important;
}

.text-modal-editor-shell {
  min-height: 180px !important;
  max-height: min(52vh, 460px) !important;
}

.text-modal-attachments {
  margin: 8px 16px 0 !important;
  font-size: 11.5px !important;
}

.text-modal-attachments-summary {
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 6px !important;
  max-width: min(380px, 100%) !important;
}

.text-modal-attachments-toggle {
  min-height: 28px !important;
  height: 28px !important;
  padding: 0 10px !important;
  font-size: 11.5px !important;
  border-radius: 999px !important;
}

.text-modal-attachments-panel {
  width: min(360px, calc(100vw - 96px)) !important;
  max-height: 150px !important;
  padding: 8px 9px !important;
  font-size: 11.5px !important;
  line-height: 1.35 !important;
  overflow: auto !important;
  border-radius: 10px !important;
}

.text-modal-attachments-title {
  font-size: 11.5px !important;
  margin-bottom: 6px !important;
}

.text-modal-attachments-list {
  gap: 6px !important;
}

.text-modal-attachment-item {
  gap: 6px !important;
  padding: 6px 0 !important;
}

.text-modal-attachment-item .attachment-file-meta,
.text-modal-attachment-item .attachment-file-actions {
  font-size: 11px !important;
}

/* Create issue attachment: remove inline-style dependency by using clean v11 markup */
.issue-form-card .create-attachment-panel-v11 {
  margin-top: 16px !important;
  padding: 14px 16px 16px !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  background: #fbfdff !important;
}

.issue-form-card .create-attachment-panel-v11 .create-attachment-head {
  margin-bottom: 10px !important;
}

.issue-form-card .create-attachment-grid-v11 {
  display: grid !important;
  grid-template-columns: minmax(260px, 1.9fr) 150px 84px minmax(180px, 1.15fr) !important;
  gap: 10px !important;
  align-items: end !important;
}

.issue-form-card .create-attachment-field-v11 {
  min-width: 0 !important;
  display: grid !important;
  grid-template-rows: 22px 40px !important;
  align-items: end !important;
}

.issue-form-card .create-attachment-field-v11 > label:not(.attachment-final-check-v11),
.issue-form-card .create-attachment-field-spacer {
  display: block !important;
  height: 22px !important;
  min-height: 22px !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 13px !important;
  line-height: 18px !important;
}

.issue-form-card .create-attachment-grid-v11 input[type="file"],
.issue-form-card .create-attachment-grid-v11 select,
.issue-form-card .create-attachment-grid-v11 input[type="text"] {
  width: 100% !important;
  height: 40px !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 8px 10px !important;
  box-sizing: border-box !important;
}

.issue-form-card .attachment-final-check-v11 {
  width: 84px !important;
  height: 40px !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  border: 1px solid var(--line) !important;
  border-radius: 9px !important;
  background: #fff !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

.issue-form-card .attachment-final-check-v11 input {
  margin: 0 !important;
  flex: 0 0 auto !important;
}

.issue-form-card .attachment-final-check-v11 span {
  display: inline-block !important;
  white-space: nowrap !important;
}

@media (max-width: 980px) {
  .issue-form-card .create-attachment-grid-v11 {
    grid-template-columns: minmax(220px, 1fr) 140px 84px !important;
  }
  .issue-form-card .create-attachment-remark-v11 {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 720px) {
  .issue-form-card .create-attachment-grid-v11 {
    grid-template-columns: 1fr !important;
  }
  .issue-form-card .create-attachment-field-v11 {
    grid-template-rows: auto 40px !important;
  }
  .issue-form-card .create-attachment-field-spacer {
    display: none !important;
  }
}
