:root {
  color-scheme: light;
  --bg: #e8e8e8;
  --panel: #f4f4f4;
  --text: #1f2937;
  --line: #dadada;
  --axis-blue: #2f5cae;
  --axis-blue-dark: #244789;
  --row-gray: #8a8a8a;
  --row-blue: #5f9ed8;
  --row-yellow: #f2b705;
  --row-green: #69ab3d;
  --row-red: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
}

.app {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.5rem;
  display: grid;
  gap: 0.7rem;
}

.title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.auth-row {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.auth-user-menu {
  position: relative;
}

.auth-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid #c7ccd4;
  border-radius: 999px;
  background: #f3f4f6;
  color: #1f2937;
  padding: 0.2rem 0.48rem 0.2rem 0.24rem;
  cursor: pointer;
}

.auth-user-trigger:hover,
.auth-user-trigger:focus-visible {
  background: #e5e7eb;
  outline: none;
}

.auth-avatar {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  object-fit: cover;
  background: #dbeafe;
}

.auth-user-name {
  font-size: 0.76rem;
  font-weight: 700;
  color: #1f2937;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-user-popover {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f8fafc;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
  padding: 0.5rem;
  gap: 0.45rem;
  z-index: 20;
}

.auth-user-menu:hover .auth-user-popover,
.auth-user-menu:focus-within .auth-user-popover {
  display: grid;
}

.auth-status[data-state="readonly"] {
  color: #92400e;
}

.auth-status[data-state="signed-in"] {
  color: #166534;
}

.auth-status {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  overflow-wrap: anywhere;
}

.readonly-banner {
  margin: 0;
  padding: 0.42rem 0.55rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ececec;
  color: #374151;
  font-size: 0.82rem;
  font-weight: 600;
}

.readonly-banner[hidden] {
  display: none;
}

.view-toggle {
  display: inline-flex;
  gap: 0.35rem;
}

.view-link {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1f2937;
  background: #e5e7eb;
  border: 1px solid #c7ccd4;
  border-radius: 999px;
  padding: 0.28rem 0.62rem;
}

.view-link:hover,
.view-link:focus-visible {
  background: #d9dde5;
  outline: none;
}

.view-link.is-active {
  color: #ffffff;
  background: var(--axis-blue);
  border-color: var(--axis-blue-dark);
}

.title-row h1 {
  margin: 0;
  font-size: clamp(1.4rem, 2.2vw, 2.2rem);
  font-weight: 700;
}

.title-block {
  display: grid;
  gap: 0.15rem;
  align-content: end;
}
.roadmap-id-subtitle {
  margin: 0;
  font-size: 0.76rem;
  color: #6b7280;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.roadmap-description-subtitle {
  margin: 0;
  font-size: 0.86rem;
  color: #4b5563;
  max-width: 780px;
}

.roadmap-description-subtitle.editable,
.dashboard-roadmap-description.editable {
  cursor: text;
}

.roadmap-description-subtitle.editable:hover,
.dashboard-roadmap-description.editable:hover {
  text-decoration: underline;
  text-decoration-style: dotted;
}

.inline-description-editor {
  width: 100%;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  background: #fff;
  font: inherit;
  color: inherit;
  padding: 0.35rem 0.45rem;
  resize: vertical;
  min-height: 3.8rem;
}
.brand {
  margin: 0;
  font-size: 0.85rem;
  color: #4b5563;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#save-indicator[data-state="saving"] {
  color: #1d4ed8;
}

#roadmap-save-indicator[data-state="saving"] {
  color: #1d4ed8;
}

#save-indicator[data-state="saved"] {
  color: #166534;
}

#roadmap-save-indicator[data-state="saved"] {
  color: #166534;
}

#save-indicator[data-state="offline"] {
  color: #b45309;
}

#roadmap-save-indicator[data-state="offline"] {
  color: #b45309;
}

#save-indicator[data-state="failed"] {
  color: #b91c1c;
}

#roadmap-save-indicator[data-state="failed"] {
  color: #b91c1c;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
  background: #ececec;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
}

