:root {
  --bg: #0f172a;
  --panel: #111827;
  --accent: #5eead4;
  --accent-2: #fcd34d;
  --handle-offset: 12px;
  --timeline-height: 72px;
  --line: rgba(255, 255, 255, 0.06);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --danger: #ef4444;
  --shadow: 0 15px 50px rgba(0, 0, 0, 0.35);
  --font-display: "Avenir Next", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(94, 234, 212, 0.12), transparent 30%),
              radial-gradient(circle at 80% 10%, rgba(252, 211, 77, 0.15), transparent 35%),
              var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
}

.page {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.palette {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: linear-gradient(135deg, #0b1220, #0c1324);
}

.palette__header h1 {
  margin: 0 0 6px;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.palette__header p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.palette__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.palette-tab {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.palette-tab:hover {
  border-color: rgba(94, 234, 212, 0.5);
  color: var(--text);
}

.palette-tab.is-active {
  border-color: rgba(94, 234, 212, 0.72);
  color: #d1fae5;
  background: rgba(94, 234, 212, 0.18);
}

.palette__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px;
}

.palette__footer {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.palette__footer button {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.palette__footer button:hover {
  border-color: rgba(94, 234, 212, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
}

.workspace-panel {
  margin-top: 12px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.workspace-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.workspace-panel__toggle {
  min-width: 56px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.55);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}

.workspace-panel.is-hidden {
  display: none;
}

.workspace-panel__title {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.workspace-panel__header .workspace-panel__title {
  margin-bottom: 0;
}

.workspace-panel__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

#planningTaskPanel.workspace-panel,
#animalHousingPanel.workspace-panel,
#animalTransferPanel.workspace-panel {
  flex: 1;
}

#planningTaskList.workspace-panel__list,
#animalHousingList.workspace-panel__list,
#animalTransferList.workspace-panel__list {
  flex: 1;
}

.workspace-panel__list li {
  font-size: 12px;
  color: #dbeafe;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.48);
  padding: 6px 8px;
}

.animal-housing-board {
  margin-top: 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.44);
  min-height: 210px;
  max-height: 320px;
  overflow: auto;
}

.animal-housing-stage {
  position: relative;
  min-width: 100%;
  min-height: 240px;
}

#animalHousingPanel.is-collapsed .animal-housing-board,
#animalHousingPanel.is-collapsed .animal-housing-list {
  display: none;
}

.housing-cage {
  position: absolute;
  width: 248px;
  min-height: 178px;
  border-radius: 12px;
  border: 1px solid rgba(45, 212, 191, 0.42);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.92));
  box-shadow: 0 12px 26px rgba(2, 6, 23, 0.4);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.housing-cage__header {
  display: grid;
  grid-template-columns: 24px 1fr 52px;
  gap: 6px;
  align-items: center;
}

.housing-cage__drag {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.9);
  color: #93c5fd;
  cursor: grab;
}

.housing-cage__name,
.housing-cage__capacity {
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  background: rgba(15, 23, 42, 0.74);
  color: #e2e8f0;
  padding: 4px 8px;
  font-size: 12px;
}

.housing-cage__capacity {
  text-align: center;
  padding: 4px;
}

.housing-cage__sub {
  font-size: 11px;
  color: #99f6e4;
}

.housing-cage__animals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-height: 98px;
  align-content: start;
}

.housing-animal {
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 9px;
  background: rgba(30, 41, 59, 0.85);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  z-index: 3;
}

.housing-animal__name {
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1.15;
}

.housing-animal__id {
  height: 22px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  background: rgba(15, 23, 42, 0.75);
  color: #bae6fd;
  font-size: 11px;
  padding: 2px 6px;
}

.animal-housing-list {
  margin-top: 8px;
}

.animal-housing-list__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.animal-housing-list__header {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
}

.animal-housing-list__animal {
  display: flex;
  align-items: center;
  gap: 6px;
}

.animal-housing-list__animal span {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: #cbd5e1;
}

.animal-housing-list__animal input {
  width: 96px;
  height: 24px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.74);
  color: #bae6fd;
  font-size: 11px;
  padding: 2px 6px;
}

.animal-housing-list__empty {
  font-size: 11px;
  color: #94a3b8;
}

.animal-filter-toolbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.animal-filter-toolbar__btn {
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(45, 212, 191, 0.48);
  background: rgba(15, 23, 42, 0.72);
  color: #99f6e4;
  font-size: 12px;
  font-weight: 700;
  padding: 0 10px;
}

.animal-filter-toolbar__status {
  font-size: 11px;
  color: #7dd3fc;
}

.workspace-panel__list li.planning-task-item {
  --planning-task-depth: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  border-left: 3px solid var(--planning-task-color, rgba(148, 163, 184, 0.35));
  margin-left: calc(var(--planning-task-depth) * 12px);
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.workspace-panel__list li.planning-task-item:hover {
  border-color: var(--planning-task-color, rgba(94, 234, 212, 0.8));
  background: rgba(15, 23, 42, 0.72);
}

.workspace-panel__list li.planning-task-item.is-linked {
  box-shadow: inset 0 0 0 1px var(--planning-task-color, rgba(94, 234, 212, 0.35));
}

.workspace-panel__list li.planning-task-item.is-focused {
  border-color: var(--planning-task-color, rgba(94, 234, 212, 0.95));
  background: rgba(15, 23, 42, 0.85);
  box-shadow:
    inset 0 0 0 1px var(--planning-task-color, rgba(94, 234, 212, 0.55)),
    0 0 0 2px rgba(94, 234, 212, 0.22);
}

.workspace-panel__list li.planning-task-item.is-complete {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.65);
}

.workspace-panel__list li.planning-task-item.is-complete .planning-task-item__name {
  color: #bbf7d0;
  text-decoration: line-through;
}

.planning-task-item__name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  color: #e2e8f0;
}

.planning-task-item__heading {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.planning-task-item__toggle {
  width: 11px;
  min-width: 11px;
  text-align: center;
  color: #94a3b8;
  font-size: 10px;
  line-height: 1;
  transform: translateY(-0.5px);
}

.planning-task-item.has-children .planning-task-item__toggle {
  color: #cbd5e1;
}

.planning-task-item__heading .planning-task-item__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-task-item__meta {
  font-size: 11px;
  color: #93c5fd;
  line-height: 1.2;
}

.planning-task-item__deps {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.palette-feature-btn {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 12px;
  border: 1px solid rgba(94, 234, 212, 0.42);
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.2), rgba(59, 130, 246, 0.14));
  color: #dffbff;
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.palette-feature-btn:hover {
  border-color: rgba(94, 234, 212, 0.72);
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.28), rgba(59, 130, 246, 0.2));
  box-shadow:
    0 14px 26px rgba(15, 23, 42, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.palette-feature-btn:focus-visible {
  outline: 2px solid rgba(94, 234, 212, 0.85);
  outline-offset: 2px;
}

.palette-feature-btn__icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(207, 250, 254, 0.35);
  background: rgba(15, 23, 42, 0.26);
}

.palette-feature-btn__icon svg,
.palette-feature-btn__chevron svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.palette-feature-btn__label {
  flex: 1;
  text-align: left;
  letter-spacing: 0.01em;
}

.palette-feature-btn__chevron {
  width: 16px;
  height: 16px;
  opacity: 0.82;
}

.icon-tile {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: grab;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  box-shadow: var(--shadow);
}

.icon-tile:active {
  cursor: grabbing;
}

.icon-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(94, 234, 212, 0.3);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.icon-tile__glyph {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #e2e8f0;
}

.lab-icon {
  display: block;
  overflow: visible;
}

.icon-tile__glyph .lab-icon {
  width: 44px;
  height: 44px;
}

.lab-icon text {
  letter-spacing: 0.2px;
}

.icon-tile__label {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.workspace.has-log-open {
  padding-right: 0;
}

.workspace.has-log-open .canvas {
  margin-right: 300px; /* reserve space for log panel when open */
}

.workspace__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
}

.workspace__left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.workspace-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workspace-tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 11px;
  border-radius: 999px;
}

.workspace-tab.is-active {
  border-color: rgba(94, 234, 212, 0.72);
  color: #d1fae5;
  background: rgba(94, 234, 212, 0.16);
}

.workspace__title {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.workspace__title:empty {
  display: none;
}

.workspace__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.timeline-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--timeline-height);
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  padding: 6px 12px;
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
  z-index: 3;
}

.timeline-nav__label {
  text-align: center;
}

.timeline-nav button {
  pointer-events: auto;
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease;
}

#timelinePrev {
  justify-self: start;
  margin-left: -6px;
}

#timelineNext {
  justify-self: end;
  margin-right: -6px;
}

