/* ============================================================================
   ADS Edit Ticket - compact layout  (Option C: dense single column)
   ----------------------------------------------------------------------------
   LAYOUT / SPACING ONLY, every rule scoped to #page-edit.  No markup, element IDs,
   handlers, validation, API calls or JavaScript are touched; the Create Ticket
   screen (which shares #issueForm) is not affected.  Nothing is hidden or removed
   (the Create-only fields stay hidden exactly as 17-core-edit-ticket.css already does).

   Loaded LAST (after 29-ads-dashboard-compact.css).  Earlier layers use !important
   heavily, so declarations here carry !important too - intentional.
   To roll back, delete this file's <link> line from Core/templates/_styles.html.

   Layout (content width of the Edit Ticket page):
     [ Edit Ticket - subtitle ]                                       one line
     [ notice | 1 Repository | 2 Ticket ]                             one row
     [ #245 title ................................ repo  Open ]      slim banner
     [ Effort & Due: 4 tiles + progress + warnings | timer ]          one band
     [ Title ................................................... ]
     [ Milestone | Module | Assignee | Label ]                        one row
     [ Description ............................................ ]
     [ Comments (wide)                       | Issue relationships ]  side by side
     [ hint .......................................... EDIT TICKET ]  slim sticky bar

   This also replaces the old 17-core-edit-ticket.css two-panel grid, whose
   direct-child rules no longer match the .ads-form-main / .ads-form-side markup
   (that is what produced the empty boxes above "Ticket details").
   ========================================================================== */

html body #page-edit { container-type: inline-size !important; container-name: edt !important; }

/* ---------- page frame ---------- */
html body #page-edit .page-body {
  display: grid !important; grid-template-columns: minmax(0, 1fr) !important; align-content: start !important;
  gap: 8px !important; padding: 8px 12px 10px !important; max-width: 1560px !important; margin-left: 0 !important; margin-right: 0 !important;
}
html body #page-edit .page-body > * { grid-column: 1 / -1 !important; min-width: 0 !important; margin: 0 !important; }

/* ---------- header: title + subtitle on one line ---------- */
html body #page-edit .edit-page-head { display: flex !important; flex-wrap: wrap !important; align-items: baseline !important; gap: 2px 12px !important; margin: 0 !important; }
html body #page-edit .edit-page-head .page-screen-title { margin: 0 !important; font-size: 15px !important; }
html body #page-edit .edit-page-head .page-screen-title i { width: 24px !important; height: 24px !important; font-size: 12px !important; }
html body #page-edit .edit-page-sub { margin: 0 !important; font-size: 12px !important; }

/* ---------- picker: notice + repository + ticket in one row ---------- */
html body #page-edit .edit-picker-card {
  display: flex !important; flex-wrap: wrap !important; align-items: center !important; gap: 6px 14px !important; padding: 8px 10px !important; margin: 0 !important;
}
html body #page-edit .edit-form-notice {
  flex: 1 1 240px !important; margin: 0 !important; padding: 5px 9px !important; font-size: 11.5px !important; line-height: 1.35 !important; min-width: 0 !important;
}
html body #page-edit .edit-picker {
  flex: 3 1 460px !important; display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; margin: 0 !important; min-width: 0 !important;
}
html body #page-edit .edit-picker-step { gap: 8px !important; align-items: flex-end !important; }
html body #page-edit .edit-step-num { width: 20px !important; height: 20px !important; font-size: 11px !important; flex: none !important; margin-bottom: 4px !important; }
html body #page-edit .edit-picker-step .field-group { margin: 0 !important; }
html body #page-edit .edit-picker-step .field-label { font-size: 10.5px !important; margin: 0 0 2px !important; }
html body #page-edit .edit-picker-step select { height: 28px !important; font-size: 12.5px !important; padding: 0 8px !important; }