.controls-group {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.32rem 0.4rem;
  border: 1px solid #d7d7d7;
  border-radius: 6px;
  background: #f4f4f4;
}

.controls-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4b5563;
}

.controls-group-zoom {
  flex-wrap: wrap;
}

.status-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.8rem;
  background: #ececec;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
}

#master-source-legend[hidden] {
  display: none !important;
}

.legend-title {
  font-weight: 700;
  color: #374151;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: #1f2937;
}

.legend-toggle {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
  padding: 0.1rem 0.28rem;
  cursor: pointer;
}

.legend-toggle:hover,
.legend-toggle:focus-visible {
  border-color: #9ca3af;
  outline: none;
}

.legend-toggle[aria-pressed="false"] {
  opacity: 0.45;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid rgba(17, 24, 39, 0.35);
}

.legend-priority-bar {
  width: 16px;
  height: 8px;
  border-radius: 999px;
}

.master-source-toggles {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.master-source-toggle {
  border: 1px solid #9ca3af;
  border-radius: 999px;
  background: #f8fafc;
  color: #1f2937;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.master-source-toggle.is-active {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
}

.legend-dot[data-status="gray"] {
  background: var(--row-gray);
}

.legend-dot[data-status="default"] {
  background: var(--row-yellow);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 0.7rem;
  align-items: start;
}

.dashboard-create-card,
.dashboard-list-card {
  display: grid;
  gap: 0.6rem;
}

body.is-dashboard-readonly #dashboard-create-section {
  display: none !important;
}

body.is-dashboard-readonly .dashboard-grid {
  grid-template-columns: 1fr;
}

.dashboard-create-form {
  display: grid;
  gap: 0.45rem;
}

.dashboard-create-form label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #374151;
}

.dashboard-create-form input {
  width: 100%;
}

.dashboard-create-form textarea {
  width: 100%;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  background: #fff;
  font: inherit;
  padding: 0.35rem 0.45rem;
  resize: vertical;
  min-height: 4.5rem;
}

.sponsor-search {
  position: relative;
  display: grid;
  gap: 0.35rem;
}

.modal-assignee-search {
  width: 100%;
}

.modal-assignee-search input {
  width: 100%;
}

.assignee-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.assignee-chip {
  border: 1px solid #c7ccd4;
  border-radius: 999px;
  background: #f3f4f6;
  color: #1f2937;
  padding: 0.18rem 0.44rem 0.18rem 0.56rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  cursor: pointer;
}

.assignee-chip-avatar {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  object-fit: cover;
  background: #dbeafe;
}

.assignee-chip:hover,
.assignee-chip:focus-visible {
  background: #e5e7eb;
  border-color: #9ca3af;
  outline: none;
}

.assignee-chip-label {
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.assignee-chip-remove {
  font-size: 0.9rem;
  line-height: 1;
  color: #475569;
}

.assignee-col {
  position: relative;
  overflow: visible !important;
}

.assignee-col > input {
  width: 100%;
}

.task-table .assignee-col .assignee-chip-list {
  margin-top: 0.35rem;
}

.sponsor-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
  padding: 0.25rem;
  display: grid;
  gap: 0.15rem;
  max-height: 220px;
  overflow: auto;
}

#task-add-assignee-results[hidden] {
  display: none !important;
}

.sponsor-result-option {
  border: 1px solid transparent;
  border-radius: 6px;
  background: #f8fafc;
  color: #1f2937;
  text-align: left;
  padding: 0.38rem 0.5rem;
  display: grid;
  gap: 0.06rem;
  cursor: pointer;
}

.sponsor-result-option:hover,
.sponsor-result-option:focus-visible {
  border-color: #93c5fd;
  background: #eff6ff;
  outline: none;
}

.sponsor-result-name {
  font-size: 0.8rem;
  font-weight: 700;
}

.sponsor-result-email {
  font-size: 0.75rem;
  color: #475569;
}