.timeline-nav button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.timeline-nav button:hover {
  border-color: rgba(94, 234, 212, 0.6);
  transform: translateY(-1px);
}

button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 10px;
  font-family: inherit;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}

button:hover {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.55);
  transform: translateY(-1px);
}

.is-hidden {
  display: none;
}

.canvas {
  position: relative;
  flex: 1;
  margin: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0, rgba(255, 255, 255, 0.04) var(--timeline-height), transparent var(--timeline-height)),
    radial-gradient(circle at 15% 20%, rgba(94, 234, 212, 0.08), transparent 28%),
    radial-gradient(circle at 80% 70%, rgba(252, 211, 77, 0.08), transparent 30%),
    #0b1220;
  overflow-x: hidden;
  overflow-y: visible;
  box-shadow: var(--shadow);
}

.canvas__hint {
  position: absolute;
  top: calc(var(--timeline-height) + 10px);
  left: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.drop.is-workspace-hidden {
  display: none !important;
}

.milestone-layer {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--timeline-height);
  bottom: 0;
  pointer-events: none;
  z-index: 4;
}

.milestone-marker {
  position: absolute;
  width: 16px;
  top: 0;
  bottom: 0;
  transform: translateX(-50%);
  pointer-events: auto;
  cursor: grab;
  opacity: 0.86;
  touch-action: none;
}

.milestone-marker.is-dragging {
  cursor: grabbing;
  opacity: 1;
}

.milestone-marker::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  border-left: 2px dotted var(--milestone-color, #f472b6);
}

.milestone-marker__diamond {
  position: absolute;
  top: -7px;
  left: 1px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--milestone-color, #f472b6);
  background: rgba(15, 23, 42, 0.95);
  transform: rotate(45deg);
}

.milestone-marker__label {
  position: absolute;
  top: 1px;
  transform: translateY(-50%);
  left: 19px;
  color: #fbcfe8;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(2, 6, 23, 0.8);
}

.canvas__links {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 1;
}

.canvas__links--top {
  z-index: 6;
}

.weekend-stripes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.weekend-stripes__band {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.035);
}

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

.day-grid__line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.canvas__links path,
.canvas__links line,
.canvas__links polyline {
  color: var(--accent);
  stroke: currentColor;
  stroke-width: 2.5px;
  stroke-linecap: round;
  stroke-linejoin: round;
  marker-end: url(#arrowhead);
  fill: none;
  pointer-events: visibleStroke;
  cursor: pointer;
  opacity: 0.9;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
  transition: stroke 160ms ease, opacity 160ms ease;
}

.canvas__links polyline {
  marker-end: none;
}

.canvas__links line:hover,
.canvas__links polyline:hover {
  color: var(--accent-2);
  opacity: 1;
}

.link--selected {
  color: var(--accent-2);
  stroke-width: 3px;
  opacity: 1;
}

.canvas__links .link--planning {
  stroke-width: 2.7px;
  opacity: 0.98;
}

.canvas__links--top .link--planning {
  stroke-width: 2.9px;
}

.canvas__links .temp-line {
  color: rgba(255, 255, 255, 0.7);
  stroke-dasharray: 6 6;
  marker-end: none;
  marker-mid: none;
}

.canvas__links--top .link-end-overlay {
  marker-end: url(#arrowhead-top);
  opacity: 1;
  stroke-width: 2.8px;
  pointer-events: none;
}

.timeline {
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--timeline-height);
  display: grid;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
  border-bottom: 1px solid var(--line);
  pointer-events: none;
}

.timeline__day {
  position: relative;
  text-align: center;
  padding-top: 8px;
}

.timeline__day.weekend {
  background: transparent;
}

.timeline__day::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 10px;
  background: rgba(255, 255, 255, 0.14);
}

.today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px dotted #ef4444;
  pointer-events: none;
  z-index: 2;
}

.today-triangle {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 10px solid #ef4444;
  pointer-events: none;
  z-index: 3;
  transform: translate(-50%, 0);
}

.today-time {
  position: fixed;
  transform: translate(-50%, 0);
  background: rgba(15, 23, 42, 0.9);
  color: #fecdd3;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 3;
  white-space: nowrap;
}

.canvas--active {
  border-color: rgba(94, 234, 212, 0.8);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.12), var(--shadow);
}

.canvas--panning {
  cursor: grabbing;
}

.drop {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 32px;
  color: #fff;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
  backdrop-filter: blur(4px);
  z-index: 4;
}

.drop__icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.drop__icon .lab-icon {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.drop__icon .lab-icon text {
  font-size: 7px;
}

.drop--cage {
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.44);
  border-color: rgba(94, 234, 212, 0.36);
  z-index: 4;
}

.drop--cage .drop__icon {
  width: 104px;
  height: 104px;
}

.drop--cage .drop__icon .lab-icon {
  width: 100px;
  height: 100px;
}

.drop--animal {
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.34);
  border-color: rgba(148, 163, 184, 0.45);
  z-index: 7;
}

.drop--animal .drop__icon {
  width: 40px;
  height: 40px;
}

.drop--animal .drop__icon .lab-icon {
  width: 38px;
  height: 38px;
}

.drop--animal .node-label {
  top: auto;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 0;
  max-width: none;
  width: calc(100% - 8px);
  min-height: 14px;
  height: 14px;
  padding: 0 3px;
  background: rgba(15, 23, 42, 0.46);
  border: 0;
  border-radius: 6px;
  box-shadow: none;
  resize: none;
  line-height: 14px;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  color: #e2e8f0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.drop--animal .node-label--readonly {
  background: rgba(15, 23, 42, 0.46);
}

.drop--animal .node-label:focus {
  height: 18px;
  min-height: 18px;
  line-height: 16px;
  padding: 1px 4px;
  border: 1px solid rgba(94, 234, 212, 0.52);
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 0 0 2px rgba(94, 234, 212, 0.14);
}

.drop--animal-procedure {
  height: 42px;
  min-height: 42px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.22), rgba(15, 23, 42, 0.88));
  border-color: rgba(96, 165, 250, 0.62);
  overflow: visible;
}

.drop--animal-procedure .drop__icon {
  position: absolute;
  left: 7px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
}

.drop--animal-procedure .drop__icon .lab-icon {
  width: 18px;
  height: 18px;
  filter: none;
}

.drop--animal-procedure .drop__icon .lab-icon text {
  display: none;
}

.drop--animal-procedure .node-label {
  top: 50%;
  left: 30px;
  transform: translateY(-50%);
  width: calc(100% - 38px);
  min-width: 0;
  max-width: none;
  min-height: 18px;
  height: 18px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  line-height: 18px;
  resize: none;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
}

.animal-procedure-badge {
  position: absolute;
  top: -9px;
  right: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid rgba(45, 212, 191, 0.55);
  background: rgba(2, 6, 23, 0.94);
  color: #99f6e4;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.drop--planning-task {
  --planning-dependency-color: #5eead4;
  height: 36px;
  min-height: 36px;
  border-radius: 10px;
  display: block;
  overflow: visible;
  background:
    linear-gradient(
      90deg,
      rgba(94, 234, 212, 0.16) 0,
      rgba(15, 23, 42, 0.86) 26px
    );
  border-color: rgba(148, 163, 184, 0.34);
}

.drop--planning-task .drop__icon {
  position: absolute;
  left: 7px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  opacity: 0.9;
}

.drop--planning-task .drop__icon .lab-icon {
  width: 18px;
  height: 18px;
  filter: none;
}

.drop--planning-task .drop__icon .lab-icon text {
  display: none;
}

.drop--planning-task .node-label {
  top: 50%;
  left: 31px;
  transform: translateY(-50%);
  min-width: 0;
  max-width: none;
  width: calc(100% - 40px);
  min-height: 18px;
  height: 18px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  resize: none;
  line-height: 18px;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  color: #e2e8f0;
  overflow: hidden;
}

.drop--planning-task .node-label--readonly {
  background: transparent;
}

.drop--planning-task .node-label:focus {
  min-height: 22px;
  height: 22px;
  line-height: 18px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(94, 234, 212, 0.52);
  background: rgba(15, 23, 42, 0.94);
  box-shadow: 0 0 0 2px rgba(94, 234, 212, 0.14);
}

.drop--planning-task .resize-handle {
  right: -8px;
  width: 12px;
  height: 16px;
}

.drop--planning-task .handle {
  width: 10px;
  height: 10px;
}

.drop--planning-task.drop--planning-linked {
  border-color: var(--planning-dependency-color);
  box-shadow:
    0 0 0 1px rgba(8, 16, 30, 0.7),
    0 0 0 2px rgba(94, 234, 212, 0.3),
    0 8px 18px rgba(0, 0, 0, 0.28);
}