/* ---------- ticket banner ---------- */
html body #page-edit .edit-ticket-banner { padding: 5px 12px !important; margin: 0 !important; gap: 4px 10px !important; min-height: 0 !important; }
html body #page-edit .etb-num { font-size: 13.5px !important; }
html body #page-edit .etb-title { font-size: 12.5px !important; flex: 1 1 200px !important; }
html body #page-edit .etb-chip { padding: 2px 9px !important; font-size: 11px !important; }

/* ---------- Effort & Due ---------- */
html body #page-edit .edit-effort-panel { margin: 0 !important; padding: 8px 12px !important; border-left-width: 4px !important; }
html body #page-edit .tet-head { margin-bottom: 6px !important; gap: 2px 10px !important; }
html body #page-edit .tet-title { font-size: 13px !important; }
html body #page-edit .tet-sub { font-size: 11px !important; }
html body #page-edit .tet-body { grid-template-columns: minmax(0, 1fr) 210px !important; gap: 8px 14px !important; }
html body #page-edit .tet-grid { gap: 6px !important; }
html body #page-edit .tet-tile { padding: 5px 10px !important; border-radius: 8px !important; }
html body #page-edit .tet-k { font-size: 9.5px !important; }
html body #page-edit .tet-v { font-size: 16px !important; margin-top: 0 !important; }
html body #page-edit .tet-s { font-size: 10.5px !important; min-height: 0 !important; }
html body #page-edit .tet-bar { height: 6px !important; margin: 8px 0 2px !important; }
html body #page-edit .tet-warns { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 4px 6px !important; margin-top: 6px !important; }
html body #page-edit .tet-row { padding: 4px 9px !important; font-size: 11.5px !important; border-radius: 8px !important; line-height: 1.3 !important; }
html body #page-edit .tet-timer { padding: 8px 10px !important; border-radius: 8px !important; }
html body #page-edit .tet-timer-state { font-size: 11.5px !important; }
html body #page-edit .tet-clock { font-size: 22px !important; margin: 2px 0 6px !important; }
html body #page-edit .tet-timer .ts-btn, html body #page-edit .tet-btn { height: 26px !important; font-size: 11.5px !important; }
html body #page-edit .tet-timer-sub { margin-top: 6px !important; font-size: 10.5px !important; }

/* ---------- fields: title / properties row / description in ONE card ---------- */
html body #page-edit .edit-fields-wrap { padding: 0 !important; margin: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; }
html body #page-edit #issueForm .form-grid#form-grid-inner {
  display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; grid-template-rows: none !important; align-items: start !important;
  gap: 8px 10px !important; padding: 10px !important;
  background: var(--ads-card) !important; border: 1px solid var(--ads-line) !important; border-radius: var(--ads-r-lg) !important; box-shadow: var(--ads-shadow) !important;
}
/* retire the legacy painted panels + captions (cosmetic pseudo-elements only) */
html body #page-edit #issueForm .form-grid#form-grid-inner::before,
html body #page-edit #issueForm .form-grid#form-grid-inner::after,
html body #page-edit #fg-title::before,
html body #page-edit #fg-milestone::before { content: none !important; display: none !important; }
/* the two wrappers dissolve so their fields sit on the form grid */
html body #page-edit #issueForm .ads-form-main,
html body #page-edit #issueForm .ads-form-side { display: contents !important; }