.sponsor-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  border: 1px solid #c7ccd4;
  border-radius: 999px;
  background: #f3f4f6;
  color: #1f2937;
  padding: 0.2rem 0.45rem 0.2rem 0.24rem;
  width: fit-content;
  max-width: 100%;
  justify-self: start;
}

.sponsor-chip-display {
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  justify-self: start;
}

.sponsor-chip-trigger {
  cursor: pointer;
  justify-content: flex-start;
  border: 1px solid #c7ccd4;
}

.sponsor-chip-trigger:hover,
.sponsor-chip-trigger:focus-visible {
  background: #e5e7eb;
  outline: none;
}

.sponsor-chip-avatar {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  object-fit: cover;
  background: #dbeafe;
}

.sponsor-chip-text {
  display: grid;
  min-width: 0;
  text-align: left;
  justify-items: start;
}

.sponsor-chip-name {
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sponsor-chip-email {
  font-size: 0.7rem;
  color: #4b5563;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sponsor-chip-clear {
  border: 1px solid #c7ccd4;
  background: #e5e7eb;
  color: #334155;
  border-radius: 6px;
  padding: 0.16rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.sponsor-chip-clear:hover,
.sponsor-chip-clear:focus-visible {
  background: #dbe1e8;
  outline: none;
}

.roadmap-sponsor-chip {
  margin-top: 0.15rem;
}

.dashboard-roadmap-list {
  display: grid;
  gap: 0.55rem;
}

.dashboard-roadmap-item {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0.65rem;
  display: grid;
  grid-template-columns: 1fr minmax(170px, 230px);
  gap: 0.55rem;
  align-items: stretch;
}

.dashboard-roadmap-content {
  display: grid;
  gap: 0.45rem;
  align-content: start;
}

.dashboard-roadmap-thumb {
  width: 100%;
  height: 100%;
  min-height: 120px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  object-fit: cover;
  background: #e5e7eb;
}

.dashboard-roadmap-item h3 {
  margin: 0;
  font-size: 1rem;
}

.dashboard-roadmap-title-editable {
  cursor: text;
}

.dashboard-roadmap-title-editable:hover {
  text-decoration: underline;
  text-decoration-style: dotted;
}

.dashboard-roadmap-title-editable::after {
  content: " \270E";
  font-size: 0.82rem;
  color: #6b7280;
  margin-left: 0.28rem;
}

.dashboard-roadmap-name-input {
  width: 100%;
  max-width: 100%;
  font-size: 1rem;
  font-weight: 700;
}

.dashboard-roadmap-meta {
  margin: 0;
  color: #4b5563;
  font-size: 0.78rem;
}

.dashboard-roadmap-description {
  margin: 0;
  color: #374151;
  font-size: 0.84rem;
  line-height: 1.35;
}

.dashboard-roadmap-sponsor-row {
  display: grid;
  gap: 0.35rem;
}

.sponsor-edit-wrap {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto;
  gap: 0.35rem;
  align-items: start;
  position: relative;
}

.sponsor-edit-wrap[hidden] {
  display: none;
}

.sponsor-edit-input {
  width: 100%;
}

.dashboard-roadmap-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

@media (max-width: 880px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-roadmap-item {
    grid-template-columns: 1fr;
  }

  .dashboard-roadmap-thumb {
    height: auto;
    aspect-ratio: 16 / 7;
    min-height: 0;
  }
}

.legend-dot[data-status="blue"] {
  background: var(--row-blue);
}

.legend-dot[data-status="green"] {
  background: var(--row-green);
}

.legend-dot[data-status="orange"] {
  background: var(--row-yellow);
}

.legend-dot[data-status="red"] {
  background: var(--row-red);
}

.legend-dot[data-marker="holiday"] {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(31, 41, 55, 0.35);
  border-radius: 2px;
}

.legend-dot[data-marker="freeze"] {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(127, 29, 29, 0.35);
  border-radius: 2px;
}

.legend-dot[data-marker="exam"] {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(88, 28, 135, 0.35);
  border-radius: 2px;
}

.legend-dot[data-marker="assignees"] {
  background: #bfdbfe;
  border-color: #2563eb;
}

.legend-dot[data-marker="critical-path"] {
  width: 16px;
  height: 2px;
  background: #6b7280;
  border: 0;
  border-radius: 2px;
  box-shadow: none;
}

.legend-dot[data-marker="dependencies"] {
  width: 16px;
  height: 2px;
  background: #9ca3af;
  border: 0;
  border-radius: 2px;
  box-shadow: none;
}

.legend-dot[data-priority="high"] {
  background: #dc2626;
}

.legend-dot[data-priority="medium"] {
  background: #f59e0b;
}

.legend-dot[data-priority="low"] {
  background: #22c55e;
}

.item-form {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) minmax(140px, 1.2fr) minmax(130px, 1fr) minmax(130px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) auto;
  gap: 0.4rem;
  flex: 1 1 860px;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  background: #fff;
  padding: 0.35rem 0.45rem;
}

.btn {
  border: 0;
  border-radius: 4px;
  padding: 0.4rem 0.7rem;
  background: var(--axis-blue);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary {
  background: #4b5563;
}

.btn-toggle {
  background: #6b7280;
}

.btn-toggle.is-active {
  background: var(--axis-blue);
}

.zoom-control {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #ececec;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  padding: 0.28rem 0.45rem;
}

.zoom-control-label,
.zoom-control-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: #374151;
}

#roadmap-zoom {
  width: 120px;
}