.drop--planning-task.drop--planning-complete {
  background:
    linear-gradient(
      90deg,
      rgba(16, 185, 129, 0.28) 0,
      rgba(6, 78, 59, 0.82) 26px,
      rgba(15, 23, 42, 0.9) 100%
    );
  border-color: rgba(16, 185, 129, 0.74);
}

.drop--planning-task.drop--planning-complete .node-label {
  color: #bbf7d0;
  text-decoration: line-through;
}

.drop--planning-task.drop--planning-has-inbound::before,
.drop--planning-task.drop--planning-has-outbound::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  transform: translateY(-50%);
  opacity: 0.9;
  pointer-events: none;
}

.drop--planning-task.drop--planning-has-inbound::before {
  left: -6px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 7px solid var(--planning-dependency-color);
}

.drop--planning-task.drop--planning-has-outbound::after {
  right: -6px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--planning-dependency-color);
}

.planning-task-deps {
  position: absolute;
  right: 6px;
  top: -10px;
  transform: none;
  min-width: 0;
  text-align: right;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: rgba(226, 232, 240, 0.76);
  padding: 1px 4px;
  border-radius: 999px;
  background: rgba(8, 16, 30, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.34);
  pointer-events: none;
}

.planning-task-deps.is-active {
  color: var(--planning-dependency-color);
  border-color: var(--planning-dependency-color);
}

.drop--plate .drop__icon {
  position: absolute;
  left: 6px;
  top: 4px;
  width: 28px;
  height: 28px;
  opacity: 0.95;
}

.drop--plate .drop__icon .lab-icon {
  width: 26px;
  height: 26px;
}

.drop--plate .resize-handle {
  opacity: 0;
  pointer-events: none;
}

.plate-well-overlay {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 4px;
  bottom: 4px;
  border-radius: 10px;
  background: rgba(8, 16, 30, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 6px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.plate-well-title {
  font-size: 9px;
  color: #bfdbfe;
  line-height: 1.1;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plate-well-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plate-well-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 4px;
  align-items: center;
  cursor: pointer;
  pointer-events: auto;
}

.plate-well-row__id {
  font-size: 8px;
  color: #dbeafe;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plate-well-row__bar-wrap {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: visible;
  pointer-events: auto;
}

.plate-well-row__bar {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(94, 234, 212, 0.95), rgba(56, 189, 248, 0.9));
  overflow: hidden;
  pointer-events: auto;
}

.plate-well-row__start-anchor {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: var(--plate-group-color, #22d3ee);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 0 2px rgba(8, 16, 30, 0.9);
  z-index: 2;
  pointer-events: auto;
}

.plate-well-row.is-selected .plate-well-row__id {
  font-weight: 700;
}

.plate-well-row.is-task-focus .plate-well-row__bar-wrap {
  height: 11px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.36), 0 0 0 3px rgba(34, 211, 238, 0.16);
}

.plate-well-row.is-collapsed-focus .plate-well-row__bar-wrap {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45), 0 0 0 4px rgba(34, 211, 238, 0.2);
}

.plate-row-progress {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
  pointer-events: none;
}

.plate-row-progress__seg {
  height: 100%;
  position: relative;
  background: repeating-linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.52),
    rgba(255, 255, 255, 0.52) 5px,
    rgba(2, 6, 23, 0.24) 5px,
    rgba(2, 6, 23, 0.24) 10px
  );
  border-right: 1px solid rgba(255, 255, 255, 0.35);
  opacity: 0.92;
}

.progress-task-link {
  transition: background-color 140ms ease, border-color 140ms ease, opacity 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.plate-row-progress > .plate-row-progress__seg:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(248, 113, 113, 0.48) 0 2px,
    transparent 2px 5px
  );
}

.plate-row-progress__seg.is-done {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.95), rgba(16, 185, 129, 0.9));
  border-right-color: rgba(187, 247, 208, 0.75);
  opacity: 1;
}

.plate-row-progress__gap {
  height: 100%;
  background: rgba(255, 255, 255, 0.06);
  border-right: 1px dashed rgba(148, 163, 184, 0.35);
}

.plate-row-progress__recur-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.plate-row-progress__seg--recur {
  position: absolute;
  top: 0;
  bottom: 0;
  height: auto;
  border-radius: 0;
  border: 0;
  background: repeating-linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.52),
    rgba(255, 255, 255, 0.52) 5px,
    rgba(2, 6, 23, 0.24) 5px,
    rgba(2, 6, 23, 0.24) 10px
  );
  border-right: 1px solid rgba(255, 255, 255, 0.35);
  opacity: 0.92;
}

.plate-row-progress__seg--recur-inline {
  border: 0;
  background: inherit;
}

.plate-row-progress__seg--recur.is-done {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.95), rgba(16, 185, 129, 0.9));
  border-right-color: rgba(187, 247, 208, 0.75);
  opacity: 1;
}

.plate-row-progress__seg--recur-inline.is-done {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.95), rgba(16, 185, 129, 0.9));
  border-right-color: rgba(187, 247, 208, 0.75);
  opacity: 1;
}

.plate-row-progress__markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.plate-row-progress__marker {
  position: absolute;
  top: -1px;
  bottom: -1px;
  width: 0;
  transform: translateX(-50%);
  border-left: 2px dashed rgba(251, 191, 36, 0.65);
  opacity: 0.95;
}

.plate-row-progress__marker.is-done {
  border-left-color: rgba(187, 247, 208, 0.95);
}

@keyframes task-progress-segment-flash {
  0% {
    background: rgba(250, 204, 21, 0.26);
    box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.45);
  }
  50% {
    background: rgba(250, 204, 21, 0.54);
    box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.82), 0 0 8px rgba(250, 204, 21, 0.35);
  }
  100% {
    background: rgba(250, 204, 21, 0.26);
    box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.45);
  }
}

@keyframes task-progress-marker-flash {
  0% {
    opacity: 0.72;
    filter: drop-shadow(0 0 0 rgba(250, 204, 21, 0.25));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 7px rgba(250, 204, 21, 0.75));
  }
  100% {
    opacity: 0.72;
    filter: drop-shadow(0 0 0 rgba(250, 204, 21, 0.25));
  }
}

.progress-seg.progress-task-link.is-hover,
.plate-row-progress__seg.progress-task-link.is-hover {
  animation: task-progress-segment-flash 0.9s ease-in-out infinite;
}

.progress-marker.progress-task-link.is-hover,
.plate-row-progress__marker.progress-task-link.is-hover {
  animation: task-progress-marker-flash 0.9s ease-in-out infinite;
}

.progress-marker--add.progress-task-link.is-hover,
.progress-marker--rem.progress-task-link.is-hover {
  border-bottom-color: rgba(250, 204, 21, 0.96);
}

.progress-marker--recur.progress-task-link.is-hover,
.plate-row-progress__marker.progress-task-link.is-hover {
  border-left-color: rgba(250, 204, 21, 0.98);
}

.plate-well-row.is-overdue .plate-well-row__bar-wrap {
  animation: plate-row-alert 1.15s ease-in-out infinite;
}

.plate-well-row.is-overdue .plate-well-row__start-anchor {
  animation: plate-anchor-alert 1.15s ease-in-out infinite;
}

@keyframes plate-row-alert {
  0% {
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35);
    background-color: rgba(239, 68, 68, 0.18);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.78), 0 0 12px rgba(239, 68, 68, 0.4);
    background-color: rgba(239, 68, 68, 0.34);
  }
  100% {
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35);
    background-color: rgba(239, 68, 68, 0.18);
  }
}

@keyframes plate-anchor-alert {
  0% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 0 2px rgba(8, 16, 30, 0.9);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.22);
    box-shadow: 0 0 0 2px rgba(8, 16, 30, 0.9), 0 0 0 6px rgba(239, 68, 68, 0.28);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 0 2px rgba(8, 16, 30, 0.9);
  }
}

.plate-well-row.is-marker-only .plate-well-row__bar-wrap {
  background: rgba(148, 163, 184, 0.24);
}

.plate-well-empty {
  font-size: 8px;
  color: #94a3b8;
  line-height: 1.2;
}

.plate-well-overflow {
  font-size: 8px;
  color: #94a3b8;
  line-height: 1;
}

.drop:hover {
  transform: translateY(-2px) scale(1.01);
  border-color: rgba(94, 234, 212, 0.6);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.drop--pulse {
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.5), 0 10px 22px rgba(0, 0, 0, 0.5);
  transition: box-shadow 120ms ease;
}

.drop--pulse-selected {
  animation: pulse-fast 0.6s ease-in-out infinite;
  box-shadow: 0 0 0 3px rgba(252, 211, 77, 0.8), 0 10px 22px rgba(252, 211, 77, 0.4);
}

