.gantt-sticky-controls {
  position: sticky;
  top: 0;
  z-index: 36;
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem 0.75rem;
  background: var(--tt-surface, #fff);
  border: 1px solid var(--tt-border, #e0e0de);
  border-radius: var(--tt-radius, 10px);
  box-shadow: var(--tt-shadow-sm, 0 1px 2px rgba(0, 0, 40, 0.08));
}

/* View + edit chrome — one aligned panel above the chart */
.gantt-edit-chrome {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.75rem;
  border: 1px solid var(--tt-border, #e0e0de);
  border-radius: var(--tt-radius, 10px);
  background: var(--tt-surface, #fff);
  box-shadow: var(--tt-shadow-sm, 0 1px 2px rgba(0, 0, 40, 0.08));
  overflow: hidden;
}

.gantt-edit-chrome .gantt-sticky-controls {
  position: relative;
  top: auto;
  z-index: 1;
  margin: 0;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--tt-border, #e8eaed);
  box-shadow: none;
}

.gantt-edit-chrome .edit-ribbon {
  position: relative;
  top: auto;
  z-index: 1;
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.gantt-edit-chrome .edit-ribbon-tabs {
  background: #f4f6f8;
}

/* Keep a constant ribbon height so switching between the Line and Box tab
   (or selecting/deselecting a box while resizing) does not shift the chart
   below up and down. Fits the two-row box toolbar. */
.gantt-edit-chrome .edit-ribbon-panels {
  min-height: 6.4rem;
  box-sizing: border-box;
  padding: 0.45rem 0.75rem 0.3rem;
}

/* —— Excel-style ribbon (edit mode) —— */
/* Groups as columns: controls on top, a subtle centered category label below,
   separated by thin inset vertical dividers like Excel's ribbon. */
.gantt-edit-chrome .ribbon-group {
  padding: 0 0.85rem;
  border-right: none;
  justify-content: space-between;
  position: relative;
}

.gantt-edit-chrome .ribbon-strip > .ribbon-group:not(:last-child)::after,
.gantt-edit-chrome .ribbon-strip-primary > .ribbon-group:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0.2rem;
  bottom: 1.15rem;
  width: 1px;
  background: var(--tt-border, #e6e8ec);
}

.gantt-edit-chrome .ribbon-group-label {
  font-size: 0.6rem;
  color: #8a8f98;
  padding-top: 0.32rem;
  margin-top: 0.1rem;
  border-top: 1px solid #f0f2f5;
  width: 100%;
}

/* Flat, borderless buttons that highlight on hover (Excel look). */
.gantt-edit-chrome .edit-ribbon .btn-outline-secondary {
  border-color: transparent;
  background: transparent;
  color: var(--tt-text, #000028);
}

.gantt-edit-chrome .edit-ribbon .btn-outline-secondary:hover,
.gantt-edit-chrome .edit-ribbon .btn-outline-secondary:focus-visible {
  background: #eef1f4;
  border-color: transparent;
  color: var(--tt-text, #000028);
}

.gantt-edit-chrome .edit-ribbon .btn-secondary {
  background: #e1f5f3;
  border-color: #00c1b6;
  color: #00706a;
}

.gantt-edit-chrome .edit-ribbon .btn-outline-danger {
  border-color: transparent;
  background: transparent;
}

.gantt-edit-chrome .edit-ribbon .btn-outline-danger:hover,
.gantt-edit-chrome .edit-ribbon .btn-outline-danger:focus-visible {
  background: #fdecec;
  border-color: transparent;
}

/* Cleaner input fields inside the ribbon (light, flat). */
.gantt-edit-chrome .edit-ribbon .form-control-sm,
.gantt-edit-chrome .edit-ribbon .form-select-sm {
  background: #f7f8fa;
  border-color: #e2e5ea;
}

.gantt-edit-chrome .edit-ribbon .form-control-sm:focus,
.gantt-edit-chrome .edit-ribbon .form-select-sm:focus {
  background: #fff;
  border-color: #00c1b6;
  box-shadow: 0 0 0 2px rgba(0, 193, 182, 0.15);
}

/* —— Plan tab: match the Excel-style ribbon groups —— */
.ribbon-strip-plan .gantt-snap-select {
  width: auto;
  min-width: 8.5rem;
}

.ribbon-strip-plan.ribbon-group-narrow .ribbon-group-body input,
.ribbon-strip-plan .ribbon-group-narrow .ribbon-group-body input {
  width: 5rem;
}

.ribbon-strip-plan .ribbon-group-plan-date {
  min-width: 13.5rem;
}

/* Summary stats span the remaining width, left-aligned and wrapping. */
.ribbon-strip-plan .ribbon-group-plan-stats {
  align-items: flex-start;
  min-width: 12rem;
}

.ribbon-strip-plan .ribbon-group-plan-stats .ribbon-group-body {
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.ribbon-strip-plan .ribbon-group-plan-stats .ribbon-group-label {
  text-align: left;
}

.gantt-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.25rem;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.gantt-controls-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.gantt-controls-field .form-control {
  width: 88px;
}

.gantt-controls-field-date .gantt-plan-start-input {
  width: auto;
  min-width: 13.5rem;
  max-width: 100%;
}

.gantt-controls-field-date .gantt-plan-start-input::-webkit-date-and-time-value {
  text-align: left;
}

.process-box-toolbar .toolbar-input-datetime {
  width: auto;
  min-width: 13.5rem;
  max-width: 100%;
}

.gantt-controls-field .form-label,
.toolbar-group label,
.gantt-line-toolbar-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--tt-text-muted, #66667e);
  margin: 0;
}

.gantt-controls-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  flex: 1;
  min-width: 200px;
}

.gantt-controls-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.gantt-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.gantt-tool-icon {
  display: block;
  flex-shrink: 0;
}

.gantt-tool-label {
  font-size: 0.72rem;
  font-weight: 600;
}

@media (max-width: 1200px) {
  .gantt-tool-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .gantt-tool-btn {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
  }
}

.gantt-stat {
  font-size: 0.8rem;
  color: var(--tt-text, #000028);
}

.gantt-stat-warn {
  color: var(--se-orange, #e37200);
  font-weight: 600;
}

.gantt-stat-start {
  color: #198754;
  font-weight: 600;
}

.gantt-stat-end {
  color: #0d6efd;
  font-weight: 600;
}

.gantt-stat-operators {
  color: var(--se-teal, #005159);
  font-weight: 600;
}

.gantt-stat-muted {
  color: var(--tt-text-muted, #64748b);
}

.gantt-wrapper {
  position: relative;
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--tt-border, #e2e8f0);
  border-radius: var(--tt-radius, 10px);
  background: var(--se-sand-200, #f5f5f5);
}

.timeline-container {
  position: relative;
  min-width: 1200px;
  --gantt-timeline-inset: 1.5rem;
  --gantt-chart-gutter: 9.5rem;
  padding-left: var(--gantt-timeline-inset);
  padding-right: var(--gantt-timeline-inset);
  box-sizing: content-box;
}

.gantt-timeline-aligned .gantt-chart-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 0.35rem;
}

.gantt-timeline-aligned .gantt-chart-gutter {
  flex: 0 0 var(--gantt-chart-gutter);
  min-width: 0;
  box-sizing: border-box;
}

.gantt-timeline-aligned .gantt-chart-track {
  flex: 0 0 auto;
  position: relative;
  min-width: 0;
}

.gantt-timeline-aligned .gantt-chart-gutter-axis {
  min-height: 32px;
}

.gantt-timeline-aligned .gantt-process-body {
  position: relative;
}

.gantt-timeline-aligned .gantt-process-body > .gantt-grid-layer {
  left: var(--gantt-chart-gutter);
  right: auto;
  width: auto;
}

.gantt-timeline-aligned .gantt-chart-gutter.line-toolbar {
  width: 100%;
  max-width: 100%;
}

.gantt-timeline-aligned .gantt-chart-gutter.line-toolbar .line-toolbar-label {
  flex: 1 1 auto;
  width: auto;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-timeline-aligned .line-toolbar {
  margin-left: 0;
  margin-bottom: 0;
  height: 100%;
  min-height: 2rem;
  align-items: center;
  padding: 0.15rem 0.35rem 0.15rem 0;
}

.gantt-timeline-aligned .gantt-process-line {
  margin-bottom: 0.1rem;
}

.gantt-timeline-aligned .time-markers {
  border-bottom: 1px solid var(--tt-border, #e0e0de);
}

.gantt-timeline-aligned .time-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  margin-top: 2px;
  width: 1px;
  height: 6px;
  transform: translateX(-50%);
  background: var(--tt-border, #c5c9d0);
}

.time-markers {
  position: relative;
  height: 32px;
  overflow: visible;
  background: transparent;
  z-index: 100;
  isolation: isolate;
}

.gantt-sticky-chart-header {
  position: sticky;
  top: 0;
  z-index: 100;
  isolation: isolate;
  background: transparent;
  box-shadow: none;
}

.gantt-chart-axis-shell {
  flex-shrink: 0;
  height: auto;
  min-height: 32px;
  z-index: 100;
  isolation: isolate;
  background: var(--tt-surface, #fff);
}

.gantt-chart-axis-shell .time-markers {
  position: relative;
  top: auto;
  z-index: 1;
}

.block-chart-header {
  flex-shrink: 0;
  width: 100%;
  background: transparent;
  border-bottom: none;
  z-index: 100;
  isolation: isolate;
  --gantt-timeline-inset: 1.5rem;
  padding-left: var(--gantt-timeline-inset);
  padding-right: var(--gantt-timeline-inset);
  box-sizing: border-box;
}

.block-chart-header .time-markers {
  width: 100%;
}

.operators-load-shell {
  position: relative;
  width: 100%;
  margin-top: 0.2rem;
  padding: 0.15rem 0.1rem 0.1rem;
  box-sizing: border-box;
}

.operators-grid-section {
  margin-top: 0;
  padding-top: 0.15rem;
  border-top: 1px solid var(--tt-border, #e0e0de);
}

.gantt-timeline-aligned .operators-grid-section {
  margin-bottom: 0;
}

.operators-grid-head-row {
  margin-bottom: 0.15rem !important;
}

.operators-grid-gutter-head {
  min-height: 32px;
  display: flex;
  align-items: flex-end;
  padding: 0 0.35rem 0.2rem 0;
}

.operators-grid-title {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tt-text-muted, #64748b);
  line-height: 1.1;
}

.operators-grid-head-track {
  min-height: 0;
  height: 0;
  overflow: hidden;
  border: none;
  background: transparent;
}

.operators-grid-line-block {
  margin-bottom: 0.1rem;
}

.operators-grid-total-block .operators-grid-total-label {
  border-left-color: #4a90c8;
  background: #d8ecff;
  color: #003366;
  font-weight: 700;
}

.operators-grid-grip-spacer.line-drag-handle {
  visibility: hidden;
  pointer-events: none;
}

.operators-grid-line-name.line-toolbar-label {
  flex: 1 1 auto;
  width: auto;
  max-width: 100%;
  min-width: 0;
  cursor: default;
  overflow: hidden;
  text-overflow: ellipsis;
}

.operators-grid-lane.timeline-line {
  margin-bottom: 0;
  display: block;
  overflow: hidden;
}

.operators-grid-total-lane {
  background: rgba(216, 236, 255, 0.45);
}

.operators-grid-grid-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.operators-grid-cells {
  position: absolute;
  top: 0;
  right: 2px;
  bottom: 0;
  left: 0;
  z-index: 1;
}

.operators-grid-cells-flex {
  display: flex;
  align-items: flex-start;
  flex-wrap: nowrap;
}

.operators-grid-cells-flex .operators-grid-cell {
  position: relative;
  flex-shrink: 0;
  margin: 0 2px 0 0;
}

.operators-grid-cell {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border-radius: 8px;
  border: 2px solid rgba(0, 0, 40, 0.08);
  background: transparent;
  min-height: 28px;
  min-width: 4px;
  margin: 0;
  flex-shrink: 0;
}

.operators-grid-line-block .operators-grid-cell-active {
  background: rgba(245, 200, 122, 0.28);
  border-color: #e8b35a;
  color: #4a3200;
}

.operators-grid-total-block .operators-grid-cell-active {
  background: rgba(126, 184, 232, 0.32);
  border-color: #5a9fd4;
  color: #002244;
}

.operators-grid-cell-value {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.operators-grid-section-block {
  padding-top: 0.15rem;
}

.operators-grid-block-head {
  margin-bottom: 0.15rem;
  padding: 0 0.1rem;
}

.operators-grid-section-block .operators-grid-lane.timeline-line-block {
  width: 100%;
}

.operators-grid-section-block .operators-grid-grid-layer.block-grid-layer {
  position: absolute;
  inset: 0;
}

.operators-grid-cell-value-total {
  font-size: 0.76rem;
}

.operators-load-label {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tt-text-muted, #64748b);
  line-height: 1.1;
  margin-bottom: 0.1rem;
}

.operators-load-chart {
  position: relative;
  height: 2rem;
  border-radius: 6px;
  background: rgba(0, 153, 153, 0.06);
  border: 1px solid rgba(0, 153, 153, 0.18);
  overflow: hidden;
}

.operators-load-bar {
  position: absolute;
  bottom: 0;
  min-width: 1px;
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(0, 153, 153, 0.72), rgba(0, 153, 153, 0.38));
  border-radius: 3px 3px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 1px;
  font-size: 0.55rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
}

.time-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 101;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0.12rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--tt-text, #000028);
  background: var(--tt-surface, #fff);
  border: 1px solid var(--tt-border, #e0e0de);
  border-radius: 6px;
  box-shadow: var(--tt-shadow-sm, 0 1px 2px rgba(0, 0, 40, 0.08));
  white-space: nowrap;
}

.time-marker.time-marker-edge-start {
  transform: translate(0, -50%);
}

.time-marker.time-marker-edge-start::after {
  left: 0;
  transform: none;
}

.time-marker.time-marker-edge-end {
  transform: translate(-100%, -50%);
}

.time-marker.time-marker-edge-end::after {
  left: 100%;
  transform: none;
}

.gantt-grid-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
}

.gantt-grid-layer .grid-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
}

.grid-line-hour {
  background-color: #aaa;
}

.grid-line-quarter {
  background-color: #e0e0e0;
}

.gantt-process-line {
  position: relative;
  margin-bottom: 0;
}

.gantt-process-line.line-drag-over {
  z-index: 3;
}

.line-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
  margin-left: calc(-1 * var(--gantt-line-grip-w, 1.35rem));
  padding-left: 0.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  position: relative;
  z-index: 2;
  background: transparent;
  min-height: 1.35rem;
  width: fit-content;
  max-width: 100%;
}

.line-drag-handle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  margin-left: 0;
  padding: 0.15rem 0;
  font-size: 0.62rem;
  line-height: 1;
  letter-spacing: -0.12em;
  color: var(--se-deep-600, #66667e);
  cursor: grab;
  border-radius: 4px;
  user-select: none;
  touch-action: none;
}

.line-drag-handle:hover {
  background: var(--tt-accent-soft, #e0f7f6);
  color: var(--se-petrol, #009999);
}

.line-drag-handle:active {
  cursor: grabbing;
}

.line-toolbar.line-dragging,
.gantt-process-line.line-dragging-source {
  opacity: 0.55;
}

.line-drop-insert-marker {
  display: block;
  height: 3px;
  margin: 2px 0 6px;
  border-radius: 2px;
  background: var(--se-petrol, #009999);
  box-shadow: 0 0 0 1px rgba(0, 153, 153, 0.25);
  pointer-events: none;
  z-index: 5;
}

.line-toolbar-label {
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: min(28rem, 100%);
  white-space: nowrap;
  cursor: pointer;
  padding: 0.3rem 0.7rem;
  background: var(--tt-surface, #fff);
  border: 1px solid var(--tt-border, #e0e0de);
  border-left: 3px solid var(--se-petrol, #009999);
  border-radius: 8px;
  box-shadow: var(--tt-shadow-sm, 0 1px 2px rgba(0, 0, 40, 0.08));
  color: var(--tt-text, #000028);
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.line-toolbar-selected .line-toolbar-label {
  color: var(--se-teal, #005159);
  background: var(--tt-accent-soft, #e0f7f6);
  border-color: var(--se-petrol, #009999);
  border-left-color: var(--se-purple, #641e8c);
  box-shadow: 0 2px 8px rgba(0, 153, 153, 0.15);
}

.line-toolbar-label:hover {
  background: var(--tt-accent-soft, #e0f7f6);
  color: var(--se-petrol, #009999);
  border-color: var(--se-petrol, #009999);
}

.line-toolbar-label:focus-visible {
  outline: 2px solid var(--se-focus, #199fff);
  outline-offset: 2px;
}

.timeline-line {
  display: flex;
  align-items: center;
  background: rgba(233, 236, 239, 0.72);
  border: 1px solid rgba(0, 0, 40, 0.06);
  min-height: 36px;
  border-radius: 10px;
  position: relative;
  margin-bottom: 10px;
  z-index: 1;
  overflow: visible;
}

.timeline-line.timeline-line-dates {
  display: block;
}

.timeline-line.timeline-line-lanes {
  display: block;
}

.timeline-line.timeline-line-dates .process-box.process-box-positioned,
.timeline-line.timeline-line-lanes .process-box.process-box-positioned {
  position: absolute;
  margin-right: 0;
}

.timeline-line.timeline-line-dates .process-box.process-box-positioned {
  top: 50%;
  transform: translateY(-50%);
}

.timeline-line.timeline-line-lanes .process-box.process-box-positioned {
  transform: none;
}

.process-box.process-box-full-lane {
  z-index: 1;
}

.process-box.process-box-lane-span {
  z-index: 1;
}

.timeline-line-lanes .process-box:not(.process-box-full-lane):not(.process-box-lane-span) {
  z-index: 2;
}

.timeline-line-block.timeline-line-lanes .process-box.process-box-positioned {
  position: absolute;
  transform: none;
}

.process-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  border-radius: 8px;
  border: 2px solid;
  cursor: grab;
  text-align: center;
  min-height: 28px;
  user-select: none;
  flex-shrink: 0;
  margin-right: 2px;
  overflow: hidden;
  z-index: 2;
}

.process-box .resize-live-time {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 8;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  background: rgba(0, 0, 40, 0.85);
  border-radius: 6px;
  pointer-events: none;
}

.process-box.resizing .resize-live-time {
  display: none !important;
}

.process-box.resizing .process-info {
  visibility: visible;
}

.process-box.bottleneck {
  outline: 3px solid var(--se-orange, #e37200);
  outline-offset: 1px;
}

.process-box.process-box-break {
  background: repeating-linear-gradient(
    -45deg,
    #e8eaed,
    #e8eaed 6px,
    #d5d9de 6px,
    #d5d9de 12px
  );
  color: #66667e;
  border-color: #b8bcc4;
  font-style: italic;
}

.process-box.process-box-break .progress-inner {
  display: none;
}

.process-box.process-box-break.bottleneck {
  outline: none;
}

.process-box-role-badge {
  position: absolute;
  top: 2px;
  z-index: 3;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.2;
  pointer-events: none;
}

.process-box-role-badge.process-box-role-start {
  left: 4px;
  background: rgba(25, 135, 84, 0.92);
  color: #fff;
}

.process-box-role-badge.process-box-role-end {
  right: 4px;
  background: rgba(13, 110, 253, 0.92);
  color: #fff;
}

.process-box-column-secondary:not(.process-box-break):not(.selected) {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  opacity: 0.92;
}

.process-box-column-secondary.selected {
  opacity: 1;
}

.process-box-role-badge.process-box-role-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  font-size: 0;
  line-height: 0;
  border-radius: 50%;
}

.process-box-role-badge.process-box-role-icon .process-box-role-svg {
  display: block;
}

.process-box-micro .process-box-role-badge.process-box-role-icon {
  width: 11px;
  height: 11px;
}

.process-box-sub-hour-badge {
  position: absolute;
  bottom: 3px;
  right: 4px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #334155;
  box-shadow: 0 0 0 1px rgba(0, 0, 40, 0.12);
  pointer-events: none;
}

.process-box-sub-hour-badge .process-box-sub-hour-svg {
  display: block;
}

.process-box-micro .process-box-sub-hour-badge {
  width: 11px;
  height: 11px;
  bottom: 2px;
  right: 2px;
}

.process-box.process-box-start:not(.process-box-break):not(.selected) {
  box-shadow: inset 4px 0 0 #198754;
}

.process-box.process-box-end:not(.process-box-break):not(.selected) {
  box-shadow: inset -4px 0 0 #0d6efd;
}

.process-box.selected {
  outline: 3px solid #fff;
  outline-offset: 1px;
  box-shadow: 0 0 0 2px var(--se-petrol, #009999), 0 2px 8px rgba(0, 0, 40, 0.2);
}

/* Legacy standalone toolbar (not inside edit ribbon) */
.process-box-toolbar:not(.box-edit-panel) {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.85rem;
  background: var(--tt-surface-elevated, #fff);
  border: 1px solid var(--tt-border, #e0e0de);
  border-left: 3px solid var(--se-petrol, #009999);
  border-radius: var(--tt-radius, 10px);
  box-shadow: var(--tt-shadow-sm, 0 1px 2px rgba(0, 0, 40, 0.08));
  position: sticky;
  top: 0;
  z-index: 20;
}

.toolbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--tt-text-muted, #66667e);
  align-self: center;
  padding-right: 0.5rem;
  border-right: 1px solid var(--tt-border, #e0e0de);
  margin-right: 0.25rem;
}

.toolbar-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.toolbar-input-task {
  min-width: 180px;
}

.toolbar-group-narrow input {
  width: 72px;
}

.toolbar-duration-hm {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.toolbar-duration-part {
  width: 52px;
}

.toolbar-duration-unit {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--tt-text-muted, #66667e);
  margin-right: 0.15rem;
}

.toolbar-font-size {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.font-size-stepper {
  display: inline-flex;
  align-items: stretch;
  height: var(--ribbon-control-h, 1.75rem);
  border: 1px solid var(--tt-border, #d5d9de);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.font-size-stepper-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--tt-text-muted, #5c6478);
  width: 1.5rem;
  min-width: 1.5rem;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.font-size-stepper-btn:hover {
  background: var(--tt-accent-soft, #e8f7f6);
  color: var(--se-petrol, #009999);
}

.font-size-stepper-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  padding: 0 0.15rem;
  font-size: 0.74rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--se-deep, #000028);
  border-left: 1px solid var(--tt-border, #e8eaed);
  border-right: 1px solid var(--tt-border, #e8eaed);
  background: #fafbfc;
}

.ribbon-group-font {
  padding: 0 0.45rem;
}

.toolbar-font-btn {
  padding: 0.1rem 0.35rem;
  font-weight: 700;
  line-height: 1.1;
  min-width: 32px;
}

.toolbar-font-select {
  width: 52px;
}

.toolbar-current-color {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.toolbar-color-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.toolbar-color-preview {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.45rem;
  background: #fff;
  border: 1px solid var(--tt-border, #e0e0de);
  border-radius: 6px;
  min-width: 88px;
}

.toolbar-color-preview-swatch {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.toolbar-color-preview-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--tt-text, #000028);
  text-transform: capitalize;
}

.toolbar-colors {
  display: flex;
  gap: 4px;
  align-items: center;
}

.toolbar-color-btn {
  width: 24px;
  height: 24px;
  border: 2px solid;
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 40, 0.2);
}

.toolbar-color-btn:hover {
  transform: scale(1.12);
}

.toolbar-color-btn.active {
  outline: 2px solid var(--se-deep, #000028);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0, 0, 40, 0.25);
}

.toolbar-color-btn:focus-visible {
  outline: 2px solid var(--se-focus, #199fff);
  outline-offset: 2px;
}

.toolbar-color-auto {
  background: #fff;
  color: var(--se-deep, #000028);
  font-size: 0.62rem;
  font-weight: 700;
  border-color: #c8ccd0;
  line-height: 1;
}

.toolbar-color-auto.active {
  outline: 2px solid var(--se-deep, #000028);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0, 0, 40, 0.25);
}

.ribbon-group-colors {
  min-width: 6rem;
}

.toolbar-milestones {
  flex: 1 1 100%;
  min-width: min(100%, 22rem);
  max-width: 100%;
}

.toolbar-milestones-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.toolbar-milestones-empty {
  margin: 0;
  font-size: 0.78rem;
  color: var(--tt-text-muted, #5c6578);
}

.toolbar-milestone-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.toolbar-milestone-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.35rem;
  border-radius: 6px;
  border: 1px solid transparent;
}

.toolbar-milestone-row-selected {
  background: var(--tt-accent-soft, #e0f7f6);
  border-color: rgba(0, 153, 153, 0.25);
}

.toolbar-milestone-offset {
  flex-shrink: 0;
}

.toolbar-milestone-text {
  flex: 1;
  min-width: 6rem;
}

.toolbar-milestone-remove {
  min-width: 1.75rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.toolbar-actions {
  display: flex;
  gap: 0.35rem;
  align-items: flex-end;
  margin-left: auto;
}

.process-info {
  font-size: 0.75rem;
  line-height: 1rem;
  z-index: 2;
  padding: 0 4px;
  width: 100%;
  min-width: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.process-box-task {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  min-width: 0;
}

.process-box-hours {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  min-width: 0;
}

.process-box-compact .process-info {
  padding: 0 2px;
  line-height: 1.05;
}

.process-box-compact .process-box-hours {
  display: none;
}

.process-box-micro .process-info {
  visibility: hidden;
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.process-box-callout {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 5px);
  transform: translateX(-50%);
  z-index: 20;
  max-width: 14rem;
  width: max-content;
  padding: 0.22rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  color: var(--se-deep, #000028);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(0, 0, 40, 0.14);
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 40, 0.16);
  pointer-events: none;
  align-items: center;
  gap: 0.3rem;
}

.process-box-callout-task {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9rem;
}

.process-box-callout-hours {
  font-weight: 600;
  opacity: 0.82;
  flex-shrink: 0;
}

.process-box-callout-sep {
  opacity: 0.55;
  flex-shrink: 0;
}

.process-box-compact.selected .process-box-callout,
.process-box-micro.selected .process-box-callout {
  display: flex;
}

@media (hover: hover) and (pointer: fine) {
  .process-box-compact:hover .process-box-callout,
  .process-box-micro:hover .process-box-callout {
    display: flex;
  }
}

.process-box.resizing .process-box-callout {
  display: none !important;
}

.resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  width: 12px;
  height: 100%;
  cursor: ew-resize;
  background: rgba(255, 255, 255, 0.3);
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  z-index: 4;
}

.resize-handle::after {
  content: "↔";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1;
  color: rgba(0, 0, 40, 0.82);
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.95);
  opacity: 0;
  transition: opacity 0.12s ease;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .process-box:hover .resize-handle,
  .resize-handle:hover {
    background: rgba(255, 255, 255, 0.72);
  }

  .process-box:hover .resize-handle::after,
  .resize-handle:hover::after {
    opacity: 1;
  }
}

.process-box.resizing {
  z-index: 6;
}

.process-box.resizing .resize-handle {
  background: rgba(255, 255, 255, 0.78);
}

.process-box.resizing .resize-handle::after {
  opacity: 1;
}

.process-box-hours-live {
  font-weight: 800;
  opacity: 1 !important;
  letter-spacing: 0.02em;
}

.resize-live-precise {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.resize-live-friendly {
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0.9;
}

.resize-cursor-tooltip {
  display: none;
  position: fixed;
  z-index: 10000;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: var(--se-deep, #000028);
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.4);
}

body.takt-resizing-active {
  cursor: ew-resize !important;
  user-select: none;
}

body.takt-resizing-active * {
  cursor: ew-resize !important;
}

.progress-inner {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.4);
  z-index: 0;
  border-radius: 6px 0 0 6px;
}

.gantt-wrapper:not(.gantt-print-mode) .progress-inner {
  display: none;
}

.milestone-pin {
  position: absolute;
  top: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 0;
  z-index: 4;
  pointer-events: auto;
  transform: translateX(-50%);
  cursor: grab;
  touch-action: none;
  color: var(--se-orange, #e37200);
}

.milestone-marker-svg {
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 1px 2px rgba(0, 0, 40, 0.25));
}

.milestone-pin-icon {
  transition: transform 0.12s ease;
}

.milestone-pin:hover .milestone-pin-icon,
.milestone-pin-selected .milestone-pin-icon {
  transform: scale(1.08);
}

.milestone-pin:hover {
  color: #c45f00;
}

.milestone-pin-selected {
  color: var(--se-petrol, #009999);
  z-index: 4;
}

.milestone-pin.milestone-dragging {
  cursor: grabbing;
  z-index: 5;
}

.milestone-pin.milestone-dragging .milestone-pin-icon {
  transform: scale(1.12);
}

body.takt-milestone-dragging {
  cursor: grabbing !important;
  user-select: none;
}

body.takt-milestone-dragging * {
  cursor: grabbing !important;
}

.milestone-pin-label {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.05rem 0.3rem;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--se-deep, #000028);
  white-space: nowrap;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 40, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
}

.milestone-pin:hover .milestone-pin-label,
.milestone-pin-selected .milestone-pin-label,
.milestone-pin.milestone-dragging .milestone-pin-label {
  opacity: 1;
  visibility: visible;
}

.add-ms-btn {
  position: absolute;
  bottom: 2px;
  right: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  line-height: 0;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  cursor: pointer;
  color: var(--se-orange, #e37200);
  border: 1px solid rgba(227, 114, 0, 0.35);
  box-shadow: 0 1px 2px rgba(0, 0, 40, 0.1);
}

.add-ms-btn .milestone-marker-svg {
  filter: none;
}

.add-ms-btn:hover {
  background: #fff7ed;
  border-color: var(--se-orange, #e37200);
  color: #c45f00;
}

/* Process line toolbar (above gantt, shared for selected line) */
.gantt-line-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
  background: var(--tt-surface-elevated, #fff);
  border: 1px solid var(--tt-border, #e0e0de);
  border-left: 3px solid var(--se-purple, #641e8c);
  border-radius: var(--tt-radius, 10px);
  box-shadow: var(--tt-shadow-sm, 0 1px 2px rgba(0, 0, 40, 0.08));
}

.gantt-line-toolbar-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--se-purple, #641e8c);
  align-self: center;
  white-space: nowrap;
}

.gantt-line-toolbar-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.gantt-line-toolbar-name {
  min-width: 10rem;
  max-width: 16rem;
  font-weight: 500;
}

.gantt-line-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-left: auto;
  align-items: center;
}

.line-toolbar-sizes {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
}

.line-size-btn {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  font-weight: 600;
}

/* Process box library (palette) */
.gantt-layout {
  --gantt-line-label-w: 7.75rem;
  --gantt-palette-width: 15.5rem;
  --gantt-sticky-palette-top: calc(var(--tt-header-h, 56px) + 0.35rem);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.plan-workspace-control .gantt-layout {
  --gantt-sticky-palette-top: var(--gantt-sticky-stack-top, calc(var(--tt-header-h, 56px) + var(--plan-toolbar-sticky-h, 4.5rem) + var(--gantt-chrome-sticky-h, 5rem) + 0.35rem));
}

.plan-workspace-control .timeline-container > .gantt-chart-axis-shell {
  position: relative;
  top: auto;
  z-index: 85;
  background: var(--tt-surface, #fff);
}

.plan-workspace-control .timeline-container-vertical .block-chart-header.gantt-sticky-chart-header {
  top: 0;
  z-index: 85;
  background: var(--tt-surface, #fff);
  box-shadow: 0 1px 0 var(--tt-border, #e0e0de);
}

/* Side columns — sticky library / properties beside the chart */
.gantt-layout > #paletteHost {
  position: sticky;
  top: var(--gantt-sticky-palette-top);
  align-self: flex-start;
  z-index: 84;
  flex: 0 0 var(--gantt-palette-width);
  width: var(--gantt-palette-width);
  max-width: var(--gantt-palette-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: calc(100vh - var(--gantt-sticky-palette-top) - 0.75rem);
  max-height: calc(100vh - var(--gantt-sticky-palette-top) - 0.75rem);
  order: 2;
}

.gantt-layout > #propertiesHost {
  align-self: flex-start;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  order: 2;
}

.gantt-layout-library-right > .gantt-main {
  order: 1;
}

.gantt-layout-library-right > .gantt-library-show-tab,
.gantt-layout-library-right > .gantt-side-tab-right {
  order: 3;
}

.gantt-layout > #paletteHost > .process-box-palette {
  position: relative;
  top: auto;
  align-self: stretch;
  width: 100%;
  flex: 1 1 auto;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.gantt-layout > #propertiesHost > .process-properties-panel {
  position: sticky;
  top: var(--gantt-sticky-palette-top);
  align-self: flex-start;
  width: 100%;
  max-height: calc(100vh - var(--gantt-sticky-palette-top) - 0.75rem);
  overflow-y: auto;
}

.gantt-layout-library-hidden {
  gap: 0.35rem;
}

.gantt-library-show-tab {
  position: sticky;
  top: var(--gantt-sticky-palette-top);
  align-self: flex-start;
  z-index: 40;
  flex: 0 0 auto;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  padding: 0.65rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--se-teal, #005159);
  background: var(--tt-surface-elevated, #fff);
  border: 1px solid var(--tt-border, #e0e0de);
  border-radius: var(--tt-radius, 10px);
  cursor: pointer;
  box-shadow: var(--tt-shadow-sm, 0 1px 2px rgba(0, 0, 40, 0.08));
  align-self: stretch;
  min-height: 6rem;
}

.gantt-library-show-tab:hover {
  background: var(--tt-accent-soft, #e0f7f6);
  border-color: var(--se-petrol, #009999);
  color: var(--se-petrol, #009999);
}

.gantt-main {
  flex: 1;
  min-width: 0;
}

.process-box-palette {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  background: var(--tt-bg, #f8fafc);
  border: 1px solid var(--tt-border, #e2e8f0);
  border-radius: var(--tt-radius, 10px);
  padding: 0.75rem;
  box-shadow: var(--tt-shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.06));
  z-index: 40;
}

.palette-header,
.palette-tabs,
.palette-tab-panel,
.palette-collection-label,
.palette-collection-select,
.palette-hint,
.palette-preview-compact,
.palette-items-header {
  flex-shrink: 0;
}

.palette-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.palette-title {
  font-size: 0.9rem;
  font-weight: 700;
}

.palette-hide-btn {
  font-size: 0.68rem;
  padding: 0.1rem 0.4rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.palette-tabs {
  display: flex;
  gap: 0;
  margin: 0 -0.85rem 0.65rem;
  padding: 0 0.5rem;
  border-bottom: 1px solid var(--tt-border, #e0e0de);
  flex-shrink: 0;
}

.palette-tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.45rem 0.75rem;
  margin-bottom: -1px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--tt-text-muted, #64748b);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  flex: 1 1 0;
  text-align: center;
}

.palette-tab:hover {
  color: var(--tt-text, #000028);
  background: rgba(255, 255, 255, 0.55);
}

.palette-tab.active {
  color: var(--se-petrol, #009999);
  background: var(--tt-surface-elevated, #fff);
  border-bottom-color: var(--se-petrol, #009999);
}

.palette-tab-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.palette-collection-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--tt-text-muted, #64748b);
  margin-bottom: 0.25rem;
}

.palette-collection-select {
  margin-bottom: 0.5rem;
}

.palette-hint {
  margin-bottom: 0.65rem;
}

.palette-preview-compact {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.55rem;
  background: #fff;
  border: 1px solid var(--tt-border, #e0e0de);
  border-radius: 10px;
}

.palette-preview-compact-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tt-text-muted, #66667e);
  margin-bottom: 0.35rem;
}

.palette-item-row {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
}

.palette-item-row-selected .palette-item {
  outline: 2px solid var(--se-deep, #000028);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(0, 0, 40, 0.2);
}

.palette-item-row .palette-item,
.palette-item-row .palette-group-item {
  flex: 1;
  min-width: 0;
  cursor: grab;
}

.palette-item-edit-btn {
  flex: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--tt-border, #e0e0de);
  border-radius: 8px;
  background: #fff;
  color: var(--se-teal, #005159);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.palette-item-edit-btn:hover {
  background: var(--tt-accent-soft, #e0f7f6);
  border-color: var(--se-petrol, #009999);
  color: var(--se-petrol, #009999);
}

.palette-icon-pencil {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.palette-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 40, 0.45);
  backdrop-filter: blur(2px);
}

body.takt-palette-modal-open {
  overflow: hidden;
}

.takt-plan-root.takt-palette-modal-open .gantt-edit-chrome,
.takt-plan-root.takt-palette-modal-open .gantt-main,
.takt-plan-root.takt-palette-modal-open .gantt-sticky-chart-header,
.takt-plan-root.takt-palette-modal-open .block-chart-header {
  pointer-events: none;
}

.takt-plan-root.takt-palette-modal-open #paletteHost {
  pointer-events: auto;
}

.palette-modal-dialog {
  width: 100%;
  max-width: 400px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 40, 0.22);
  border: 1px solid var(--tt-border, #e0e0de);
}

.palette-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--tt-border, #e0e0de);
  background: linear-gradient(180deg, rgba(0, 153, 153, 0.08) 0%, #fff 100%);
}

.palette-modal-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--se-teal, #005159);
}

.palette-modal-body {
  padding: 1rem;
}

.palette-modal-preview-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tt-text-muted, #66667e);
  margin-bottom: 0.35rem;
}

.palette-modal-preview-track {
  margin-bottom: 1rem;
}

.palette-modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--tt-border, #e0e0de);
  background: var(--se-sand-200, #f5f5f5);
  border-radius: 0 0 14px 14px;
}

.palette-modal-footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.palette-modal-footer .btn-primary {
  background: var(--se-petrol, #009999);
  border-color: var(--se-petrol, #009999);
}

.palette-step-preview-track {
  min-height: 56px;
  padding: 0.5rem 0.65rem;
  background: var(--se-deep-50, #ebebee);
  border-radius: 10px;
  display: flex;
  align-items: center;
  overflow-x: auto;
  border: 1px dashed rgba(0, 0, 40, 0.12);
}

.palette-step-preview-box {
  height: 48px !important;
  min-height: 48px;
  flex-shrink: 0;
  cursor: default;
  margin: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 40, 0.15);
  transition: width 0.2s ease, background-color 0.15s ease;
}

.palette-step-preview-name {
  font-weight: 700;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-step-field {
  margin-bottom: 0.5rem;
}

.palette-step-field:last-child {
  margin-bottom: 0;
}

.palette-step-field label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--tt-text-muted, #64748b);
  margin-bottom: 0.15rem;
}

.palette-step-form-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.palette-step-field-narrow {
  flex: 0 0 72px;
}

.palette-step-field-font {
  flex: 0 0 auto;
}

.palette-step-field-font .font-size-stepper {
  height: 31px;
}

.palette-step-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.palette-step-color-btn {
  width: 26px;
  height: 26px;
  border: 2px solid #fff;
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 40, 0.2);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.palette-step-color-btn:hover {
  transform: scale(1.1);
}

.palette-step-color-btn.active {
  outline: 2px solid var(--se-deep, #000028);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(0, 0, 40, 0.25);
}

.palette-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
  min-width: 0;
}

.palette-items-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--tt-text-muted, #64748b);
  min-width: 0;
}

.palette-add-btn {
  flex-shrink: 0;
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}

.palette-items {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.15rem;
  margin-right: -0.15rem;
}

.palette-item {
  width: 100%;
  height: 44px !important;
  min-height: 44px;
  max-width: 100%;
  cursor: pointer;
  font-size: 0.7rem;
  padding: 4px 6px;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: box-shadow 0.15s, transform 0.15s;
}

.palette-item:active {
  cursor: grabbing;
}

.palette-item.palette-item-selected {
  outline: 2px solid var(--se-deep, #000028);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(0, 0, 0, 0.2);
  transform: scale(1.02);
}

.palette-item.palette-dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.palette-item-label {
  font-weight: bold;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.palette-item-meta {
  font-size: 0.65rem;
  opacity: 0.9;
}

.palette-break-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.15rem;
  font-weight: 600;
  cursor: pointer;
}

.palette-break-hint {
  margin-left: 1.35rem;
}

.palette-groups {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.15rem;
  margin-right: -0.15rem;
}

.palette-group-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 3.25rem;
  width: 100%;
  padding: 0.35rem 0.45rem;
  border: 2px dashed #b8bcc4;
  border-radius: 8px;
  background: #f4f5f7;
  cursor: grab;
  user-select: none;
}

.palette-group-item.palette-dragging {
  opacity: 0.72;
}

.palette-group-segments {
  display: flex;
  gap: 2px;
  height: 0.55rem;
  width: 100%;
  border-radius: 4px;
  overflow: hidden;
}

.palette-group-segment {
  flex: 1 1 0;
  min-width: 4px;
  border-radius: 2px;
}

.palette-group-segment-break {
  background: repeating-linear-gradient(-45deg, #e8eaed, #e8eaed 3px, #d5d9de 3px, #d5d9de 6px);
}

.palette-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--se-deep, #000028);
}

.palette-group-meta {
  font-size: 0.62rem;
  color: #66667e;
}

.palette-group-step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.palette-group-step-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.palette-group-step-row .form-select {
  flex: 1 1 auto;
  min-width: 0;
}

.palette-group-edit-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.palette-group-line-map {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--tt-border, #e0e0de);
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fbfc 0%, #fff 100%);
}

.palette-group-line-map-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.palette-group-line-map-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--se-deep, #000028);
}

.palette-group-line-map-meta {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--tt-text-muted, #66667e);
}

.palette-group-line-map-hint {
  line-height: 1.4;
}

.palette-group-line-map-rows {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.palette-group-line-map-row {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  min-height: 2rem;
}

.palette-group-line-map-gutter {
  flex: 0 0 6.5rem;
  max-width: 6.5rem;
  display: flex;
  align-items: center;
  padding: 0.2rem 0.35rem 0.2rem 0;
  border-left: 3px solid var(--line-map-color, #009999);
}

.palette-group-line-map-label {
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--line-map-color, #009999);
}

.palette-group-line-map-track {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.15rem 0;
}

.palette-group-line-map-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 40, 0.12);
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.2;
}

.palette-group-line-map-chip-break {
  background: repeating-linear-gradient(-45deg, #e8eaed, #e8eaed 3px, #d5d9de 3px, #d5d9de 6px);
  color: #333353;
}

.palette-group-line-map-chip-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  font-size: 0.58rem;
  font-weight: 800;
}

.palette-group-line-map-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-group-preview-bar {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--tt-border, #e0e0de);
  border-radius: 10px;
  background: #fff;
}

.palette-group-preview-bar .palette-group-segments {
  height: 0.65rem;
}

.palette-group-preview-meta {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--tt-text-muted, #66667e);
}

.palette-group-steps-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.palette-group-steps-intro {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.palette-group-steps-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--se-deep, #000028);
}

.palette-group-steps-hint {
  line-height: 1.45;
}

.palette-group-step-card {
  border: 1px solid var(--tt-border, #e0e0de);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  border-left: 4px solid var(--step-line-color, #009999);
}

.palette-group-step-line-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--step-line-color, #009999) 14%, #fff);
  border: 1px solid color-mix(in srgb, var(--step-line-color, #009999) 35%, #fff);
  color: var(--step-line-color, #009999);
  font-size: 0.64rem;
  font-weight: 700;
  white-space: nowrap;
}

.palette-group-step-field-line {
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--step-line-color, #009999) 6%, #fff);
  border: 1px solid color-mix(in srgb, var(--step-line-color, #009999) 22%, #e0e0de);
}

.palette-group-step-line-select {
  font-weight: 600;
}

.palette-group-step-line-summary {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--step-line-color, #009999);
}

.palette-group-step-placement-grid-zones {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 640px) {
  .palette-group-step-placement-grid-zones {
    grid-template-columns: 1fr;
  }

  .palette-group-line-map-gutter {
    flex-basis: 5.25rem;
    max-width: 5.25rem;
  }
}

.palette-group-step-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  background: linear-gradient(180deg, rgba(0, 153, 153, 0.07) 0%, #fff 100%);
  border-bottom: 1px solid var(--tt-border, #e0e0de);
}

.palette-group-step-card-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.palette-group-step-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--se-teal, #005159);
}

.palette-group-step-hours {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--tt-accent-soft, #e0f7f6);
  color: var(--se-teal, #005159);
}

.palette-group-step-card-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.palette-group-step-action {
  min-width: 1.75rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.palette-group-step-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.65rem;
}

.palette-group-step-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.palette-group-step-field label,
.palette-group-step-placement legend {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--tt-text-muted, #66667e);
  margin: 0;
}

.palette-group-step-field-hint {
  font-size: 0.64rem;
  line-height: 1.35;
  color: var(--tt-text-muted, #88889a);
}

.palette-group-step-placement {
  margin: 0;
  padding: 0.55rem 0.6rem 0.6rem;
  border: 1px dashed var(--tt-border, #d5d9de);
  border-radius: 8px;
  background: #fafbfc;
}

.palette-group-step-placement legend {
  float: left;
  width: 100%;
  padding: 0 0 0.35rem;
}

.palette-group-step-placement-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  width: 100%;
  clear: both;
}

.palette-group-step-line,
.palette-group-step-lane,
.palette-group-step-lane-span,
.palette-group-step-template {
  width: 100%;
  min-width: 0;
  flex: none;
  max-width: none;
}

.palette-group-add-step {
  align-self: flex-start;
}

@media (max-width: 640px) {
  .palette-group-step-placement-grid {
    grid-template-columns: 1fr;
  }
}

.palette-group-lines-badge {
  font-weight: 600;
  color: var(--se-petrol, #009999);
}

.palette-group-step-index {
  font-size: 0.75rem;
  font-weight: 700;
  color: #66667e;
  width: 1.25rem;
  flex-shrink: 0;
}

.palette-group-modal-dialog {
  width: min(44rem, calc(100vw - 1.5rem));
  max-width: min(44rem, calc(100vw - 1.5rem));
}

.timeline-line.drag-over {
  outline: 2px dashed var(--se-petrol, #009999);
  outline-offset: 2px;
  background: rgba(0, 153, 153, 0.12) !important;
}

/* Drop preview — shows where box will be inserted */
.drop-insert-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--se-petrol, #009999);
  border-radius: 2px;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 0 6px rgba(0, 153, 153, 0.55);
}

.drop-preview-box {
  position: absolute;
  top: 2px;
  height: 46px;
  border: 2px dashed var(--se-petrol, #009999);
  background: rgba(0, 153, 153, 0.2);
  border-radius: 8px;
  z-index: 9;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--se-teal, #005159);
  font-size: 0.7rem;
  font-weight: bold;
  text-align: center;
  padding: 2px 4px;
  box-sizing: border-box;
  overflow: hidden;
}

.drop-insert-marker-lane {
  bottom: auto;
}

.drop-preview-box-lane {
  min-height: 20px;
}

.drop-preview-label {
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-preview-hours {
  font-size: 0.65rem;
  opacity: 0.85;
}

.process-box.dragging-source {
  opacity: 0.35;
}

/* —— Vertical 24h block view —— */
.gantt-view-toggle .btn {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
}

.gantt-view-toggle .btn-secondary {
  background: var(--se-petrol, #009999);
  border-color: var(--se-petrol, #009999);
  color: #fff;
}

.gantt-view-toggle .btn-outline-secondary:hover {
  background: var(--tt-accent-soft, #e0f7f6);
  border-color: var(--se-petrol, #009999);
  color: var(--se-teal, #005159);
}

.gantt-layout-readonly .gantt-main {
  width: 100%;
}

.gantt-print-actions .btn {
  white-space: nowrap;
}

.gantt-layout-blocks {
  align-items: stretch;
  min-height: calc(100vh - var(--tt-header-h, 56px) - 11rem);
}

.gantt-layout-readonly.gantt-layout-blocks {
  min-height: 0;
}

.gantt-layout-blocks .gantt-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
}

.gantt-wrapper.gantt-view-vertical {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-height: none;
  overflow: hidden;
}

.timeline-container-vertical {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  padding: 0.25rem 0.5rem 0.75rem;
  overflow-y: auto;
}

.vertical-blocks-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.vertical-day-section {
  width: 100%;
  background: var(--tt-surface, #fff);
  border: 1px solid var(--tt-border, #e2e8f0);
  border-radius: var(--tt-radius-lg, 14px);
  overflow: visible;
  box-shadow: var(--tt-shadow-sm, 0 1px 2px rgba(0, 0, 40, 0.08));
}

.vertical-day-section-header {
  position: relative;
  z-index: 1;
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--se-teal, #005159);
  background: linear-gradient(180deg, var(--tt-accent-soft, #e0f7f6) 0%, var(--tt-surface, #fff) 100%);
  border-bottom: 2px solid var(--se-petrol, #009999);
  box-shadow: 0 2px 8px rgba(0, 0, 40, 0.06);
}

.block-timeline-container {
  position: relative;
  width: 100%;
  overflow-x: auto;
  --gantt-timeline-inset: 1.5rem;
  padding-left: var(--gantt-timeline-inset);
  padding-right: var(--gantt-timeline-inset);
  box-sizing: border-box;
}

.timeline-container-vertical .block-chart-header.gantt-sticky-chart-header {
  top: 0;
  z-index: 100;
}

.block-time-markers {
  border-radius: 0;
}

.block-process-body .block-grid-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
}

.block-process-body {
  position: relative;
  width: 100%;
  padding-top: 0.15rem;
  --gantt-line-grip-w: 1.35rem;
}

.gantt-process-body {
  position: relative;
  padding-top: 0.15rem;
  --gantt-line-grip-w: 1.35rem;
  z-index: 0;
}

.line-toolbar-in-block {
  position: relative;
  z-index: 2;
  margin-bottom: 0.15rem;
  background: transparent;
}

.timeline-line-block {
  display: flex;
  align-items: center;
  width: 100%;
  background: rgba(233, 236, 239, 0.72);
  border: 1px solid rgba(0, 0, 40, 0.06);
  border-radius: 10px;
  position: relative;
  margin-bottom: 10px;
  z-index: 1;
  overflow: visible;
}

.process-box-in-block {
  position: absolute;
  top: 2px;
  margin-right: 0;
  flex-shrink: 0;
}

.process-box-in-block.segment-continues-right {
  border-top-right-radius: 2px;
  border-bottom-right-radius: 2px;
  box-shadow: inset -3px 0 0 rgba(255, 255, 255, 0.65);
}

.process-box-in-block.segment-continues-left {
  border-top-left-radius: 2px;
  border-bottom-left-radius: 2px;
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.65);
}

.process-box-in-block.takt-resize-ghost {
  opacity: 0.9;
  pointer-events: none;
}

/* —— Properties side panel (line + box edit) —— */
.gantt-layout-properties-hidden {
  gap: 0.35rem;
}

.gantt-properties-show-tab {
  position: sticky;
  top: var(--gantt-sticky-palette-top);
  align-self: flex-start;
  z-index: 40;
  flex: 0 0 auto;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding: 0.65rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--se-purple, #641e8c);
  background: var(--tt-surface-elevated, #fff);
  border: 1px solid var(--tt-border, #e0e0de);
  border-radius: var(--tt-radius, 10px);
  cursor: pointer;
  box-shadow: var(--tt-shadow-sm, 0 1px 2px rgba(0, 0, 40, 0.08));
  align-self: stretch;
  min-height: 6rem;
}

.gantt-properties-show-tab:hover {
  background: #f3e8ff;
  border-color: var(--se-purple, #641e8c);
  color: var(--se-purple, #641e8c);
}

.process-properties-panel {
  flex: 0 0 300px;
  width: 300px;
  background: var(--tt-bg, #f8fafc);
  border: 1px solid var(--tt-border, #e2e8f0);
  border-radius: var(--tt-radius, 10px);
  padding: 0.85rem;
  box-shadow: var(--tt-shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.06));
  z-index: 40;
}

.properties-hint {
  margin: 0 0 0.65rem;
  line-height: 1.35;
}

.properties-panel-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.properties-empty {
  margin: 0;
  padding: 1rem 0.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--tt-text-muted, #64748b);
  line-height: 1.45;
}

.properties-section {
  padding: 0.75rem;
  background: var(--tt-surface-elevated, #fff);
  border: 1px solid var(--tt-border, #e0e0de);
  border-radius: var(--tt-radius, 10px);
  box-shadow: var(--tt-shadow-sm, 0 1px 2px rgba(0, 0, 40, 0.06));
}

.properties-section-line {
  border-left: 3px solid var(--se-purple, #641e8c);
}

.properties-section-box {
  border-left: 3px solid var(--se-petrol, #009999);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem;
  margin: 0;
  position: static;
  top: auto;
  flex-wrap: nowrap;
  align-items: stretch;
}

.properties-section-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.15rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--tt-text, #000028);
}

.properties-section-line .properties-section-title {
  color: var(--se-purple, #641e8c);
}

.properties-color-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.properties-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.properties-field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.properties-field-narrow {
  flex: 1 1 5rem;
  min-width: 4.5rem;
}

.properties-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--tt-text-muted, #64748b);
}

.properties-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.properties-colors {
  flex-wrap: wrap;
}

.properties-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.properties-actions-row {
  flex-direction: row;
  flex-wrap: wrap;
}

.properties-field-milestones .toolbar-milestones-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.properties-field-milestones .toolbar-milestone-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.properties-field-milestones .toolbar-milestone-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.properties-field-milestones .toolbar-milestone-text {
  flex: 1 1 6rem;
  min-width: 5rem;
}

#editRibbonHost {
  margin-bottom: 0;
}

.edit-ribbon {
  position: sticky;
  top: calc(var(--tt-header-h, 56px) + var(--plan-toolbar-sticky-h, 4.5rem) + 0.35rem);
  z-index: 86;
  background: var(--tt-surface-elevated, #fff);
  border: 1px solid var(--tt-border, #e0e0de);
  border-radius: var(--tt-radius, 10px);
  box-shadow: var(--tt-shadow-sm, 0 1px 2px rgba(0, 0, 40, 0.08));
  overflow: visible;
  margin-bottom: 0.75rem;
}

.edit-ribbon-empty {
  padding: 0.65rem 1rem;
}

.ribbon-empty-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--tt-text-muted, #64748b);
}

.edit-ribbon-tabs {
  display: flex;
  gap: 0;
  padding: 0 0.5rem;
  background: linear-gradient(180deg, #f4f6f8 0%, #eceff3 100%);
  border-bottom: 1px solid var(--tt-border, #e0e0de);
}

.edit-ribbon-tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.45rem 0.85rem;
  margin-bottom: -1px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--tt-text-muted, #64748b);
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.edit-ribbon-tab:hover:not(:disabled) {
  color: var(--tt-text, #000028);
  background: rgba(255, 255, 255, 0.55);
}

.edit-ribbon-tab.active {
  color: var(--se-petrol, #009999);
  background: var(--tt-surface-elevated, #fff);
  border-bottom-color: var(--se-petrol, #009999);
}

.edit-ribbon-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.edit-ribbon-panels {
  padding: 0.55rem 0.85rem 0.65rem;
  overflow-x: auto;
}

.edit-ribbon {
  --ribbon-control-h: 1.75rem;
}

.edit-ribbon .form-control-sm,
.edit-ribbon .form-select-sm {
  height: var(--ribbon-control-h);
  min-height: var(--ribbon-control-h);
  font-size: 0.78rem;
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
}

.edit-ribbon .btn-sm {
  height: var(--ribbon-control-h);
  min-height: var(--ribbon-control-h);
  padding: 0 0.55rem;
  font-size: 0.74rem;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.edit-ribbon-panel {
  min-width: 0;
}

.ribbon-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0;
}

.ribbon-strip-box {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  min-width: 0;
  width: 100%;
}

.ribbon-strip-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0;
  min-width: 0;
}

.ribbon-strip-milestones {
  border-top: 1px solid var(--tt-border, #e8eaed);
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  width: 100%;
}

.ribbon-box-extras {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 0.75rem;
  width: 100%;
  border-top: 1px solid var(--tt-border, #e8eaed);
  margin-top: 0.3rem;
  padding-top: 0.35rem;
}

.ribbon-extras-panel {
  min-width: 0;
}

.ribbon-extras-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.2rem;
}

.ribbon-extras-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tt-text-muted, #5c6578);
}

.btn.btn-xs {
  padding: 0.05rem 0.35rem;
  font-size: 0.72rem;
  line-height: 1.2;
}

.ribbon-extras-empty {
  margin: 0;
  font-size: 0.72rem;
  color: var(--tt-text-muted, #5c6578);
}

.ribbon-extras-list {
  list-style: none;
  margin: 0;
  padding: 0.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  max-height: 8.5rem;
  overflow-y: auto;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.ribbon-extras-list-dragging {
  background: rgba(0, 153, 153, 0.05);
  box-shadow: inset 0 0 0 1px rgba(0, 153, 153, 0.14);
}

.ribbon-extras-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.35rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    opacity 0.18s ease,
    background 0.18s ease;
}

.ribbon-extras-drop-half {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  z-index: 6;
  cursor: grabbing;
}

.ribbon-extras-drop-half-top {
  top: 0;
}

.ribbon-extras-drop-half-bottom {
  bottom: 0;
}

.ribbon-extras-list-dragging .ribbon-extras-row:not(.ribbon-extras-row-dragging) {
  z-index: 1;
}

.ribbon-extras-list-dragging .ribbon-extras-row-dragging {
  z-index: 0;
}

.ribbon-extras-row-selected {
  background: var(--tt-accent-soft, #e0f7f6);
  border-color: rgba(0, 153, 153, 0.2);
}

.ribbon-extras-time {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex-shrink: 0;
}

.ribbon-extras-time-part {
  width: 2.1rem;
  padding: 0.1rem 0.2rem;
  font-size: 0.72rem;
  text-align: center;
}

.ribbon-extras-time-sep {
  font-size: 0.72rem;
  color: var(--tt-text-muted, #5c6578);
}

.ribbon-extras-text {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.1rem 0.35rem;
  font-size: 0.75rem;
}

.ribbon-extras-check {
  flex-shrink: 0;
  margin: 0;
  width: 0.9rem;
  height: 0.9rem;
}

.ribbon-extras-verifier {
  width: 4.2rem;
  flex-shrink: 0;
  padding: 0.1rem 0.25rem;
  font-size: 0.72rem;
}

.ribbon-extras-remove {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: #c0392b;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.2rem;
  cursor: pointer;
  opacity: 0.75;
}

.ribbon-extras-remove:hover {
  opacity: 1;
}

.ribbon-extras-drag-handle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.35rem;
  border-radius: 6px;
  cursor: grab;
  user-select: none;
  color: var(--tt-text-muted, #5c6578);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ribbon-extras-drag-handle:hover {
  background: rgba(0, 153, 153, 0.1);
  border-color: rgba(0, 153, 153, 0.22);
}

.ribbon-extras-drag-handle:active {
  cursor: grabbing;
  transform: scale(0.96);
}

.ribbon-extras-drag-grip {
  width: 0.45rem;
  height: 0.65rem;
  background-image: radial-gradient(circle, #7a8494 1.1px, transparent 1.2px);
  background-size: 0.45rem 0.32rem;
  background-position: center;
  opacity: 0.9;
}

.ribbon-extras-row-dragging,
body.takt-control-point-dragging .ribbon-extras-row-dragging-source {
  opacity: 0.28;
  border: 2px dashed rgba(0, 153, 153, 0.45);
  background: repeating-linear-gradient(
    -45deg,
    rgba(0, 153, 153, 0.05),
    rgba(0, 153, 153, 0.05) 7px,
    rgba(0, 153, 153, 0.01) 7px,
    rgba(0, 153, 153, 0.01) 14px
  );
  box-shadow: none;
  transform: scale(0.98);
}

.ribbon-extras-list-dragging .ribbon-extras-row:not(.ribbon-extras-row-dragging):not(.ribbon-extras-row-dragging-source) {
  transform: translateY(0);
}

.ribbon-extras-drag-ghost {
  position: fixed;
  top: -3000px;
  left: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.4rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 153, 153, 0.35);
  background: #fff;
  box-shadow:
    0 10px 28px rgba(0, 40, 40, 0.16),
    0 2px 8px rgba(0, 153, 153, 0.12);
  transform: rotate(-1.25deg);
  pointer-events: none;
  opacity: 0.96;
}

.ribbon-extras-drop-indicator--live[hidden] {
  display: none !important;
}

.ribbon-extras-drop-indicator--live {
  list-style: none;
  margin: 0;
  padding: 0.12rem 0;
  height: 8px;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.ribbon-extras-drop-indicator--live .ribbon-extras-drop-line {
  margin: 0 0 0 0.35rem;
  width: 100%;
}

.ribbon-extras-end-drop {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0.45rem 0.35rem;
  min-height: 1.6rem;
  border-radius: 8px;
  border: 1px dashed transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ribbon-extras-list-dragging .ribbon-extras-end-drop {
  border-color: rgba(0, 153, 153, 0.2);
  background: rgba(0, 153, 153, 0.04);
}

.ribbon-extras-end-drop-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7a8494;
  pointer-events: none;
}

.ribbon-extras-drop-slot {
  list-style: none;
  margin: 0;
  padding: 0.1rem 0;
  pointer-events: none;
}

.ribbon-extras-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  padding: 0.35rem 0.45rem 0.35rem 0.2rem;
  border-radius: 8px;
  background: rgba(0, 153, 153, 0.07);
  border: 1px dashed rgba(0, 153, 153, 0.35);
  animation: ribbon-extras-drop-zone-in 0.16s ease-out;
}

.ribbon-extras-drop-line {
  display: block;
  position: relative;
  height: 3px;
  margin: 0 0 0 1.1rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #e37200 0%, #009999 55%, #009999 100%);
  box-shadow: 0 0 0 2px rgba(0, 153, 153, 0.12);
  animation: ribbon-extras-drop-pulse 0.9s ease-in-out infinite alternate;
}

.ribbon-extras-drop-line::before {
  content: "";
  position: absolute;
  left: -0.85rem;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e37200;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(227, 114, 0, 0.4);
  transform: translateY(-50%);
}

.ribbon-extras-drop-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #007a7a;
  text-align: center;
  padding-left: 0.5rem;
}

@keyframes ribbon-extras-drop-zone-in {
  from {
    opacity: 0.4;
    transform: scaleY(0.7);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes ribbon-extras-drop-pulse {
  from {
    opacity: 0.72;
    transform: scaleY(1);
  }
  to {
    opacity: 1;
    transform: scaleY(1.4);
  }
}

@media (max-width: 900px) {
  .ribbon-box-extras {
    grid-template-columns: 1fr;
  }
}

.ribbon-strip-control-points {
  border-top: 1px solid var(--tt-border, #e8eaed);
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  width: 100%;
}

.ribbon-strip-control-points .ribbon-group {
  border-right: none;
  min-height: auto;
  width: 100%;
  align-items: stretch;
  padding: 0;
}

.ribbon-strip-control-points .ribbon-group-label {
  text-align: left;
  padding-left: 0.1rem;
}

.toolbar-control-point-list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.toolbar-control-point-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.toolbar-control-point-check {
  flex-shrink: 0;
  margin: 0;
}

.toolbar-control-point-text {
  flex: 1 1 auto;
  min-width: 8rem;
}

.process-box-control-badge {
  position: absolute;
  right: 4px;
  bottom: 3px;
  z-index: 3;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 1px 5px;
  border-radius: 999px;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.92);
  color: #333;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.process-box-operator-badge {
  position: absolute;
  left: 4px;
  bottom: 3px;
  z-index: 3;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 1px 5px;
  border-radius: 999px;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.92);
  color: #333;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.operators-summary {
  display: inline-block;
  min-width: 2.5rem;
  padding: 0.2rem 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.25rem;
  background: #fff;
}

.ribbon-extras-count {
  width: 3.25rem;
  flex: 0 0 auto;
}

.ribbon-extras-panel-full {
  grid-column: 1 / -1;
}

.ribbon-extras-head-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.ribbon-group-operators .ribbon-group-body {
  min-width: 7.5rem;
}

.operators-toolbar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.operators-toolbar-input {
  width: 3rem;
  min-width: 3rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.operators-toolbar-split,
.operators-toolbar-flat {
  min-width: 1.75rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  line-height: 1.1;
}

.operators-timeline {
  display: flex;
  width: 100%;
  height: 1.35rem;
  margin-bottom: 0.35rem;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(0, 153, 153, 0.25);
  background: rgba(0, 153, 153, 0.06);
}

.operators-timeline-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  border-right: 1px solid rgba(255, 255, 255, 0.65);
  background: linear-gradient(180deg, rgba(0, 153, 153, 0.28), rgba(0, 153, 153, 0.14));
}

.operators-timeline-segment:last-child {
  border-right: none;
}

.operators-timeline-count {
  font-size: 0.65rem;
  font-weight: 700;
  color: #005159;
}

.ribbon-extras-columns {
  display: grid;
  grid-template-columns: auto 3.25rem 1.5rem;
  gap: 0.3rem;
  padding: 0 0.35rem 0.15rem;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--tt-text-muted, #5c6578);
}

.ribbon-extras-list-operators {
  max-height: 10rem;
}

.process-box-full-lane .process-box-operator-badge {
  z-index: 4;
}

.process-box-operator-pin {
  position: absolute;
  top: 2px;
  z-index: 2;
  transform: translateX(-50%);
  font-size: 0.5rem;
  font-weight: 700;
  line-height: 1;
  padding: 1px 4px;
  border-radius: 999px;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.92);
  color: #005159;
  border: 1px solid rgba(0, 153, 153, 0.35);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.process-box-control-badge-open {
  background: rgba(255, 243, 205, 0.95);
  border-color: rgba(255, 193, 7, 0.55);
  color: #664d03;
}

.process-box-control-badge-done {
  background: rgba(209, 231, 221, 0.95);
  border-color: rgba(25, 135, 84, 0.45);
  color: #0f5132;
}

.process-box-end .process-box-control-badge,
.process-box-start .process-box-control-badge {
  bottom: 14px;
}

.ribbon-strip-milestones .ribbon-group {
  border-right: none;
  min-height: auto;
  width: 100%;
  align-items: stretch;
  padding: 0;
}

.ribbon-strip-milestones .ribbon-group-label {
  text-align: left;
  padding-left: 0.1rem;
}

.ribbon-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0.55rem;
  border-right: 1px solid var(--tt-border, #e8eaed);
  min-height: 3.35rem;
}

.ribbon-group:last-child {
  border-right: none;
}

.ribbon-group-wide {
  min-width: 14rem;
  flex: 1 1 auto;
  align-items: stretch;
}

.ribbon-group-narrow .ribbon-group-body input {
  width: 4.5rem;
}

.toolbar-sort-stack {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 4.5rem;
}

.toolbar-sort-stack .toolbar-sort-main,
.toolbar-sort-stack .toolbar-sort-sub {
  width: 100%;
  text-align: center;
  padding-top: 0.1rem;
  padding-bottom: 0.1rem;
}

.toolbar-sort-stack .toolbar-sort-sub {
  font-size: 0.75rem;
  color: var(--bs-secondary-color, #6c757d);
}

.ribbon-group-body {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 0.1rem 0;
  min-height: var(--ribbon-control-h, 1.75rem);
}

.ribbon-group-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tt-text-muted, #64748b);
  padding: 0.2rem 0 0.15rem;
  text-align: center;
  white-space: nowrap;
}

.ribbon-input-wide {
  min-width: 10rem;
  max-width: 16rem;
}

.ribbon-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
}

.ribbon-colors {
  flex-wrap: wrap;
  max-width: 7.5rem;
  justify-content: center;
  gap: 0.2rem;
}

.ribbon-color-more-wrap {
  position: relative;
}

.toolbar-color-btn.toolbar-color-more {
  color: var(--se-deep-600, #66667e);
  background: linear-gradient(135deg, #f5f5f5 0%, #ebebee 100%);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

.toolbar-color-btn.toolbar-color-more:not([style*="background-color"]) {
  border-color: var(--tt-border-strong, #ccccd4);
}

.ribbon-color-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 40, 0.28);
  backdrop-filter: blur(2px);
}

.ribbon-color-popup {
  position: relative;
  z-index: 10061;
  width: min(100%, 11.5rem);
  padding: 0.65rem 0.75rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--tt-border, #e0e0de);
  background: var(--tt-surface, #fff);
  box-shadow: 0 12px 36px rgba(0, 0, 40, 0.18);
}

.ribbon-color-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.ribbon-color-popup-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--se-teal, #005159);
}

.ribbon-color-popup-hint {
  margin: 0 0 0.55rem;
  font-size: 0.62rem;
  line-height: 1.35;
  color: var(--bs-secondary-color, #6c757d);
}

.ribbon-color-popup-grid {
  display: grid;
  grid-template-columns: repeat(4, 1.35rem);
  gap: 0.4rem;
  justify-content: center;
}

.ribbon-color-popup .toolbar-color-btn {
  width: 1.35rem;
  height: 1.35rem;
}

.edit-ribbon .toolbar-color-btn {
  width: 1.15rem;
  height: 1.15rem;
}

.ribbon-milestones-header {
  width: 100%;
  margin-bottom: 0.25rem;
}

.ribbon-group-milestones .toolbar-milestone-list {
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
}

.ribbon-group-milestones .toolbar-milestone-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.3rem;
}

.gantt-layout-library-right {
  flex-direction: row;
}

.gantt-side-tab-right {
  transform: none;
  writing-mode: vertical-rl;
  color: var(--se-teal, #005159);
}

.gantt-print-mode .edit-ribbon {
  display: none !important;
}

/* Process box edit — compact toolbar aligned with view chrome */
.edit-ribbon .box-edit-panel {
  --box-edit-control-h: var(--ribbon-control-h, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  min-width: 0;
}

.edit-ribbon .box-edit-panel .form-control-sm,
.edit-ribbon .box-edit-panel .font-size-stepper {
  height: var(--box-edit-control-h);
  min-height: var(--box-edit-control-h);
  border-radius: 6px;
  border-color: var(--tt-border, #d5d9de);
  font-size: 0.76rem;
}

.edit-ribbon .box-edit-panel .btn-sm {
  height: var(--box-edit-control-h);
  min-height: var(--box-edit-control-h);
  border-radius: 6px;
  font-size: 0.72rem;
  padding: 0 0.5rem;
}

.box-edit-toolbar {
  display: grid;
  grid-template-columns:
    minmax(10rem, 1fr)
    max-content
    max-content
    4.1rem
    4.1rem
    4.1rem
    minmax(6.5rem, auto)
    auto;
  gap: 0.35rem 0.55rem;
  align-items: end;
  width: 100%;
}

.box-edit-date-mode .box-edit-toolbar {
  grid-template-columns:
    minmax(8rem, 1fr)
    minmax(9rem, 1fr)
    max-content
    max-content
    4.1rem
    4.1rem
    4.1rem
    minmax(6.5rem, auto)
    auto;
}

.box-edit-field {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
}

.box-edit-field-task {
  min-width: 0;
}

.box-edit-field-narrow .box-edit-input {
  text-align: center;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.box-edit-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  color: var(--tt-text-muted, #64748b);
  margin: 0;
  line-height: 1.15;
  white-space: nowrap;
}

.box-edit-input {
  width: 100%;
}

.box-edit-field-task .box-edit-input {
  font-weight: 500;
}

.box-edit-duration {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0 0.35rem;
  background: #fff;
  border: 1px solid var(--tt-border, #d5d9de);
  border-radius: 6px;
  height: var(--box-edit-control-h);
  box-sizing: border-box;
  white-space: nowrap;
}

.box-edit-duration .toolbar-duration-part {
  width: 2.1rem;
  border: none;
  background: transparent;
  height: 100%;
  padding: 0;
  box-shadow: none;
}

.box-edit-duration .toolbar-duration-unit {
  font-size: 0.65rem;
  margin-right: 0.1rem;
}

.box-edit-field-colors {
  min-width: 0;
}

.box-edit-colors {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.22rem;
  padding: 0.22rem 0.35rem;
  background: #fff;
  border: 1px solid var(--tt-border, #d5d9de);
  border-radius: 6px;
  height: var(--box-edit-control-h);
  box-sizing: border-box;
  overflow-x: auto;
}

.edit-ribbon .box-edit-colors .toolbar-color-btn {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 4px;
  border: 1.5px solid;
  box-shadow: 0 1px 2px rgba(0, 0, 40, 0.12);
}

.edit-ribbon .box-edit-colors .toolbar-color-btn.active {
  outline: 2px solid var(--se-petrol, #009999);
  outline-offset: 1px;
}

.box-edit-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  justify-self: end;
}

.box-edit-milestones {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--tt-border, #e8eaed);
}

.box-edit-milestones-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.box-edit-milestones-title {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tt-text-muted, #64748b);
}

.box-edit-milestone-add {
  font-size: 0.7rem;
  padding: 0 0.55rem;
}

.box-edit-milestones-empty {
  margin: 0;
  font-size: 0.76rem;
  color: var(--tt-text-muted, #64748b);
}

.box-edit-milestone-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.box-edit-milestone-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.4rem;
  background: #f8fafb;
  border: 1px solid var(--tt-border, #e8eaed);
  border-radius: 6px;
  margin: 0;
}

.box-edit-milestone-row.toolbar-milestone-row-selected {
  background: var(--tt-accent-soft, #e8f7f6);
  border-color: rgba(0, 153, 153, 0.28);
}

.box-edit-milestone-row .toolbar-milestone-text {
  flex: 1;
  min-width: 0;
}

.box-edit-milestone-remove {
  width: 1.65rem;
  min-width: 1.65rem;
  padding: 0;
}

@media (max-width: 1200px) {
  .box-edit-toolbar,
  .box-edit-date-mode .box-edit-toolbar {
    grid-template-columns: repeat(4, minmax(4rem, 1fr));
  }

  .box-edit-field-task,
  .box-edit-field-start {
    grid-column: 1 / -1;
  }

  .box-edit-field-colors {
    grid-column: 1 / span 2;
  }

  .box-edit-actions {
    grid-column: 3 / -1;
    justify-self: end;
  }
}

@media (max-width: 640px) {
  .box-edit-toolbar,
  .box-edit-date-mode .box-edit-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .box-edit-field-task,
  .box-edit-field-start {
    grid-column: 1 / -1;
  }

  .box-edit-actions {
    grid-column: 1 / -1;
    justify-self: stretch;
    flex-wrap: wrap;
  }
}