.zoom-presets {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.zoom-preset {
  padding: 0.34rem 0.5rem;
  font-size: 0.78rem;
}

.zoom-preset.is-active {
  background: var(--axis-blue);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(17, 24, 39, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(920px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: var(--panel);
  border: 1px solid #c7c7c7;
  border-radius: 8px;
  padding: 0.8rem;
  display: grid;
  gap: 0.7rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.modal-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  align-items: center;
  gap: 0.45rem;
}

.modal-form > * {
  min-width: 0;
}

#task-edit-task-title,
#task-add-title-input {
  grid-column: 1 / -1;
}

.modal-dependency-control,
#task-edit-dependencies,
#task-add-dependencies {
  grid-column: 1 / -1;
}

.modal .dependency-multiselect-menu {
  max-height: 230px;
}

.modal-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

.roadmap-card {
  background: #dcdcdc;
  border: 1px solid #cacaca;
  padding: 0.55rem;
}

.table-card {
  background: #e1e1e1;
  border: 1px solid #cacaca;
  padding: 0.65rem;
  display: grid;
  gap: 0.7rem;
}

.editor-side-by-side {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.table-toolbar {
  display: flex;
  justify-content: flex-end;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid #c8c8c8;
  background: #f6f6f6;
}

.task-table-wrap {
  max-height: 58vh;
}

.table-filters {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) repeat(2, minmax(130px, 1fr)) repeat(2, minmax(130px, 1fr)) auto;
  gap: 0.45rem;
  align-items: center;
}

.bulk-actions {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(130px, 1fr) minmax(130px, 1fr) auto auto;
  gap: 0.45rem;
  align-items: center;
}

.bulk-selected-count {
  font-weight: 700;
  color: #374151;
  padding-right: 0.2rem;
}

.task-table {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.task-table th,
.task-table td {
  border-bottom: 1px solid #d6d6d6;
  padding: 0.35rem;
  text-align: left;
  overflow: hidden;
}

.task-table .select-col {
  width: 38px;
  text-align: center;
}

.row-select-checkbox {
  width: 16px;
  height: 16px;
}

.task-table th {
  background: #d1d5db;
  font-size: 0.83rem;
  position: sticky;
  top: 0;
  z-index: 2;
}

.task-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.task-table th.sortable::after {
  content: "↕";
  margin-left: 0.32rem;
  color: #6b7280;
  font-size: 0.72rem;
}

.task-table th.sortable[data-sort-state="asc"]::after {
  content: "↑";
  color: #111827;
}

.task-table th.sortable[data-sort-state="desc"]::after {
  content: "↓";
  color: #111827;
}

.task-table td input,
.task-table td select {
  width: 100%;
  min-width: 0;
}

.task-table td.dependencies-col {
  overflow: visible;
  position: relative;
}

.dependency-multiselect {
  width: 100%;
  position: relative;
}

.dependency-multiselect-details {
  position: relative;
}

.dependency-multiselect-trigger {
  list-style: none;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  background: #fff;
  padding: 0.38rem 0.55rem;
  font: inherit;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.dependency-multiselect-trigger::-webkit-details-marker {
  display: none;
}

.dependency-multiselect-trigger::after {
  content: "▾";
  color: #6b7280;
  font-size: 0.76rem;
}

.dependency-multiselect-details[open] .dependency-multiselect-trigger::after {
  content: "▴";
}

.dependency-multiselect-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.2rem);
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #c9c9c9;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
  z-index: 20;
  padding: 0.25rem;
}

.dependency-multiselect-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.36rem;
  border-radius: 4px;
  cursor: pointer;
  min-width: 0;
}