.drop--overdue-alert {
  animation: vessel-overdue-flash 1.15s ease-in-out infinite;
}

@keyframes vessel-overdue-flash {
  0% {
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.22), 0 10px 22px rgba(0, 0, 0, 0.35);
  }
  50% {
    border-color: rgba(239, 68, 68, 0.92);
    box-shadow:
      0 0 0 3px rgba(239, 68, 68, 0.55),
      0 0 16px rgba(239, 68, 68, 0.35),
      0 10px 22px rgba(0, 0, 0, 0.38);
  }
  100% {
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.22), 0 10px 22px rgba(0, 0, 0, 0.35);
  }
}

.drop:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.task-strip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  max-width: 220px;
  z-index: 30;
}

.task-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(17, 24, 39, 0.9);
  color: var(--text);
  font-size: 11px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.task-chip input {
  accent-color: #a5f3fc;
}

.task-assign {
  background: var(--accent);
  color: #0c1a1f;
  border: 1px solid rgba(94, 234, 212, 0.8);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 11px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.task-assign:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(94, 234, 212, 0.35);
}

.task-assign--assigned {
  background: var(--accent-2);
  border-color: rgba(252, 211, 77, 0.9);
  color: #1f1300;
}

.task-chip.is-done span {
  opacity: 0.7;
}

.task-chip.is-done .task-label {
  text-decoration: line-through;
}

.task-chip--alert {
  animation: pulse-alert 1s ease-in-out infinite;
  border-color: rgba(239, 68, 68, 0.9);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.task-chip--pulse {
  box-shadow: 0 0 0 2px rgba(94, 234, 212, 0.7);
}

.task-chip--pulse-selected {
  animation: pulse-fast 0.6s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(252, 211, 77, 0.9);
}

@keyframes pulse-fast {
  0% { box-shadow: 0 0 0 2px rgba(252, 211, 77, 0.9); opacity: 1; }
  50% { box-shadow: 0 0 0 4px rgba(252, 211, 77, 0.9); opacity: 0.7; }
  100% { box-shadow: 0 0 0 2px rgba(252, 211, 77, 0.9); opacity: 1; }
}

@keyframes pulse-fast-bg {
  0% {
    box-shadow: 0 0 0 2px rgba(252, 211, 77, 0.35);
    background: rgba(252, 211, 77, 0.12);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(252, 211, 77, 0.65);
    background: rgba(252, 211, 77, 0.24);
  }
  100% {
    box-shadow: 0 0 0 2px rgba(252, 211, 77, 0.35);
    background: rgba(252, 211, 77, 0.12);
  }
}

@keyframes pulse-alert {
  0% { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2); opacity: 1; }
  50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.5); opacity: 0.7; }
  100% { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2); opacity: 1; }
}

.task-delta {
  text-decoration: none !important;
  color: #fca5a5;
  margin-left: 4px;
  opacity: 1;
}

.node-progress-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  display: flex;
  pointer-events: none;
}

.progress-seg {
  position: relative;
  height: 100%;
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.22),
    rgba(255, 255, 255, 0.22) 6px,
    transparent 6px,
    transparent 12px
  );
  transition: background-color 140ms ease, opacity 140ms ease;
}

.progress-recur-segments {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.progress-seg--recur {
  position: absolute;
  top: 0;
  bottom: 0;
  height: auto;
  border-radius: 0;
  border: 0;
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.22),
    rgba(255, 255, 255, 0.22) 6px,
    transparent 6px,
    transparent 12px
  );
  opacity: 1;
}

.progress-seg--recur-inline {
  border: 0;
  background: inherit;
}

.progress-seg--recur.is-done {
  background: linear-gradient(90deg, rgba(94, 234, 212, 0.95), rgba(94, 234, 212, 0.65));
}

.progress-seg--recur-inline.is-done {
  background: linear-gradient(90deg, rgba(94, 234, 212, 0.95), rgba(94, 234, 212, 0.65));
}

.drop[data-icon-id$="_flask"] .node-progress-overlay > .progress-seg:not(:last-child)::after,
.drop[data-icon-id^="dish_"] .node-progress-overlay > .progress-seg:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(239, 68, 68, 0.42) 0 2px,
    transparent 2px 5px
  );
}

.progress-seg.is-done {
  background: linear-gradient(90deg, rgba(94, 234, 212, 0.95), rgba(94, 234, 212, 0.65));
}

.progress-seg.progress-seg--recur.is-done {
  background: linear-gradient(90deg, rgba(94, 234, 212, 0.95), rgba(94, 234, 212, 0.65));
}

.progress-gap {
  height: 100%;
  background: rgba(255, 255, 255, 0.04);
  border-right: 1px dashed rgba(148, 163, 184, 0.3);
}

.progress-markers {
  position: absolute;
  inset: 6% 0 6% 0;
  pointer-events: none;
}

