/* Minimalist + modern refresh — applied 2026-04-06
   Goals: modern, simple, minimal; better spacing; single accent; low visual noise; keep JS/HTML unchanged
   Sources: digitalsilk.com (Minimalist trends), kontra.agency (2026 design trends)
*/

.issue-checklists,
.checklist-templates-page,
.checklist-template-form,
.checklist-template-apply,
.checklist-empty-state,
.checklist-page-hero,
.checklist-template-filters,
.checklist-template-card {
  /* Palette */
  --ck-accent: #2563eb; /* primary */
  --ck-accent-600: #1f4ed8;
  --ck-accent-soft: rgba(37,99,235,0.08);
  --ck-accent-soft-2: rgba(37,99,235,0.12);
  --ck-danger: #dc2626;
  --ck-surface: #ffffff;
  --ck-surface-soft: #f6f7f9;
  --ck-surface-muted: #f3f4f6;
  --ck-border: rgba(15,23,42,0.06);
  --ck-border-strong: rgba(15,23,42,0.08);
  --ck-text: #0f172a;
  --ck-text-soft: #667085;
  --ck-shadow: 0 1px 2px rgba(15,23,42,0.04);
  --ck-radius: 8px;
  color: var(--ck-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  font-smoothing: antialiased;
}

/* Panel / card */
.checklist-glass-panel {
  background: var(--ck-surface);
  border: 1px solid var(--ck-border);
  box-shadow: var(--ck-shadow);
  border-radius: var(--ck-radius);
}

/* Buttons */
.button-positive,
.issue-checklists .button-positive,
.checklist-templates-page .button-positive,
.button-link-muted,
.checklist-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  height: 30px;
  min-height: 30px;
  padding: 0 0.72rem;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none !important;
  box-sizing: border-box;
  cursor: pointer;
  white-space: nowrap;
  vertical-align: middle;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.button-positive,
.issue-checklists .button-positive,
.checklist-templates-page .button-positive,
.checklist-add-btn {
  background: #f3f7ff;
  color: var(--ck-accent);
  border: 1px solid rgba(37,99,235,0.18);
}
.button-positive:hover,
.checklist-add-btn:hover {
  background: var(--ck-accent);
  color: #ffffff !important;
  transform: translateY(-1px);
  border-color: var(--ck-accent-600);
}
.button-positive:focus,
.checklist-add-btn:focus {
  outline: 2px solid rgba(37,99,235,0.18);
  outline-offset: 2px;
}

.button-link-muted {
  color: #667085 !important;
  background: #f3f4f6;
  border: 1px solid rgba(15,23,42,0.08);
}
.button-link-muted:hover {
  background: #e5e7eb;
  color: var(--ck-text) !important;
  transform: translateY(-1px);
}
.button-link-muted:focus {
  outline: 2px solid rgba(15,23,42,0.08);
  outline-offset: 2px;
}

.button-standard { width: 110px; min-width: 110px; }
.button-inline { height: 24px; min-height: 24px; padding: 0 0.5rem; font-size: 11px; border-radius: 6px; }
input.button-positive,
input.button-link-muted,
input.checklist-add-btn,
input.button-standard,
button.button-positive,
button.button-link-muted,
button.checklist-add-btn,
button.button-standard {
  text-align: center;
  line-height: 1;
  padding-top: 0;
  padding-bottom: 0;
}
button.button-positive,
button.button-link-muted,
button.checklist-add-btn,
button.button-standard {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.danger-text { color: var(--ck-danger) !important; }
.button-link-muted.danger-text { color: #b42318 !important; }

/* Icon buttons: minimal icon-only */
.icon-button {
  position: relative;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ck-text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  box-shadow: none;
  transition: background 0.12s ease, transform 0.12s ease;
}
.icon-button::before { content: ''; }
.icon-button:hover {
  background: rgba(15,23,42,0.04);
  transform: translateY(-1px);
}
.icon-button:focus {
  outline: 2px solid var(--ck-accent);
  outline-offset: 2px;
}
.icon-button.subtle { opacity: 0.8; }
.icon-button.danger { color: var(--ck-danger); background: rgba(220,38,38,0.04); }

/* Toolbar / layout */
.issue-checklists { margin-top: 0.5rem; }
.issue-checklists-toolbar,
.checklist-template-apply,
.checklist-template-filters,
.checklist-page-hero,
.checklist-empty-state,
.checklist-template-form { padding: 0.6rem 0.8rem; margin-bottom: 0.6rem; }

.issue-checklists-toolbar,
.checklist-page-hero { display:flex; justify-content:space-between; align-items:center; gap:0.6rem; }

.toggle-pill { display:inline-flex; align-items:center; gap:0.45rem; min-height:34px; padding:0.3rem 0.65rem; border-radius:999px; background:var(--ck-surface-soft); border:1px solid var(--ck-border); color:var(--ck-text); font-size:13px; font-weight:600; }

.checklists-stack { display:grid; gap:0.6rem; grid-template-columns: 1fr; }

/* Card */
.checklist-card { padding:0.65rem; border-radius: var(--ck-radius); }
.checklist-card-head { display:flex; justify-content:space-between; align-items:center; gap:1.0rem; margin-bottom:0.6rem; padding: 0 1.0rem; }
.checklist-card-title-wrap { display:flex; align-items:center; gap:0.45rem; /* make title area wider */ flex: 0 0 70%; max-width: 70%; }

.checklist-title { font-size:1rem; font-weight:700; margin:0; flex: 1 1 100%; max-width: 100%; }

/* Ensure title text can use available space and wrap/truncate gracefully */
.checklist-title .editable-text,
.checklist-title span { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* spacing for editable title text */
.editable-text.checklist-title-text { margin-left: 12px; margin-right: 12px; }

/* Align editable title text and inline edit button vertically and increase title font-size slightly */
.checklist-card-title-wrap .editable-text.checklist-title-text {
  display: inline-flex;
  align-items: center;
  height: 28px;
  line-height: 1;
  font-size: 1.08rem;
}

.icon-button.inline-edit-btn {
  height: 28px;
  width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-left: 6px;
}
.checklist-section-title { font-size:0.95rem; font-weight:600; margin:0; }

.checklist-progress-badge, .checklist-section-count, .template-chip { display:inline-flex; align-items:center; justify-content:center; min-height:20px; border-radius:999px; padding:0.08rem 0.4rem; font-size:11px; font-weight:700; }
.checklist-progress-badge { background: var(--ck-accent-soft); color: var(--ck-accent); border: 1px solid var(--ck-border-strong); }

.checklist-sections { display:grid; gap:0.45rem; }
.checklist-section-card { background: var(--ck-surface); border:1px solid var(--ck-border); border-radius: var(--ck-radius); padding:0.45rem; }
.checklist-section-card--general { background: var(--ck-surface-soft); border-style:dashed; }

.checklist-section-head { display:flex; justify-content:space-between; align-items:center; gap:0.45rem; margin-bottom:0.45rem; }

.section-bullet { width:8px; height:8px; border-radius:50%; background: var(--ck-accent); }

.drag-handle { color: #94a3b8; cursor:grab; font-weight:700; font-size:12px; opacity:0.75; }

.checklist-items { list-style:none; padding:0; margin:0; display:grid; gap:0.28rem; justify-items: start; align-items: start; }

/* compact empty sections */
.checklist-section-card .checklist-items:empty { min-height: 0; padding: 0; }

.checklist-item { display:flex; align-items:center; gap:0.5rem; min-height:40px; padding:0.42rem 0.56rem; border-radius:10px; background:var(--ck-surface); border:1px solid var(--ck-border); transition: background 0.12s ease, border-color 0.12s ease; justify-content: flex-start; }
.checklist-item:hover { border-color: var(--ck-border-strong); background:#fcfdff; }
.checklist-item.done { opacity:0.95; background:#f8fbff; }
.checklist-item.done .checklist-item-subject { text-decoration:line-through; color:var(--ck-text-soft); }

/* Card layout tweaks */
.checklist-section-head { display:flex; justify-content:space-between; align-items:center; gap:0.6rem; margin-bottom:0.45rem; }
.checklist-section-title { font-size:0.95rem; font-weight:700; margin:0; color:var(--ck-text); }
.checklist-section-actions { display:flex; align-items:center; gap:0.35rem; }
.checklist-item-label { display:flex; align-items:center; gap:0.6rem; flex:1 1 auto; justify-content: flex-start; }
.checklist-item-subject { font-size:13px; text-align: left; display: block; }
.checklist-item-actions { display:flex; gap:0.2rem; align-items:center; }

.checklist-item-label { display:inline-flex; align-items:center; gap:0.45rem; flex:1 1 auto; }
.checklist-item-label input[type='checkbox'] { width:15px; height:15px; margin:0; }

.editable-text { cursor:pointer; transition: color 0.12s ease; }
.editable-text:hover { color: var(--ck-accent); }

.inline-edit-input, .template-input, .checklist-add-input, .checklist-template-apply-form select, .checklist-template-apply-form input[type='text'] { width:100%; min-height:34px; border:1px solid var(--ck-border); border-radius:8px; padding:0.36rem 0.58rem; background:#fff; color:var(--ck-text); box-sizing:border-box; }

.inline-add-form { margin-top:0.35rem; display:grid; grid-template-columns: 160px 1fr 72px; gap:0.4rem; align-items:center; }

.checklist-template-apply-form {
  display:grid;
  grid-template-columns:auto minmax(160px,1fr) 110px 110px;
  gap:0.4rem;
  align-items:end;
}
.checklist-template-apply-form > label {
  display:block;
  font-size:12px;
  font-weight:700;
  margin-bottom:0.2rem;
}
.checklist-template-apply-form .button-positive,
.checklist-template-apply-form .button-link-muted { width: 110px; min-width: 110px; justify-self: stretch; }
.checklist-template-apply-form .button-link-muted { margin-left: 0; }

/* Template cards */
.checklist-template-cards { display:grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap:0.6rem; }
.checklist-template-card { padding:0.7rem; display:grid; gap:0.6rem; border-radius:var(--ck-radius); border:1px solid var(--ck-border); }

.checklist-live-journal { margin-bottom:0.45rem; padding:0.42rem 0.56rem; border:1px solid var(--ck-border-strong); border-radius:8px; background:#fbfdff; }
.checklist-live-journal .journal-header { margin: 0 0 0.28rem; }
.checklist-live-journal .journal-info,
.checklist-live-journal .journal-meta,
.checklist-live-journal .journal-created-on,
.checklist-live-journal .journal-link { font-size: 11px; line-height: 1.35; }
.checklist-live-journal .journal-info strong { font-size: 11px; font-weight: 700; }
.checklist-live-journal .journal-content,
.checklist-live-journal .wiki,
.checklist-live-journal .wiki p,
.checklist-live-journal .wiki h1,
.checklist-live-journal .wiki h2,
.checklist-live-journal .wiki h3,
.checklist-live-journal .wiki h4,
.checklist-live-journal .wiki h5,
.checklist-live-journal .wiki h6 {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}
.checklist-live-journal .wiki h1,
.checklist-live-journal .wiki h2,
.checklist-live-journal .wiki h3,
.checklist-live-journal .wiki h4,
.checklist-live-journal .wiki h5,
.checklist-live-journal .wiki h6 {
  font-weight: 500;
  border: 0;
  padding: 0;
}
.checklist-live-journal .wiki p + p,
.checklist-live-journal .wiki h1 + h1,
.checklist-live-journal .wiki h2 + h2,
.checklist-live-journal .wiki h3 + h3,
.checklist-live-journal .wiki h4 + h4,
.checklist-live-journal .wiki h5 + h5,
.checklist-live-journal .wiki h6 + h6,
.checklist-live-journal .wiki p + h1,
.checklist-live-journal .wiki p + h2,
.checklist-live-journal .wiki p + h3,
.checklist-live-journal .wiki p + h4,
.checklist-live-journal .wiki p + h5,
.checklist-live-journal .wiki p + h6,
.checklist-live-journal .wiki h1 + p,
.checklist-live-journal .wiki h2 + p,
.checklist-live-journal .wiki h3 + p,
.checklist-live-journal .wiki h4 + p,
.checklist-live-journal .wiki h5 + p,
.checklist-live-journal .wiki h6 + p { margin-top: 0.2rem; }

.checklist-empty { color:var(--ck-text-soft); text-align:center; }

@media (max-width:900px) {
  .checklist-template-apply-form, .template-filter-grid, .template-form-grid, .template-meta-grid, .checklist-template-detail-grid { grid-template-columns: 1fr; }
  .issue-checklists-toolbar, .checklist-page-hero, .template-card-head, .checklist-card-head { flex-direction: column; align-items: stretch; }
  .inline-add-form { grid-template-columns: 1fr; }

  .checklist-template-grid-wrap { overflow-x: auto; }
  .checklist-template-grid-table { min-width: 900px; }
}

.checklist-template-grid-wrap { padding: 0; overflow: hidden; }
.checklist-template-grid-table { width: 100%; border-collapse: collapse; border-spacing: 0; table-layout: fixed; }
.checklist-template-grid-table thead th {
  background: #f5f5f5;
  color: #444;
  font-size: 12px;
  font-weight: 700;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid #d7d7d7;
  text-align: center;
  white-space: nowrap;
}
.checklist-template-grid-table thead th:first-child {
  text-align: left;
}
.checklist-template-grid-table tbody td {
  padding: 0.58rem 0.6rem;
  border-bottom: 1px solid #eeeeee;
  vertical-align: middle;
  font-size: 13px;
  text-align: center;
}
.checklist-template-grid-table thead th:last-child,
.checklist-template-grid-table tbody td:last-child {
  border-right: 0;
}
.checklist-template-grid-table tbody td.subject,
.checklist-template-grid-table tbody td.template-name-cell {
  text-align: left;
  vertical-align: top;
}
.checklist-template-grid-table tbody tr:hover { background: #ffffdd; }
.checklist-template-grid-table tbody tr:last-child td { border-bottom: none; }

.template-name-cell { min-width: 240px; }
.template-primary-link {
  color: #116699;
  font-weight: 700;
  text-decoration: none;
}
.template-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  margin-left: 0.35rem;
  vertical-align: middle;
}
.template-primary-link:hover { color: #c61a1a; }
.template-grid-subtext {
  margin-top: 0.18rem;
  color: #777;
  font-size: 12px;
  line-height: 1.4;
}
.template-grid-actions {
  white-space: nowrap;
}
.template-grid-actions.center {
  text-align: center;
}
.template-grid-actions .button-inline {
  display: inline-flex;
  align-items: center;
  margin: 0 0.08rem;
}
.template-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(170px, 1fr) minmax(170px, 1fr) auto;
  gap: 0.5cm;
  align-items: end;
}
.template-filter-grid > div > label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 0.5cm;
}
.checklist-template-form label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 0.28rem;
}
.checklist-template-form p {
  margin-top: 0;
  margin-bottom: 0.6rem;
}
.template-filter-actions,
.template-form-actions,
.checklist-detail-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.template-filter-actions {
  align-self: end;
}
.template-filter-actions .button-positive,
.template-filter-actions .button-link-muted,
.template-form-actions .button-positive,
.template-form-actions .button-link-muted,
.checklist-detail-actions .button-positive,
.checklist-detail-actions .button-link-muted {
  width: 110px;
  min-width: 110px;
}
.template-filter-actions .button-standard,
.template-form-actions .button-standard {
  justify-self: stretch;
}
.checklist-template-grid-table .center .template-chip,
.checklist-template-grid-table td.center .template-chip {
  margin: 0 auto;
}

.checklist-template-detail-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 0.6rem;
}
.checklist-template-detail-card {
  padding: 0.8rem;
}
.checklist-template-detail-card h3 {
  margin: 0 0 0.6rem;
  font-size: 15px;
}
.checklist-template-detail-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}
.checklist-template-detail-meta .label {
  display: block;
  margin-bottom: 0.12rem;
  color: var(--ck-text-soft);
  font-size: 12px;
}
.template-detail-section + .template-detail-section {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--ck-border);
}
.template-detail-section h4 {
  margin: 0 0 0.45rem;
  font-size: 13px;
}
.template-detail-section ol {
  margin: 0;
  padding-left: 1.1rem;
}
.template-detail-section li + li {
  margin-top: 0.28rem;
}
.checklist-detail-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* Checklist table-style rows */
.checklist-card--table {
  padding: 0.68rem 0.74rem 0.74rem;
}

.checklist-card-head--flat {
  margin-bottom: 0.42rem;
}

.checklist-sections-toolbar {
  margin-bottom: 0.42rem;
}

.checklist-section-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.checklist-section-chip-list:empty {
  display: none;
}

.checklist-section-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  min-height: 28px;
  padding: 0.22rem 0.42rem;
  border: 1px solid var(--ck-border);
  border-radius: 999px;
  background: #f8fafc;
}

.checklist-section-chip-label {
  color: var(--ck-text-soft);
  font-size: 12px;
  font-weight: 700;
}

.checklist-section-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 0.32rem;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--ck-accent);
  font-size: 11px;
  font-weight: 700;
}

.checklist-grid-head {
  display: grid;
  grid-template-columns: minmax(88px, 112px) minmax(120px, 180px) minmax(0, 1fr) minmax(88px, 108px);
  gap: 0;
  align-items: center;
  padding: 0;
  background: #f8fafc;
}

.checklist-grid-head--flat {
  border: 1px solid var(--ck-border);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
}

.checklist-grid-surface {
  border: 1px solid var(--ck-border);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  overflow: hidden;
  background: #fff;
}

.checklist-grid-col {
  padding: 0.46rem 0.58rem;
  color: var(--ck-text-soft);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
}

.checklist-grid-col + .checklist-grid-col {
  border-left: 1px solid rgba(15,23,42,0.04);
}

.checklist-sections--table {
  display: block;
  gap: 0;
}

.checklist-section-card--table {
  padding: 0;
  overflow: hidden;
}

.checklist-section-card--flat {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.checklist-section-card--table.checklist-section-card--general {
  background: transparent;
}

.checklist-section-card--flat .checklist-section-head {
  display: none;
}

.checklist-grid-body {
  list-style: none;
  margin: 0;
  padding: 0;
  display: block;
}

.checklist-item--table {
  display: grid;
  grid-template-columns: minmax(88px, 112px) minmax(120px, 180px) minmax(0, 1fr) minmax(88px, 108px);
  gap: 0;
  align-items: stretch;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  border-bottom: 1px solid var(--ck-border);
}

.checklist-section-card--flat:last-child .checklist-item--table:last-child,
.checklist-section-card--general:last-child .checklist-item--table:last-child {
  border-bottom: 0;
}

.checklist-item--table:hover {
  background: #fcfdff;
  border-color: var(--ck-border);
}

.checklist-item--table.done {
  background: #f8fbff;
}

.checklist-item--table > div {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0.4rem 0.58rem;
}

.checklist-item--table > div + div {
  border-left: 1px solid rgba(15,23,42,0.04);
}

.checklist-item-status-cell {
  gap: 0.34rem;
}

.checklist-item-status-cell .drag-handle {
  font-size: 10px;
}

.checklist-item-status-cell .checklist-item-toggle {
  width: 14px;
  height: 14px;
  margin: 0;
}

.checklist-item-section-cell {
  color: var(--ck-text-soft);
  font-size: 11px;
  font-weight: 600;
}

.checklist-item-title-cell {
  min-width: 0;
}

.checklist-item-title-cell .checklist-item-subject {
  display: block;
  min-width: 0;
  word-break: break-word;
  line-height: 1.3;
  font-size: 12px;
}

.checklist-item--table .checklist-item-actions {
  justify-content: center;
  gap: 0.18rem;
}

.checklist-add-form--flat {
  margin-top: 0.32rem;
  display: grid;
  grid-template-columns: 160px 1fr 72px;
  gap: 0.36rem;
  align-items: center;
}

.checklist-add-form--flat .checklist-add-input,
.checklist-add-form--flat .checklist-add-section-select {
  min-height: 36px;
  font-size: 13px;
  padding: 0.32rem 0.56rem;
  box-sizing: border-box;
}

.checklist-add-form--flat .checklist-add-section-select { max-width: 160px; }
.checklist-add-form--flat .checklist-add-input { width: 100%; }
.checklist-add-form--flat .checklist-add-btn { min-width: 72px; height: 36px; padding: 0 0.6rem; font-size: 13px; }

.checklist-item--table.dragging,
.checklist-section-card--table.dragging,
.checklist-section-chip.dragging {
  opacity: 0.55;
}

@media (max-width: 980px) {
  .checklist-grid-head,
  .checklist-item--table {
    grid-template-columns: minmax(72px, 92px) minmax(92px, 130px) minmax(0, 1fr) minmax(74px, 92px);
  }

  .checklist-grid-col,
  .checklist-item--table > div {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }

  .checklist-add-form--flat {
    grid-template-columns: minmax(108px, 140px) minmax(0, 1fr) auto;
  }
}

@media (max-width: 760px) {
  .checklist-grid-head {
    display: none;
  }

  .checklist-add-form--flat {
    grid-template-columns: 1fr;
  }

  .checklist-item--table {
    grid-template-columns: 1fr;
  }

  .checklist-item--table > div,
  .checklist-item--table > div + div {
    border-left: 0;
  }

  .checklist-item-status-cell {
    padding-bottom: 0.2rem;
  }

  .checklist-item-section-cell {
    padding-top: 0;
    padding-bottom: 0.1rem;
  }

  .checklist-item--table .checklist-item-actions {
    justify-content: flex-start;
    padding-top: 0.2rem;
  }
}

/* Ensure checklist area uses full available width */
.issue-checklists,
.checklists-stack,
.checklist-card,
.checklist-sections,
.checklist-grid-surface {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

/* Make inner add-form stretch to full width container */
.checklist-add-form--flat { grid-template-columns: 160px 1fr 72px; width: 100%; }

/* Ensure section cards and items stretch to full width */
.checklist-card { display: block; width: 100% !important; }
.checklist-card > .checklist-grid-surface { width: 100% !important; }
.checklist-section-card { width: 100% !important; }
.checklist-section-card .checklist-items { width: 100% !important; }
.checklist-item, .checklist-item--table { width: 100% !important; }

/* Right-side actions align right and shrink if needed */
.checklist-card-actions { flex: 1 1 0; display:flex; justify-content:flex-end; align-items:center; gap:0.5rem; }

@media (max-width: 900px) {
  .checklist-card-title-wrap { flex-basis: 80%; max-width: 80%; }
  .checklist-card-actions { justify-content:flex-start; }
}

/* Prevent inner grid columns or long content from forcing overflow */
.issue-checklists, .issue-checklists * { box-sizing: border-box; }
.checklist-card, .checklist-grid-surface, .checklist-section-card { max-width: 100%; overflow: hidden; }
.checklist-grid-surface { overflow-x: hidden; }

/* Ensure form inputs don't enforce a larger min-width than container */
.checklist-add-form--flat .checklist-add-section-select,
.checklist-add-form--flat .checklist-add-input { min-width: 0; }
.checklist-template-apply-form select { min-width: 0; }