.dependency-multiselect-option:hover {
  background: #f1f5f9;
}

.task-table td .dependency-multiselect-option input {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  margin: 0;
}

.dependency-multiselect-option input[type="checkbox"] {
  width: auto;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  margin: 0;
}

.dependency-multiselect-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dependency-multiselect-empty {
  color: #6b7280;
  font-size: 0.84rem;
  padding: 0.35rem 0.4rem;
}

.lanes-table input[type="color"] {
  width: 56px;
  min-width: 56px;
  padding: 0;
  border: 0;
  background: transparent;
}

.row-delete {
  background: #b91c1c;
  color: #fff;
}

.icon-only-delete {
  padding: 0.38rem;
  min-width: 2rem;
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.icon-only-delete::before {
  content: "";
  width: 0.86rem;
  height: 0.94rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2'/%3E%3Cpath d='M19 6l-1 14a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1L5 6'/%3E%3Cline x1='10' y1='11' x2='10' y2='17'/%3E%3Cline x1='14' y1='11' x2='14' y2='17'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.paste-panel {
  border: 1px solid #cacaca;
  background: #f1f1f1;
  padding: 0.6rem;
  display: grid;
  gap: 0.45rem;
}

.paste-panel h2 {
  margin: 0;
  font-size: 1rem;
}

.paste-panel p {
  margin: 0;
  font-size: 0.86rem;
  color: #4b5563;
}

.paste-panel textarea {
  width: 100%;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  background: #fff;
  font: inherit;
  padding: 0.45rem;
  resize: vertical;
}

.paste-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.paste-feedback {
  color: #1f2937;
  font-weight: 600;
}

.roadmap-shell {
  display: grid;
  grid-template-columns: 165px 1fr;
  min-height: 640px;
}

.lane-labels {
  /* background: #9a9a9a; */
  /* border-right: 2px solid #bcbcbc; */
  position: sticky;
  left: 0;
  top: 0;
  z-index: 4;
}

.lane-header-spacer {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.lane-label {
  display: flex;
  align-items: center;
  padding: 0 0.55rem;
  color: #fff;
  font-style: italic;
  font-weight: 600;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.lane-label[data-color="gray"] {
  background: #8b8b8b;
}

.lane-label[data-color="blue"] {
  background: #5f9ed8;
}

.lane-label[data-color="yellow"] {
  background: #f2b705;
  color: #2a2a2a;
}

.lane-label[data-color="green"] {
  background: #69ab3d;
}

.roadmap-main {
  overflow: auto;
  background: #dcdcdc;
}

.timeline-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #dcdcdc;
  border-bottom: 1px solid #b7b7b7;
}

.year-band {
  display: grid;
  font-weight: 700;
  color: #d56b00;
  padding: 0 0.2rem;
  line-height: 1.4;
}

.year-band span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 0.2rem;
}

.year-band span.is-year-anchor {
  color: #b45309;
  position: sticky;
  left: 0;
  z-index: 4;
  justify-self: start;
  background: #dcdcdc;
  box-shadow: 1px 0 0 rgba(107, 114, 128, 0.35);
}

.month-band {
  display: grid;
  height: 24px;
  background: var(--axis-blue);
  border-radius: 2px;
  overflow: hidden;
}

.month-band span {
  color: #fff;
  font-size: 0.72rem;
  border-right: 1px solid rgba(255, 255, 255, 0.4);
  padding: 0.22rem 0.3rem;
  white-space: nowrap;
}

.timeline-grid {
  position: relative;
  background: #dcdcdc;
}

.timeline-orientation-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.timeline-gridline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(100, 116, 139, 0.26);
}