.progress-marker {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 10px solid rgba(255, 255, 255, 0.35);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.progress-marker--add {
  border-bottom-color: rgba(239, 68, 68, 0.45);
}

.progress-marker--rem {
  border-bottom-color: rgba(96, 165, 250, 0.45);
}

.progress-marker.is-done.progress-marker--add {
  border-bottom-color: rgba(239, 68, 68, 0.95);
}

.progress-marker.is-done.progress-marker--rem {
  border-bottom-color: rgba(96, 165, 250, 0.95);
}

.progress-marker--recur {
  top: -6%;
  bottom: -6%;
  width: 0;
  height: auto;
  border: 0;
  border-left: 2px dashed rgba(251, 191, 36, 0.68);
  border-radius: 1px;
  filter: none;
}

.progress-marker.is-done.progress-marker--recur {
  border-left-color: rgba(167, 243, 208, 0.98);
}

.node-label {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 96px;
  max-width: 180px;
  width: 120px;
  min-height: 28px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text);
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.node-label:focus {
  border-color: rgba(94, 234, 212, 0.6);
  box-shadow: 0 0 0 2px rgba(94, 234, 212, 0.14), 0 6px 16px rgba(0, 0, 0, 0.35);
}

.node-label--readonly {
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.resize-handle {
  position: absolute;
  right: -10px;
  top: 50%;
  width: 14px;
  height: 20px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  cursor: ew-resize;
  opacity: 0;
  transition: opacity 120ms ease, background 120ms ease, border 120ms ease;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.drop:hover .resize-handle,
.drop:focus-within .resize-handle {
  opacity: 1;
}

.resize-handle:active {
  background: rgba(94, 234, 212, 0.18);
  border-color: rgba(94, 234, 212, 0.6);
}

.node-menu {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  z-index: 12;
  min-width: 260px;
  max-width: min(420px, 92vw);
}

.node-menu.is-hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.node-menu__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.node-menu__context {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--node-menu-group-color, rgba(34, 211, 238, 0.5));
  background: rgba(15, 23, 42, 0.88);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.node-menu__context.is-hidden {
  display: none;
}

.node-menu__context-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.node-menu__context-name {
  font-size: 13px;
  line-height: 1.2;
  color: var(--text);
}

.node-menu__context-wells {
  font-size: 11px;
  line-height: 1.2;
  color: #cbd5e1;
}

.node-menu button {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.node-menu button:hover {
  background: rgba(94, 234, 212, 0.14);
  border-color: rgba(94, 234, 212, 0.6);
  transform: translateY(-1px);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(14px, 3vh, 28px) 16px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 50;
}

.modal-backdrop--center {
  align-items: center;
}

.modal-backdrop.is-hidden {
  display: none;
}

.modal {
  background: #0b1220;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  width: min(520px, 92vw);
  margin: 0 auto;
  max-height: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.modal__header,
.modal__footer {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal__title {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.modal__body {
  padding: 14px 16px;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal--signin .modal__body {
  gap: 12px;
}

.sign-in-google {
  gap: 8px;
}

.google-signin-mount {
  min-height: 40px;
  display: flex;
  align-items: center;
}

.google-signin-mount > div {
  width: 100%;
}

.sign-in-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.sign-in-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sign-in-divider::before,
.sign-in-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(148, 163, 184, 0.28);
}

.modal--start {
  max-width: 420px;
}

.modal--start .modal__footer {
  justify-content: flex-end;
}

.modal--start .modal__footer button {
  min-width: 88px;
}

.modal--group-rename {
  max-width: 380px;
}

.modal--group-rename .modal__footer {
  justify-content: flex-end;
}

.modal--completion {
  max-width: 430px;
}

.modal--completion .modal__footer {
  justify-content: flex-end;
}

.modal--planning-task,
.modal--milestone,
.modal--cage-capacity {
  max-width: 420px;
}

.modal--planning-task .completion-date-row {
  margin-top: -2px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.cage-capacity-default-row {
  margin-top: 10px;
}

.modal--animal-details,
.modal--animal-procedure,
.modal--animal-filter {
  max-width: 460px;
}

.animal-procedure-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
}

.animal-procedure-list__section {
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 10px;
  padding: 8px;
  background: rgba(15, 23, 42, 0.56);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.animal-procedure-list__title {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
}

.animal-procedure-list__row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #cbd5e1;
}

.muted-text {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.color-swatch-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: var(--swatch-color, #5eead4);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.color-swatch:hover {
  transform: translateY(-1px);
  border-color: rgba(226, 232, 240, 0.9);
}

.color-swatch.is-selected {
  border-color: rgba(226, 232, 240, 0.98);
  box-shadow: 0 0 0 2px rgba(94, 234, 212, 0.3);
}

.color-swatch--auto {
  width: auto;
  min-width: 52px;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.completion-date-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.completion-date-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.completion-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.completion-recur-prompt {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.completion-recur-title {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #cbd5e1;
}

.completion-recur-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.completion-recur-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 82px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 11px;
  padding: 9px 10px;
  background: rgba(15, 23, 42, 0.58);
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.completion-recur-option:hover {
  border-color: rgba(94, 234, 212, 0.55);
}

.completion-recur-option input[type="radio"] {
  margin: 2px 0 0;
  accent-color: #5eead4;
}

.completion-recur-option__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.completion-recur-option__title {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1.25;
}

.completion-recur-option__hint {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.35;
}

.completion-recur-option.is-selected {
  border-color: rgba(94, 234, 212, 0.88);
  background: rgba(45, 212, 191, 0.15);
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.28);
}

@media (max-width: 560px) {
  .completion-date-row,
  .completion-recur-options {
    grid-template-columns: minmax(0, 1fr);
  }
}

.modal--plate-select {
  width: min(980px, 96vw);
  max-height: 92vh;
  overflow: hidden;
}

.modal--plate-select .modal__body {
  overflow: auto;
  min-height: 0;
}

.modal--plate-select .modal__footer {
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 16px;
  overflow: hidden;
}

.modal--plate-select .modal__footer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 118px;
  min-height: 38px;
  padding: 8px 14px;
  line-height: 1.2;
  border-width: 2px;
  border-style: solid;
  border-color: rgba(148, 163, 184, 0.55);
  box-shadow: none;
}

.modal--plate-select .modal__footer button.is-hidden {
  display: none !important;
}

.modal--plate-select .modal__footer button:hover {
  transform: none;
}

.modal--plate-select .modal__footer [data-plate-select-close] {
  border-color: rgba(148, 163, 184, 0.62);
}

.modal--plate-select .modal__footer [data-plate-select-proceed] {
  border-color: rgba(34, 211, 238, 0.7);
  color: #cffafe;
}

.plate-select-copy {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

.plate-group-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plate-group-panel__title {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.plate-group-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.plate-group-list__empty {
  font-size: 12px;
  color: var(--muted);
}

.plate-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
  padding: 5px 10px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.plate-group-chip__dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--plate-group-color, #22d3ee);
  flex: 0 0 auto;
}

.plate-group-chip__name {
  font-weight: 700;
  color: #e2e8f0;
}

.plate-group-chip__wells {
  color: #94a3b8;
}

.plate-group-chip.is-active {
  border-color: var(--plate-group-color, #22d3ee);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 0 0 1px var(--plate-group-color, #22d3ee);
}

.plate-select-grid {
  display: grid;
  width: min(100%, 760px);
  margin: 0 auto;
  padding: clamp(14px, 2.2vw, 22px);
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(8, 16, 30, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 0 6px rgba(148, 163, 184, 0.08),
    0 14px 30px rgba(0, 0, 0, 0.35);
  gap: clamp(8px, 1.8vw, 12px);
  align-items: center;
  justify-items: center;
  position: relative;
  touch-action: none;
}

.plate-select-grid.is-dense {
  width: min(100%, 820px);
  padding: 12px;
  gap: 6px;
}

.plate-select-grid.is-ultra-dense {
  width: min(100%, 920px);
  padding: 10px;
  gap: 2px;
  border-radius: 16px;
}

.plate-select-grid.is-plate-384 {
  width: min(100%, 900px);
  padding: 10px;
  gap: 3px;
}

.plate-select-grid.is-plate-1536 {
  width: min(100%, 940px);
  padding: 8px;
  gap: 1px;
  border-radius: 14px;
}

.plate-select-grid::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  pointer-events: none;
}

.plate-select-marquee {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  border: 1px dashed rgba(94, 234, 212, 0.95);
  background: rgba(94, 234, 212, 0.2);
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.2);
  pointer-events: none;
  z-index: 8;
}

.plate-select-cell {
  width: 88%;
  height: 88%;
  min-width: 34px;
  min-height: 34px;
  max-width: 110px;
  max-height: 110px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.52);
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.03) 58%),
    rgba(15, 23, 42, 0.92);
  color: #dbeafe;
  font-size: clamp(11px, 1.8vw, 14px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  cursor: cell;
  box-shadow:
    inset 0 -3px 6px rgba(0, 0, 0, 0.35),
    inset 0 1px 2px rgba(255, 255, 255, 0.08);
}

.plate-select-cell.has-group {
  border-color: var(--well-group-color, rgba(148, 163, 184, 0.52));
  box-shadow:
    inset 0 0 0 1px var(--well-group-color, rgba(148, 163, 184, 0.52)),
    inset 0 -3px 6px rgba(0, 0, 0, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.08);
}

.plate-select-grid.is-dragging .plate-select-cell {
  cursor: grabbing;
}

.plate-select-cell:hover {
  transform: none;
  border-color: rgba(94, 234, 212, 0.75);
  background:
    radial-gradient(circle at 35% 30%, rgba(94, 234, 212, 0.36), rgba(94, 234, 212, 0.1) 58%),
    rgba(15, 23, 42, 0.95);
}

.plate-select-cell.is-selected {
  border-color: var(--well-selected-color, rgba(94, 234, 212, 0.85));
  background:
    radial-gradient(
      circle at 35% 30%,
      var(--well-selected-strong, rgba(94, 234, 212, 0.55)),
      var(--well-selected-soft, rgba(94, 234, 212, 0.2)) 62%
    ),
    rgba(15, 23, 42, 0.98);
  color: #d1fae5;
  box-shadow:
    inset 0 0 0 1px var(--well-selected-outline, rgba(94, 234, 212, 0.45)),
    0 0 0 1px var(--well-selected-ring, rgba(94, 234, 212, 0.25));
}

.plate-select-grid.is-medium .plate-select-cell {
  max-width: 88px;
  max-height: 88px;
}

.plate-select-grid.is-dense .plate-select-cell {
  min-width: 20px;
  min-height: 20px;
  max-width: 42px;
  max-height: 42px;
  font-size: clamp(9px, 1.05vw, 11px);
}

.plate-select-grid.is-ultra-dense .plate-select-cell {
  width: 100%;
  height: 100%;
  min-width: 14px;
  min-height: 14px;
  max-width: none;
  max-height: none;
  border-radius: 999px;
  font-size: 7px;
  line-height: 1;
  padding: 0;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.25);
}

.plate-select-grid.is-ultra-dense .plate-select-cell.is-selected {
  border-color: var(--well-selected-color, rgba(94, 234, 212, 0.95));
  box-shadow:
    inset 0 0 0 1px var(--well-selected-outline, rgba(94, 234, 212, 0.55)),
    0 0 0 1px var(--well-selected-ring, rgba(94, 234, 212, 0.28));
}

.plate-select-grid.is-plate-384 .plate-select-cell {
  min-width: 20px;
  min-height: 20px;
  font-size: 8px;
  border-radius: 999px;
}

.plate-select-grid.is-plate-1536 .plate-select-cell {
  min-width: 14px;
  min-height: 14px;
  font-size: 6px;
  border-radius: 3px;
  background: rgba(15, 23, 42, 0.96);
}

.plate-select-info {
  font-size: 12px;
  color: var(--muted);
}

[data-plate-select-create] {
  border-color: rgba(16, 185, 129, 0.5);
  color: #d1fae5;
}

[data-plate-select-unbind] {
  border-color: rgba(244, 63, 94, 0.5);
  color: #fecdd3;
}

[data-plate-select-rename] {
  border-color: rgba(245, 158, 11, 0.52);
  color: #fef3c7;
}

.modal__close-btn {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
}

.modal__close-btn:hover {
  transform: none;
}

.start-modal__label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.start-datetime-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.start-date-wrap,
.start-time-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  position: relative;
}

.start-modal-input {
  width: 100%;
  min-width: 0;
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}

.start-date-picker-btn,
.start-time-picker-btn {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.start-date-picker-btn svg,
.start-time-picker-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.start-date-picker-btn:hover,
.start-time-picker-btn:hover {
  transform: none;
}

.start-date-proxy {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  border: 0;
  padding: 0;
}

.start-modal__hint {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.start-modal__note {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* Clocklet overrides for the start modal analog picker */
.clocklet.clocklet-start {
  font-family: "Segoe UI", "Avenir Next", sans-serif;
  font-variant-numeric: tabular-nums;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: #0b1220;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  color: #dbeafe;
}

.clocklet.clocklet-start .clocklet-plate {
  background: rgba(255, 255, 255, 0.04);
}

.clocklet.clocklet-start .clocklet-tick,
.clocklet.clocklet-start .clocklet-ampm {
  min-width: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  border-radius: 999px;
}

.clocklet.clocklet-start .clocklet-tick {
  background: transparent;
  color: #dbeafe;
}

.clocklet.clocklet-start .clocklet-tick--hour {
  font-size: 12px;
}

.clocklet.clocklet-start .clocklet-tick--minute {
  font-size: 11px;
}

.clocklet.clocklet-start .clocklet-tick--minute:not([data-clocklet-tick-value$="0"]):not([data-clocklet-tick-value$="5"]):before {
  content: "";
}

.clocklet.clocklet-start button:hover {
  transform: none;
  border-color: transparent;
}

.clocklet.clocklet-start .clocklet-hand {
  background-color: #5eead4;
}

.clocklet.clocklet-start .clocklet-hand-origin {
  background-color: #5eead4;
}

.clocklet.clocklet-start .clocklet-tick--selected {
  background-color: rgba(94, 234, 212, 0.28);
  color: #d1fae5;
}

.clocklet.clocklet-start.clocklet--hoverable:not(.clocklet--dragging) .clocklet-tick:hover {
  background-color: rgba(94, 234, 212, 0.18);
}

.clocklet.clocklet-start .clocklet-ampm {
  background-color: rgba(255, 255, 255, 0.08);
}

.clocklet.clocklet-start .clocklet-ampm:before {
  background-color: rgba(94, 234, 212, 0.34);
  color: #d1fae5;
}

@media (max-width: 560px) {
  .start-datetime-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.field {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.field--stacked {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.field--stacked input[type="text"] {
  min-width: 0;
  width: 100%;
}

.media-type-field {
  gap: 8px;
}

.media-type-preset-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.media-type-preset-row select {
  flex: 1;
  min-width: 190px;
}

.media-type-preset-row button {
  white-space: nowrap;
}

.media-type-note {
  font-size: 11px;
  color: var(--muted);
}

.field label {
  font-size: 13px;
  color: var(--muted);
}

.field input[type="text"],
.field input[type="number"] {
  flex: 1;
  min-width: 140px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

input[type="date"]:not(.start-date-proxy),
input[type="time"] {
  color-scheme: dark;
  -webkit-appearance: none;
  appearance: none;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  caret-color: #5eead4;
}

input[type="date"]:not(.start-date-proxy):focus,
input[type="time"]:focus {
  outline: none;
  border-color: rgba(94, 234, 212, 0.62);
  box-shadow: 0 0 0 2px rgba(94, 234, 212, 0.18);
}

input[type="date"]:not(.start-date-proxy)::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.92;
  filter: invert(87%) sepia(26%) saturate(444%) hue-rotate(114deg) brightness(102%) contrast(95%);
}

input[type="date"]:not(.start-date-proxy)::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value {
  text-align: left;
}

input[type="date"]:not(.start-date-proxy)::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit {
  color: var(--text);
}

input[type="date"]:not(.start-date-proxy)::-webkit-datetime-edit-fields-wrapper,
input[type="time"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

.field input[type="text"] {
  flex: 2;
  min-width: 200px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.field input[type="number"] {
  max-width: 120px;
}

.field input:disabled {
  opacity: 0.6;
}

.field select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

#plateGroupControls select,
#plateGroupControls input[type="date"],
#plateGroupControls input[type="time"] {
  min-width: 110px;
}

.modal-backdrop:not(.media-modal--plate) #plateGroupControls {
  display: none !important;
}

.plan-steps {
  list-style: decimal;
  margin: 0 0 4px 18px;
  padding: 0;
  color: var(--text);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plan-step {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.pill {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(94, 234, 212, 0.14);
  border: 1px solid rgba(94, 234, 212, 0.4);
  color: #cffafe;
  font-size: 12px;
}

.plan-step button {
  padding: 4px 8px;
  font-size: 11px;
}

.form-status {
  min-height: 16px;
  font-size: 12px;
  margin: -6px 0 8px;
  color: #fca5a5;
}

.template-manager {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.template-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.template-row__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.template-row__info strong {
  font-size: 13px;
}

.template-row__info span {
  font-size: 12px;
  color: var(--muted);
}

.template-row button {
  padding: 6px 10px;
  font-size: 12px;
}

.template-row--empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.plan-timeline {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 12px 26px;
  background: rgba(255, 255, 255, 0.03);
  min-height: 190px;
  overflow-x: scroll;
  overflow-y: visible;
  white-space: nowrap;
  scrollbar-gutter: stable both-edges;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.plan-timeline::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.timeline-scrollbar {
  margin-top: 6px;
  height: 10px;
  width: 100%;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  position: relative;
  display: none;
}

.timeline-scrollbar__thumb {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(94, 234, 212, 0.8), rgba(59, 130, 246, 0.8));
  cursor: grab;
  min-width: 32px;
}

.timeline-scrollbar.is-visible {
  display: block;
}

.log-panel {
  position: fixed;
  top: 90px;
  right: 2px;
  width: 280px;
  max-width: 320px;
  min-width: 240px;
  height: calc(100vh - 110px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  overflow: hidden;
  z-index: 20;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  transition: transform 180ms ease, opacity 180ms ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
}

.log-header__title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #dbeafe;
}

.log-filter {
  display: flex;
  align-items: center;
  gap: 6px;
}

.log-filter__label {
  font-size: 12px;
  color: var(--muted);
}

.log-filter__select {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.log-filter__select:focus-visible {
  outline: 2px solid rgba(94, 234, 212, 0.75);
  outline-offset: 1px;
}

@keyframes animalFilterPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.62);
    border-color: rgba(45, 212, 191, 0.75);
  }
  60% {
    box-shadow: 0 0 0 8px rgba(45, 212, 191, 0);
    border-color: rgba(34, 197, 94, 0.82);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(45, 212, 191, 0);
    border-color: rgba(45, 212, 191, 0.75);
  }
}

.housing-animal.is-filter-match {
  background: rgba(16, 185, 129, 0.28);
  animation: animalFilterPulse 1.2s ease-in-out infinite;
}

.housing-animal.is-filter-dim {
  opacity: 0.38;
  filter: saturate(0.45);
}

.log-toggle {
  width: 100%;
  margin-bottom: 8px;
}

.log-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  min-height: 0;
  padding-right: 2px;
}

.log-panel.is-collapsed {
  transform: translateX(calc(100% + 14px));
  opacity: 0.98;
}

.log-panel.is-collapsed .log-header__title,
.log-panel.is-collapsed .log-filter,
.log-panel.is-collapsed .animal-filter-toolbar,
.log-panel.is-collapsed .log-body {
  display: none;
}

.log-panel.is-collapsed .log-header {
  justify-content: flex-start;
}

.task-toast {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translate(-50%, -20px);
  background: rgba(239, 68, 68, 0.92);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 50;
}

.task-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.connection-protocol-icon {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(94, 234, 212, 0.65);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.95));
  color: #99f6e4;
  font-size: 12px;
  font-weight: 700;
  z-index: 9;
  box-shadow: 0 8px 16px rgba(2, 6, 23, 0.45);
}

.connection-protocol-icon:hover {
  border-color: rgba(45, 212, 191, 0.95);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(13, 148, 136, 0.3));
}

.connection-protocol-icon.is-complete {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.65);
}

.connection-protocol-tasks {
  position: absolute;
  width: 280px;
  max-height: 360px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.94);
  box-shadow: 0 18px 34px rgba(2, 6, 23, 0.5);
  z-index: 8;
}

.connection-protocol-tasks__header {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0;
  padding: 10px 12px;
  background: rgba(30, 41, 59, 0.74);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
}

.connection-protocol-tasks__body {
  max-height: 300px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.connection-protocol-task-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 8px;
  align-items: start;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.52);
  padding: 8px;
}

.connection-protocol-task-row.is-done {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(22, 101, 52, 0.28);
}

.connection-protocol-task-row input[type="checkbox"] {
  margin-top: 2px;
}

.connection-protocol-task-row__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.connection-protocol-task-row__title {
  font-size: 12px;
  color: #e2e8f0;
}

.connection-protocol-task-row__detail {
  font-size: 11px;
  color: #94a3b8;
}

.connection-protocol-task-row__assign {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
}

.modal--protocol-builder {
  width: min(1320px, 98vw);
  max-height: 94vh;
  overflow: hidden;
}

.protocol-builder {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 240px;
  gap: 12px;
  min-height: 600px;
  max-height: 72vh;
}

.protocol-builder__library,
.protocol-builder__tasks {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.5);
  padding: 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.protocol-builder__library h4,
.protocol-builder__tasks h4 {
  margin: 0;
  font-size: 13px;
}

.protocol-builder__library p,
.protocol-builder__tasks p {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 11px;
}

.protocol-builder__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.protocol-builder__legend-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  letter-spacing: 0.02em;
}

.protocol-builder__legend-chip--drag {
  border: 1px dashed rgba(45, 212, 191, 0.72);
  color: #99f6e4;
  background: rgba(45, 212, 191, 0.14);
}

.protocol-builder__legend-chip--text {
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: #dbeafe;
  background: rgba(30, 41, 59, 0.46);
}

.protocol-step-library {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 0;
}

.protocol-step-library__item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 10px;
  font-size: 12px;
  cursor: grab;
  border: 1px dashed rgba(45, 212, 191, 0.48);
  background: rgba(15, 23, 42, 0.55);
}

.protocol-step-library__item:active {
  cursor: grabbing;
}

.protocol-step-library__item::after {
  content: "DRAG";
  margin-left: auto;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: #99f6e4;
  opacity: 0.86;
}

.protocol-step-library__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.42);
  color: #cbd5e1;
  background: rgba(2, 6, 23, 0.45);
  font-size: 10px;
  font-weight: 700;
}

.protocol-builder__workspace {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.protocol-builder__toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.protocol-builder__template-field select,
.protocol-builder__template-save-field input,
#protocolBuilderName {
  width: 100%;
}

.protocol-builder__template-actions {
  margin-top: 6px;
  display: flex;
  gap: 6px;
}

.protocol-builder__template-actions button,
.protocol-builder__template-save-field button {
  padding: 6px 8px;
  font-size: 11px;
}

.protocol-builder__toolbar-actions {
  display: flex;
  justify-content: flex-end;
}

.protocol-builder__toolbar-actions button {
  white-space: nowrap;
}

.protocol-builder__usage-note {
  border: 1px solid rgba(45, 212, 191, 0.24);
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 11px;
  color: #bae6fd;
  background: rgba(30, 41, 59, 0.45);
}

.protocol-canvas-wrap {
  flex: 1;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  overflow: hidden;
  min-height: 0;
  background: radial-gradient(circle at 15% 15%, rgba(94, 234, 212, 0.08), transparent 35%), rgba(2, 6, 23, 0.6);
  display: flex;
  flex-direction: column;
}

.protocol-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 460px;
  overflow: scroll;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin;
  scrollbar-color: rgba(94, 234, 212, 0.62) rgba(15, 23, 42, 0.7);
}