html body #page-edit #issueForm #form-grid-inner > .field-group,
html body #page-edit #issueForm .ads-form-main > .field-group,
html body #page-edit #issueForm .ads-form-side > .field-group {
  position: relative !important; margin: 0 !important; margin-inline: 0 !important; padding: 0 !important; min-width: 0 !important; grid-row: auto !important;
}
html body #page-edit #issueForm #fg-title { grid-column: 1 / -1 !important; order: 1 !important; margin: 0 !important; }
html body #page-edit #issueForm #fg-milestone { grid-column: auto !important; order: 2 !important; margin: 0 !important; z-index: 4 !important; }
html body #page-edit #issueForm #fg-module { grid-column: auto !important; order: 3 !important; z-index: 3 !important; }
html body #page-edit #issueForm #fg-assignee { grid-column: auto !important; order: 4 !important; z-index: 2 !important; }
html body #page-edit #issueForm #fg-label { grid-column: auto !important; order: 5 !important; margin: 0 !important; z-index: 1 !important; }
html body #page-edit #issueForm #description-container { grid-column: 1 / -1 !important; order: 6 !important; margin: 0 !important; }
html body #page-edit #issueForm #fg-actions { grid-column: 1 / -1 !important; order: 7 !important; margin: 0 !important; padding: 0 !important; border: 0 !important; min-height: 0 !important; }
html body #page-edit #issueForm .field-label { font-size: 10.5px !important; margin: 0 0 2px !important; }
html body #page-edit #issueForm .field-group input[type="text"],
html body #page-edit #issueForm .field-group select { height: 28px !important; font-size: 12.5px !important; padding: 0 8px !important; }
html body #page-edit #issueForm .ads-checkbox-dropdown,
html body #page-edit #issueForm .ads-checkbox-dropdown > *:first-child { min-height: 28px !important; font-size: 12.5px !important; }
html body #page-edit #issueForm .subissue-role-help { margin-top: 3px !important; padding: 3px 8px !important; font-size: 10.5px !important; }
html body #page-edit #description { min-height: 120px !important; padding: 6px 8px !important; font-size: 12.5px !important; resize: vertical !important; }
html body #page-edit .desc-attach-row { margin-top: 4px !important; gap: 8px !important; }
html body #page-edit .desc-drop-hint { font-size: 11px !important; }

/* ---------- comments (wide) + issue relationships ---------- */
html body #page-edit #comments-section,
html body #page-edit .issue-relationships-section {
  max-width: none !important; margin: 0 !important; padding: 8px 10px !important; border-radius: var(--ads-r-lg) !important;
}
html body #page-edit .comments-header,
html body #page-edit .issue-relationships-header { padding-bottom: 6px !important; margin-bottom: 8px !important; gap: 8px !important; }
html body #page-edit .comments-title-wrap { gap: 8px !important; }
html body #page-edit .comments-title-wrap h3,
html body #page-edit .issue-relationships-header h3 { font-size: 13px !important; margin: 0 !important; }
html body #page-edit .issue-relationships-header p { margin: 1px 0 0 !important; font-size: 10.5px !important; line-height: 1.3 !important; }
html body #page-edit .comment-count-badge { padding: 1px 8px !important; font-size: 10.5px !important; }
html body #page-edit .comments-header-actions { gap: 6px !important; }
html body #page-edit .close-ticket-btn, html body #page-edit .audit-log-btn { height: 26px !important; padding: 0 10px !important; font-size: 11.5px !important; }
html body #page-edit .comment-search-container { max-width: 200px !important; }
html body #page-edit .comment-search-container input { height: 26px !important; font-size: 11.5px !important; }
html body #page-edit .comment-history { max-height: 340px !important; gap: 8px !important; margin-bottom: 8px !important; }
html body #page-edit .comment-content { padding: 6px 10px !important; border-radius: 8px !important; font-size: 12.5px !important; line-height: 1.4 !important; }
html body #page-edit .comment-author { font-size: 12px !important; }
html body #page-edit .comment-time { font-size: 10.5px !important; }
html body #page-edit #comments-section .avatar-img { width: 28px !important; height: 28px !important; border-width: 1.5px !important; }
html body #page-edit .add-comment-container { gap: 8px !important; }
html body #page-edit .comment-drop-zone { padding: 6px 8px !important; }
html body #page-edit .comment-textarea { min-height: 56px !important; padding: 6px 8px !important; font-size: 12.5px !important; }
html body #page-edit .comment-attach-row { margin-top: 5px !important; gap: 8px !important; }
html body #page-edit .comment-attach-btn { height: 26px !important; padding: 0 10px !important; font-size: 11.5px !important; }
html body #page-edit .comment-drop-hint { font-size: 10.5px !important; }
html body #page-edit .comment-actions { margin-top: 6px !important; gap: 8px !important; }
html body #page-edit .comment-submit-btn { height: 28px !important; padding: 0 16px !important; font-size: 12px !important; }