.timeline-week-band {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(220, 38, 38, 0.08);
  border-left: 1px solid rgba(185, 28, 28, 0.2);
  border-right: 1px solid rgba(185, 28, 28, 0.2);
}

.roadmap-state-panel {
  margin: 0.8rem;
  min-height: 120px;
  border: 1px dashed #9ca3af;
  background: #efefef;
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border-radius: 6px;
  padding: 0.9rem;
  text-align: center;
}

.roadmap-state-empty {
  flex-direction: column;
  gap: 0.35rem;
}

.roadmap-state-empty span {
  font-weight: 600;
  color: #4b5563;
  font-size: 0.9rem;
}

.state-row {
  text-align: center;
  color: #4b5563;
  font-weight: 700;
  padding: 0.8rem 0.55rem !important;
  background: #f3f4f6;
}

.state-row strong {
  color: #1f2937;
  margin-right: 0.3rem;
}

.lane {
  position: relative;
  border-bottom: 1px solid #ececec;
  background: #dcdcdc;
}

.lane:nth-child(odd) {
  background: #d8d8d8;
}

.holiday-band {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid rgba(31, 41, 55, 0.2);
  border-right: 1px solid rgba(31, 41, 55, 0.2);
  background: rgba(59, 130, 246, 0.16);
  pointer-events: none;
  z-index: 0;
}

.holiday-band[data-overlay-type="freeze"] {
  background: rgba(239, 68, 68, 0.13);
  border-left-color: rgba(127, 29, 29, 0.22);
  border-right-color: rgba(127, 29, 29, 0.22);
}

.holiday-band[data-overlay-type="exam"] {
  background: rgba(168, 85, 247, 0.13);
  border-left-color: rgba(88, 28, 135, 0.22);
  border-right-color: rgba(88, 28, 135, 0.22);
}

.bar {
  position: absolute;
  height: 24px;
  border-radius: 999px;
  background: var(--row-gray);
  border: 1px solid rgba(17, 24, 39, 0.16);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.14);
  cursor: grab;
  touch-action: none;
  overflow: visible;
  z-index: 2;
}

.timeline-grid.is-readonly .bar {
  cursor: default;
}

.bar.dragging {
  cursor: grabbing;
  filter: brightness(1.08);
  opacity: 0.6;
  z-index: 5;
}

.bar-outline {
  background: transparent !important;
  border: 2px dashed #1f2937;
  height: 24px;
  z-index: 4;
  pointer-events: none;
}

.bar[data-priority="high"] {
  background: var(--row-red);
}

.bar[data-priority="medium"] {
  background: var(--row-yellow);
}

.bar[data-priority="low"] {
  background: var(--row-green);
}

.bar.is-critical-path {
  box-shadow: 0 0 0 2px #111827, 0 2px 6px rgba(17, 24, 39, 0.35);
  z-index: 4;
}

.bar.is-critical-path::after {
  content: "CP";
  position: absolute;
  right: 6px;
  top: -12px;
  font-size: 0.54rem;
  font-weight: 800;
  line-height: 1;
  color: #111827;
  background: #f8fafc;
  border: 1px solid rgba(17, 24, 39, 0.45);
  border-radius: 999px;
  padding: 0.08rem 0.24rem;
  pointer-events: none;
}