.protocol-canvas::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.protocol-canvas::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.65);
}

.protocol-canvas::-webkit-scrollbar-thumb {
  background: rgba(94, 234, 212, 0.58);
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.65);
}

.protocol-canvas::-webkit-scrollbar-corner {
  background: rgba(15, 23, 42, 0.65);
}

.protocol-canvas__surface {
  position: relative;
  min-width: 100%;
  min-height: 100%;
}

.protocol-canvas__scrollx {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.72);
}

.protocol-canvas__scrollx-label {
  font-size: 10px;
  color: #94a3b8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-width: 98px;
}

.protocol-canvas__scrollx input[type="range"] {
  width: 100%;
}

.protocol-canvas__scrollx.is-disabled {
  opacity: 0.6;
}

.protocol-canvas__links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  color: #5eead4;
}

.protocol-canvas__links .protocol-flow-link {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1px;
  opacity: 0.95;
}

.protocol-canvas__links .protocol-flow-link-temp {
  stroke: rgba(148, 163, 184, 0.8);
  stroke-width: 2px;
  stroke-dasharray: 5 5;
}

.protocol-canvas__link-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.protocol-link-label {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: auto;
}

.protocol-link-label input {
  width: 130px;
  padding: 4px 6px;
  font-size: 11px;
}

