/* Project Timeline / Milestone Tracker (tool 7) */
.drawer .tool-form.tool-form-timeline,
.tool-form.tool-form-timeline {
  max-width: none;
  margin: 0;
  width: 100%;
}
.tool-form.tool-form-timeline .form-group[data-field="milestones"],
.tool-form .form-group[data-field="milestones"][data-type="timeline_items"],
.tool-form .form-group[data-field="milestones"] {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
  min-width: 0;
}
.tool-form.tool-form-timeline .form-group[data-field="critical_path_notes"] {
  grid-column: 1 / -1;
}

.ttl-board {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
  overflow: visible;
}
.ttl-timeline,
.ttl-open,
.ttl-history,
.ttl-lanes,
.ttl-table {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.ttl-section-title { margin: 0.25rem 0 0; font-size: 0.95rem; color: var(--text, #1b2a33); }
.ttl-timeline { background: var(--surface-2, #f4f7f9); border: 1px solid var(--line, #d5dee5); border-radius: 10px; padding: 0.85rem 1rem 1.15rem; }
.ttl-timeline-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.ttl-timeline-range { font-size: 0.8rem; color: var(--text-2, #4a5d68); }
.ttl-fallback-note { margin: 0.45rem 0 0; font-size: 0.8rem; color: #8a4b00; background: #fff4e0; border-radius: 6px; padding: 0.4rem 0.6rem; }
.ttl-timeline-hint { margin: 0.7rem 0 0; font-size: 0.75rem; }
.ttl-timeline-track { position: relative; height: 118px; margin: 1.1rem 8px 0.2rem; }
.ttl-timeline-bar { position: absolute; left: 0; right: 0; top: 28px; height: 6px; border-radius: 99px; background: linear-gradient(90deg, #1e4d6b, #3d7ea6); }
.ttl-tick { position: absolute; top: 0; width: 0; z-index: 1; }
.ttl-tick-line { position: absolute; left: 0; width: 1px; background: #7e93a0; }
.ttl-tick-today .ttl-tick-line, .ttl-tick-end .ttl-tick-line, .ttl-tick-close .ttl-tick-line { background: #1e4d6b; width: 2px; }
.ttl-tick-label {
  position: absolute; left: 0; box-sizing: border-box;
  font-size: 0.68rem; line-height: 1.2; color: var(--text-2, #4a5d68);
  text-align: center; white-space: normal; overflow: visible;
  overflow-wrap: break-word; word-break: break-word;
}
.ttl-label-left { text-align: left; }
.ttl-label-right { text-align: right; }
.ttl-label-center { text-align: center; }

.ttl-lanes { position: relative; margin: 0.15rem 8px 0.35rem; display: flex; flex-direction: column; gap: 4px; }
.ttl-lanes-empty { padding: 0.2rem 0 0; }
.ttl-lane { position: relative; height: 28px; }
.ttl-bar {
  position: absolute; top: 4px; height: 20px;
  box-sizing: border-box; border: 0; padding: 0 0.35rem;
  display: flex; align-items: center; justify-content: center; gap: 0.15rem;
  border-radius: 6px; color: #1b2a33; font-weight: 700; font-size: 0.72rem;
  background: #c5d5de; box-shadow: 0 1px 3px rgba(0,0,0,.12);
  cursor: default; min-width: 0; overflow: hidden;
}
.ttl-bar-neutral { background: #c5d5de; color: #1b2a33; }
.ttl-bar-red { background: #c0342b; color: #fff; }
.ttl-bar.is-marker { border-radius: 99px; min-width: 1.35rem; padding: 0 0.2rem; }
.ttl-bar-letter { line-height: 1; }
.ttl-bar-arrow { font-weight: 800; line-height: 1; }
.ttl-bar.is-clamped-left, .ttl-bar.is-clamped-right { overflow: visible; }

.ttl-letter { display: inline-flex; align-items: center; justify-content: center; min-width: 1.4rem; height: 1.4rem; border-radius: 99px; font-weight: 700; font-size: 0.75rem; color: #1b2a33; background: #c5d5de; }
.ttl-letter-red { background: #c0342b; color: #fff; }
.ttl-letter-neutral { background: #c5d5de; color: #1b2a33; }
.ttl-letter-empty { background: transparent; min-width: 0; }
.ttl-letter-cell { width: 2.4rem; text-align: center; vertical-align: middle; }

/* Tables fill the card; if the viewport is tight, scroll inside the table wrap. */
.ttl-open,
.ttl-history {
  display: block;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}
.ttl-table {
  width: 100%;
  min-width: 56rem;
  table-layout: fixed;
  border-collapse: collapse;
}
.ttl-table col.ttl-col-letter { width: 2.4rem; }
.ttl-table col.ttl-col-name { width: auto; }
.ttl-table col.ttl-col-date { width: 8.8rem; }
.ttl-table col.ttl-col-status { width: 7.2rem; }
.ttl-table col.ttl-col-phase { width: 13.5rem; }
.ttl-table col.ttl-col-crit { width: 3.2rem; }
.ttl-table col.ttl-col-actions { width: 2.2rem; }

.ttl-table th, .ttl-table td { vertical-align: top; min-width: 0; }
.ttl-table th.ttl-crit-head { text-align: center; font-size: 0.68rem; padding-left: 0.15rem; padding-right: 0.15rem; }
.ttl-table td.ttl-wrap-cell {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.ttl-table textarea {
  display: block; width: 100%; max-width: 100%; min-width: 0;
  field-sizing: content;
  height: auto;
  min-height: 36px;
  max-height: none !important;
  resize: none; overflow: hidden;
  white-space: pre-wrap; overflow-wrap: break-word; word-break: break-word;
  line-height: 1.35;
  box-sizing: border-box; padding: 0.35rem 0.45rem;
}
.ttl-board .struct-table input,
.ttl-table input[type="date"],
.ttl-table select {
  width: 100%; max-width: 100%; min-width: 0 !important; box-sizing: border-box; min-height: 36px;
}
.ttl-critical-cell { text-align: center; vertical-align: middle; }
.ttl-critical-flag {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; margin: 0 auto; cursor: pointer;
}
.ttl-critical-flag input {
  width: 1rem; height: 1rem; min-width: 1rem !important; min-height: 1rem; margin: 0; cursor: pointer;
  accent-color: #c0342b;
}
.ttl-empty { margin: 0.35rem 0 0; font-size: 0.8rem; }

.ttl-critical-flag .visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