.critical-path-link-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.dependency-link-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.dependency-link {
  position: absolute;
  height: 2px;
  transform-origin: left center;
  background: #9ca3af;
  opacity: 0.55;
  border-radius: 999px;
  border-top: 1px dashed rgba(75, 85, 99, 0.85);
}

.critical-path-link {
  position: absolute;
  height: 2px;
  transform-origin: left center;
  background: #111827;
  opacity: 0.45;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.32);
}

.bar-label {
  position: absolute;
  left: 24px;
  right: var(--bar-label-right, 36px);
  top: 50%;
  transform: translate(var(--label-shift-x, 0px), -50%);
  font-size: 0.69rem;
  /* font-weight: 700; */
  color: #ffffff;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  /* text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45); */
  pointer-events: none;
}

.bar-assignee-stack {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  height: 100%;
}

.bar-assignee-avatar {
  position: relative;
  height: 110%;
  width: auto;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  object-fit: cover;
  background: #dbeafe;
  margin-left: -6px;
}

.bar-assignee-stack .bar-assignee-avatar:first-child {
  margin-left: 0;
}

.bar-priority-dot {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: #f59e0b;
  box-shadow: 0 0 0 1px rgba(31, 41, 55, 0.18);
}

.bar-resize-handle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 9px;
  height: 24px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.4);
  opacity: 0.55;
  cursor: ew-resize;
  z-index: 2;
}

.bar-resize-start {
  left: -1px;
}

.bar-resize-end {
  right: -1px;
}

.bar:hover .bar-resize-handle,
.bar.dragging .bar-resize-handle {
  opacity: 0.95;
}

.timeline-grid.is-readonly .bar-resize-handle {
  display: none;
}

.bar-priority-dot[data-status="blue"] {
  background: var(--row-blue);
}

.bar-priority-dot[data-status="green"] {
  background: var(--row-green);
}

.bar-priority-dot[data-status="orange"] {
  background: var(--row-yellow);
}

.bar-priority-dot[data-status="red"] {
  background: var(--row-red);
}

.bar-priority-dot[data-status="gray"] {
  background: var(--row-gray);
}

.bar-priority-dot[data-status="default"] {
  background: var(--row-yellow);
}

.bar.label-right .bar-label {
  left: calc(100% + 6px);
  right: auto;
  transform: translateY(-50%);
  color: #111827;
  text-shadow: none;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 4px;
  padding: 0 4px;
}

.bar.label-right {
  z-index: 3;
}

.bar[data-priority="medium"] .bar-label {
  color: #111827;
  text-shadow: none;
}

.drag-date-tooltip {
  position: fixed;
  z-index: 9;
  pointer-events: none;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.2rem 0.38rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #dc2626;
  z-index: 3;
}

.today-label {
  position: absolute;
  top: -1.5rem;
  transform: translateX(-50%);
  font-size: 0.66rem;
  color: #ffffff;
  font-weight: 700;
  white-space: nowrap;
  background: #b91c1c;
  border-radius: 999px;
  padding: 0.1rem 0.38rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.timeline-grid.is-compact .bar {
  height: 18px;
}

.timeline-grid.is-compact .bar-outline {
  height: 18px;
}

.timeline-grid.is-compact .bar-resize-handle {
  height: 18px;
}

@media (max-width: 980px) {
  .roadmap-shell {
    grid-template-columns: 130px 1fr;
  }

  .item-form {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .month-band span {
    font-size: 0.66rem;
  }

  .modal-form {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  .editor-side-by-side {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-right {
    align-items: flex-start;
  }

  .controls {
    flex-direction: column;
  }

  .controls-group {
    width: 100%;
    flex-wrap: wrap;
  }

  .item-form {
    grid-template-columns: 1fr;
    flex: 1 1 auto;
  }

  .modal-form {
    grid-template-columns: 1fr;
  }

  .roadmap-shell {
    grid-template-columns: 110px 1fr;
    min-height: 520px;
  }

  .task-table {
    min-width: 760px;
  }

  .table-filters {
    grid-template-columns: 1fr;
  }

  .bulk-actions {
    grid-template-columns: 1fr;
  }
}