.protocol-link-label button {
  width: 22px;
  min-width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 7px;
}

.protocol-canvas__empty {
  position: absolute;
  left: 16px;
  top: 14px;
  color: #94a3b8;
  font-size: 12px;
}

.protocol-step-node {
  position: absolute;
  width: 190px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.86));
  padding: 8px;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.45);
}

.protocol-endpoint-node {
  position: absolute;
  width: 190px;
  min-height: 64px;
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.52);
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.82));
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.36);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
}

.protocol-endpoint-node--start {
  border-color: rgba(34, 211, 238, 0.72);
}

.protocol-endpoint-node--end {
  border-color: rgba(96, 165, 250, 0.72);
}

.protocol-endpoint-node__icon {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.64);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.protocol-endpoint-node__icon .lab-icon {
  width: 38px;
  height: 38px;
}

.protocol-endpoint-node__text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.protocol-endpoint-node__badge {
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.protocol-endpoint-node__label {
  font-size: 11px;
  color: #dbeafe;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
}

.protocol-step-node__mode-hint {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.protocol-step-node__mode-hint span {
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 9px;
  letter-spacing: 0.03em;
}

.protocol-step-node__mode-hint .mode-drag {
  color: #99f6e4;
  border: 1px dashed rgba(45, 212, 191, 0.62);
  background: rgba(45, 212, 191, 0.12);
}

.protocol-step-node__mode-hint .mode-text {
  color: #dbeafe;
  border: 1px solid rgba(148, 163, 184, 0.48);
  background: rgba(30, 41, 59, 0.46);
}

.protocol-step-node__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  cursor: grab;
}

.protocol-step-node__type {
  font-size: 11px;
  font-weight: 600;
  color: #7dd3fc;
}

.protocol-step-node__remove {
  width: 20px;
  min-width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
}

.protocol-step-node__title,
.protocol-step-node__notes,
.protocol-step-node__field input,
.protocol-step-node__field select {
  width: 100%;
}

.protocol-step-node__title {
  margin-bottom: 6px;
  padding: 5px 6px;
  font-size: 12px;
}

.protocol-step-node__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.protocol-step-node__field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.protocol-step-node__field span {
  font-size: 10px;
  color: #94a3b8;
}

.protocol-step-node__field input,
.protocol-step-node__field select {
  padding: 4px 6px;
  font-size: 11px;
}

.protocol-step-node__task {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 6px;
  font-size: 11px;
  color: #cbd5e1;
}

.protocol-step-node__notes-label {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  color: #94a3b8;
}

.protocol-step-node__notes {
  min-height: 44px;
  resize: vertical;
  font-size: 11px;
  padding: 5px 6px;
}

.protocol-step-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(94, 234, 212, 0.75);
  background: rgba(15, 23, 42, 0.95);
  padding: 0;
}

.protocol-step-handle--in {
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
}

.protocol-step-handle--out {
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
}

.protocol-step-handle--endpoint-in {
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
}

.protocol-step-handle--endpoint-out {
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
}

.protocol-task-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 0;
}

.protocol-task-preview__empty {
  color: #94a3b8;
  font-size: 11px;
}