html body #page-edit .relationship-refresh-btn { height: 26px !important; padding: 0 10px !important; font-size: 11.5px !important; }
html body #page-edit .issue-relationships-content { min-height: 0 !important; }
html body #page-edit .relationship-current-row { margin-bottom: 8px !important; }
html body #page-edit .relationship-columns { grid-template-columns: minmax(0, 1fr) !important; gap: 8px !important; }
html body #page-edit .relationship-column { padding: 8px 10px !important; border-radius: 8px !important; }
html body #page-edit .relationship-column-title { font-size: 10.5px !important; margin-bottom: 6px !important; }
html body #page-edit .relationship-child-list { gap: 6px !important; }
html body #page-edit .relationship-issue-card { padding: 6px 10px !important; gap: 8px !important; }
html body #page-edit .relationship-card-title { font-size: 12px !important; }
html body #page-edit .relationship-card-meta { font-size: 10.5px !important; }
html body #page-edit .relationship-labels { margin-top: 4px !important; }
html body #page-edit .relationship-empty { padding: 8px !important; gap: 3px !important; }
html body #page-edit .relationship-empty > small { font-size: 10px !important; }
html body #page-edit .relationship-source-note { margin-bottom: 6px !important; padding: 4px 8px !important; font-size: 10.5px !important; }

/* ---------- sticky save bar: slim ---------- */
html body #page-edit .edit-bottom-actions {
  position: sticky !important; bottom: 6px !important; z-index: 6 !important; margin: 0 !important; padding: 6px 12px !important; gap: 12px !important; min-height: 0 !important;
  border-radius: var(--ads-r-lg) !important;
}
html body #page-edit .edit-bottom-actions::before { font-size: 11.5px !important; }
html body #page-edit .edit-bottom-actions .edituh { min-width: 150px !important; height: 32px !important; padding: 0 20px !important; font-size: 12.5px !important; border-radius: var(--ads-r) !important; }

/* ============================================================================
   WIDE (>= 1000px): comments and relationships side by side
   ========================================================================== */
@container edt (min-width: 1000px) {
  html body #page-edit .page-body { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr) !important; }
  /* only when the relationships card is actually showing does comments give up the full row */
  html body #page-edit #comments-section:has(~ #issue-relationships-section:not([style*="none"])) { grid-column: 1 !important; }
  html body #page-edit #issue-relationships-section { grid-column: 2 !important; align-self: start !important; }
}

/* ============================================================================
   NARROW
   ========================================================================== */
@container edt (max-width: 760px) {
  html body #page-edit #issueForm .form-grid#form-grid-inner { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  html body #page-edit .edit-picker { grid-template-columns: minmax(0, 1fr) !important; }
  html body #page-edit .tet-body { grid-template-columns: minmax(0, 1fr) !important; }
  html body #page-edit .tet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  html body #page-edit .tet-warns { grid-template-columns: minmax(0, 1fr) !important; }
  html body #page-edit .edit-bottom-actions { flex-direction: row !important; bottom: 70px !important; }
  html body #page-edit .edit-bottom-actions::before { text-align: left !important; }
  html body #page-edit .edit-bottom-actions .edituh { width: auto !important; min-width: 120px !important; }
}
@container edt (max-width: 480px) {
  html body #page-edit #issueForm .form-grid#form-grid-inner { grid-template-columns: minmax(0, 1fr) !important; }
  html body #page-edit .edit-bottom-actions::before { display: none !important; }
  html body #page-edit .edit-bottom-actions .edituh { width: 100% !important; }
}