.protocol-task-preview__row {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.protocol-task-preview__row strong {
  font-size: 12px;
  color: #e2e8f0;
}

.protocol-task-preview__row span {
  font-size: 11px;
  color: #94a3b8;
}

.table-list {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
}

.simple-table {
  width: 100%;
  border-collapse: collapse;
}

.simple-table th,
.simple-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  text-align: left;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.field-grid input {
  width: 100%;
}

.modal--media-formulation {
  width: min(980px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  border-color: rgba(94, 234, 212, 0.32);
  box-shadow:
    0 24px 58px rgba(2, 6, 23, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.modal--media-formulation .modal__header {
  align-items: flex-start;
  gap: 14px;
  background: linear-gradient(180deg, rgba(94, 234, 212, 0.08), rgba(59, 130, 246, 0.04));
}

.mf-header-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mf-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.modal--media-formulation .modal__body {
  padding: 16px;
  gap: 14px;
  overflow: auto;
  min-height: 0;
}

.modal--media-formulation input[type="text"],
.modal--media-formulation select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
}

.modal--media-formulation input[type="text"]::placeholder {
  color: rgba(156, 163, 175, 0.88);
}

.modal--media-formulation input[type="text"]:focus,
.modal--media-formulation select:focus {
  outline: none;
  border-color: rgba(94, 234, 212, 0.6);
  box-shadow: 0 0 0 2px rgba(94, 234, 212, 0.18);
}

.modal--media-formulation select option {
  background: #0b1220;
  color: var(--text);
}

.modal--media-formulation .modal__footer.mf-footer {
  display: flex;
  justify-content: flex-end;
}

.field-grid--mf {
  grid-template-columns: minmax(0, 1fr);
}

.mf-builder {
  border: 1px solid rgba(94, 234, 212, 0.22);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.45);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mf-components {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mf-builder__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal--media-formulation [data-mc-add] {
  border-color: rgba(94, 234, 212, 0.45);
  color: #cffafe;
}

.modal--media-formulation [data-mc-add]:hover {
  background: rgba(94, 234, 212, 0.14);
  border-color: rgba(94, 234, 212, 0.72);
}

.modal--media-formulation [data-mc-save] {
  border-color: rgba(16, 185, 129, 0.56);
  color: #d1fae5;
}

.modal--media-formulation [data-mc-save]:hover {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.8);
}

.modal--media-formulation .modal__close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(94, 234, 212, 0.45);
}

.mf-library {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mf-library__heading {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mf-library__list {
  max-height: 260px;
  overflow: auto;
}

.mf-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 8px;
}

.mf-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.mf-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) minmax(160px, 1.2fr) minmax(120px, 1fr) minmax(140px, 1.2fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.mf-row input,
.mf-row select {
  width: 100%;
}

.mf-row .mf-comp-del {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  border-color: rgba(244, 63, 94, 0.5);
  color: #fecdd3;
}

.mf-card {
  border: 1px solid rgba(94, 234, 212, 0.22);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.mf-card strong {
  font-size: 13px;
}

.mf-card ul {
  margin: 6px 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: #dbeafe;
  font-size: 12px;
}

@media (max-width: 900px) {
  .mf-row {
    grid-template-columns: 1fr 1fr;
  }

  .protocol-builder {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .protocol-builder__toolbar {
    grid-template-columns: 1fr;
  }

  .protocol-canvas {
    min-height: 380px;
  }
}

.pill-btn {
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
}

.pill-btn--danger {
  border-color: rgba(239, 68, 68, 0.8);
  color: #fecdd3;
}

.aliquot-list {
  padding: 6px 0 0 0;
}

.aliquot-list ul {
  margin: 4px 0 0 14px;
  padding: 0;
  color: var(--text);
  font-size: 12px;
}

.modal .pill-btn {
  margin: 0 2px;
}

.sb-grid {
  display: grid;
  grid-template-columns: repeat(var(--sb-cols, 9), 42px);
  gap: 8px;
  justify-content: center;
  padding: 12px 0;
}

.sb-grid--round .sb-cell {
  border-radius: 50%;
}

.sb-cell {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(94, 234, 212, 0.45);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(94, 234, 212, 0.22), rgba(255, 255, 255, 0.02));
  color: #e5e7eb;
  font-size: 11px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.sb-cell:hover {
  transform: translateY(-2px);
  border-color: rgba(252, 211, 77, 0.8);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.32);
}

.sb-cell--preview {
  border-style: dashed;
  border-color: rgba(252, 211, 77, 0.8);
  background: rgba(252, 211, 77, 0.12);
}

.sb-cell__index {
  font-size: 10px;
  opacity: 0.7;
  line-height: 1;
  pointer-events: none;
}

.sb-cell__content {
  font-weight: 600;
  font-size: 9px;
  line-height: 1;
  pointer-events: none;
  display: block;
}

.log-row {
  font-size: 12px;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.log-row.is-done {
  opacity: 0.65;
  text-decoration: line-through;
}

.log-row--pulse {
  animation: pulse-fast-bg 0.45s ease-in-out infinite;
  border-color: rgba(252, 211, 77, 0.9);
  box-shadow: 0 0 0 3px rgba(252, 211, 77, 0.55);
  background: rgba(252, 211, 77, 0.14);
  color: #0b0f1a;
}

.log-section-title {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 10px 0 4px;
}

.log-edge-toggle {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 30px;
  height: 68px;
  border-radius: 12px 0 0 12px;
  border: 1px solid rgba(94, 234, 212, 0.6);
  border-right: none;
  background: linear-gradient(180deg, rgba(94, 234, 212, 0.28), rgba(34, 197, 94, 0.16));
  color: #bbf7d0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 26;
  box-shadow: 0 10px 24px rgba(3, 7, 18, 0.45);
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.log-edge-toggle:hover {
  transform: translateY(-50%);
  background: linear-gradient(180deg, rgba(94, 234, 212, 0.35), rgba(34, 197, 94, 0.22));
  color: #ecfeff;
  border-color: rgba(94, 234, 212, 0.85);
  box-shadow: 0 10px 24px rgba(3, 7, 18, 0.45);
}

.log-edge-toggle:focus-visible {
  transform: translateY(-50%);
  outline: 2px solid rgba(94, 234, 212, 0.9);
  outline-offset: 2px;
}

.log-edge-toggle.is-collapsed {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.26), rgba(56, 189, 248, 0.18));
  color: #dbeafe;
  border-color: rgba(147, 197, 253, 0.7);
}

.log-edge-toggle__icon {
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
}

.fishbone-svg {
  height: auto;
  min-height: 180px;
  display: block;
}

.fishbone-axis {
  font-size: 11px;
  fill: var(--muted);
}

.fishbone-label {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  font-size: 11px;
  line-height: 1.3;
  color: var(--text);
  max-width: 220px;
  white-space: normal;
  word-break: break-word;
  pointer-events: none;
  text-align: center;
}

.fishbone-label strong {
  display: block;
  color: #a5f3fc;
  margin-bottom: 2px;
  font-weight: 700;
}

.fishbone-delta {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: #fca5a5;
}

.fishbone-label.is-done,
.additive-label.is-done {
  color: var(--muted);
  opacity: 0.65;
}

.fishbone-label.is-done .fishbone-delta,
.additive-label.is-done .fishbone-delta {
  text-decoration: none;
  opacity: 1;
  color: #fca5a5;
}

.fishbone-svg .is-done {
  stroke: var(--muted) !important;
  fill: var(--muted) !important;
}

.timeline-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.additive-form {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.additive-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.additive-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fecdd3;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.additive-label {
  position: absolute;
  transform: translate(-50%, 0);
  font-size: 11px;
  color: #fecdd3;
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 4px 8px;
  border-radius: 8px;
  pointer-events: none;
  white-space: normal;
  word-break: break-word;
  max-width: 190px;
  text-align: center;
}

.modal__footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.drop--selected {
  border-color: rgba(94, 234, 212, 0.9);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.18), 0 12px 26px rgba(0, 0, 0, 0.35);
}

.drop--selected.drop--overdue-alert {
  animation: vessel-overdue-flash-selected 1.15s ease-in-out infinite;
}

@keyframes vessel-overdue-flash-selected {
  0% {
    border-color: rgba(94, 234, 212, 0.9);
    box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.18), 0 12px 26px rgba(0, 0, 0, 0.35);
  }
  50% {
    border-color: rgba(239, 68, 68, 0.92);
    box-shadow:
      0 0 0 3px rgba(94, 234, 212, 0.2),
      0 0 0 6px rgba(239, 68, 68, 0.48),
      0 0 16px rgba(239, 68, 68, 0.3),
      0 12px 26px rgba(0, 0, 0, 0.35);
  }
  100% {
    border-color: rgba(94, 234, 212, 0.9);
    box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.18), 0 12px 26px rgba(0, 0, 0, 0.35);
  }
}

.handle {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  opacity: 0;
  --tx: -50%;
  --ty: -50%;
  transition: opacity 120ms ease, transform 120ms ease;
  pointer-events: auto;
  cursor: crosshair;
  transform: translate(var(--tx), var(--ty)) scale(0.85);
}

.drop:hover .handle,
.drop:focus-within .handle,
.canvas--linking .handle {
  opacity: 1;
  transform: translate(var(--tx), var(--ty)) scale(1);
}

.handle--top {
  top: 0;
  left: 50%;
  --tx: -50%;
  --ty: calc(-50% - var(--handle-offset));
}

.handle--bottom {
  bottom: 0;
  left: 50%;
  --tx: -50%;
  --ty: calc(50% + var(--handle-offset));
}

.handle--left {
  left: 0;
  top: 50%;
  --tx: calc(-50% - var(--handle-offset));
  --ty: -50%;
}

.handle--right {
  right: 0;
  top: 50%;
  --tx: calc(50% + var(--handle-offset));
  --ty: -50%;
}

@media (max-width: 840px) {
  .page {
    grid-template-columns: 1fr;
  }

  .palette {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    min-height: 60vh;
  }
}
