:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #182033;
  --muted: #677188;
  --line: #d8deea;
  --accent: #135d66;
  --accent-dark: #0c4147;
  --danger: #a3333d;
  --shadow: 0 18px 45px rgba(24, 32, 51, 0.12);
  --yellow: #fff200;
  --orange: #ff7a1a;
  --blue: #78d3f8;
  --purple: #8b0b87;
  --pink: #ff8bc8;
  --green: #76d672;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  text-decoration: none;
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

button:hover,
.button:hover {
  background: var(--accent-dark);
}

button:active,
.button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.secondary {
  background: #eef3f8;
  color: var(--ink);
}

.secondary:hover {
  background: #dce7f1;
}

.danger {
  background: #f8e8ea;
  color: var(--danger);
}

.danger:hover {
  background: #efd3d7;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  padding: 6px 12px;
}

.topbar > div:first-child {
  display: none;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1.05;
  margin-bottom: 0;
}

h2 {
  font-size: 0.98rem;
  margin-bottom: 14px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.topbar-actions button,
.topbar-actions .button {
  min-height: 32px;
  padding: 0 12px;
}

.file-control {
  position: relative;
  overflow: hidden;
}

.file-control input {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.workspace {
  display: grid;
  gap: 12px;
  grid-template-rows: auto 1fr;
  min-height: 0;
  padding: 12px;
}

.create-panel,
.map-shell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: 0;
}

.create-panel {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
  padding: 10px 12px;
}

.create-panel > div:first-child {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
}

.create-panel h2 {
  align-self: center;
  font-size: 0.82rem;
  margin: 0;
  white-space: nowrap;
}

.create-form {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  min-width: 0;
}

.create-form label:first-child,
.create-form label:nth-child(4),
.create-form label:nth-child(7) {
  min-width: 170px;
}

.create-form button {
  align-self: end;
  min-width: 136px;
}

.create-form textarea {
  height: 32px;
  min-height: 32px;
  overflow: hidden;
  resize: none;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 0.72rem;
  font-weight: 700;
  gap: 3px;
}

input,
select,
textarea {
  background: #fbfcff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 32px;
  padding: 6px 8px;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
.map-canvas:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(19, 93, 102, 0.18);
}

.tool-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(6, minmax(72px, auto));
}

.tools-panel {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
}

.tools-panel .hint {
  display: none;
}

.create-panel button,
.create-panel .button {
  min-height: 32px;
  padding: 0 10px;
}

.tool {
  background: #eef3f8;
  color: var(--ink);
}

.tool.active {
  background: var(--accent);
  color: #fff;
}

.hint,
.muted {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 12px 0 0;
}

.details-grid {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.details-grid input,
.details-grid select,
.details-grid textarea {
  width: 100%;
}

.dependency-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.dependency-row {
  align-items: center;
  background: #f6f8fb;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 34px;
  min-width: 0;
  padding: 6px 8px;
}

.dependency-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dependency-row button {
  background: transparent;
  color: var(--danger);
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 8px;
}

.map-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.map-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.map-body.details-open {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.map-toolbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 7px 10px;
}

.map-title-group {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  min-width: 240px;
}

.map-title-label {
  display: block;
  font-size: 0;
  min-width: min(280px, 100%);
}

.map-title-input {
  background: transparent;
  border-color: transparent;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
  min-height: 26px;
  padding: 2px 0;
}

.map-title-input:focus {
  background: #fbfcff;
  border-color: var(--accent);
  padding: 2px 6px;
}

.map-toolbar > div:last-child {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

#mapMeta {
  color: var(--muted);
  display: inline-block;
  font-size: 0.78rem;
  margin-bottom: 0;
  white-space: nowrap;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.legend span {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.72rem;
  gap: 4px;
}

.swatch {
  border: 1px solid #111827;
  display: inline-block;
  height: 11px;
  width: 11px;
}

.swatch.yellow {
  background: var(--yellow);
}

.swatch.orange {
  background: var(--orange);
}

.swatch.blue {
  background: var(--blue);
}

.swatch.purple {
  background: var(--purple);
}

.swatch.pink {
  background: var(--pink);
}

.swatch.green {
  background: var(--green);
}

.zoom-controls {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  max-width: 100%;
}

.zoom-controls .icon-button {
  font-weight: 800;
  min-height: 32px;
  min-width: 36px;
  padding: 0 10px;
}

.zoom-controls .zoom-label {
  font-size: 0.82rem;
  font-weight: 800;
  min-width: 62px;
}

.zoom-controls .fit-button {
  min-width: 48px;
}

.saved-views-select {
  background: #fbfcff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  min-height: 32px;
  max-width: 132px;
  padding: 0 24px 0 8px;
}

.saved-views-select:disabled {
  color: var(--muted);
  opacity: 0.72;
}

#mapNotesBtn.has-notes {
  background: #e8f3f1;
  box-shadow: inset 0 0 0 2px rgba(19, 93, 102, 0.22);
  color: var(--accent-dark);
}

.map-canvas {
  background:
    linear-gradient(#edf1f6 1px, transparent 1px),
    linear-gradient(90deg, #edf1f6 1px, transparent 1px),
    #ffffff;
  background-size: 36px 36px;
  border: 0;
  min-height: 560px;
  overflow: auto;
  position: relative;
}

.map-canvas {
  cursor: grab;
}

.map-canvas.panning {
  cursor: grabbing;
}

.map-content {
  height: 1400px;
  left: 0;
  min-height: 100%;
  min-width: 100%;
  position: absolute;
  top: 0;
  width: 1800px;
}

.map-world {
  height: 1400px;
  left: 0;
  position: absolute;
  top: 0;
  transform-origin: 0 0;
  width: 1800px;
}

.details-drawer {
  background: #ffffff;
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 28px rgba(24, 32, 51, 0.08);
  max-height: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px;
  width: 100%;
}

.details-drawer.empty {
  display: none;
}

.notes-overlay {
  align-items: center;
  background: rgba(24, 32, 51, 0.28);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 16px;
  position: fixed;
  z-index: 30;
}

.notes-overlay[hidden] {
  display: none;
}

.notes-dialog {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(24, 32, 51, 0.24);
  display: grid;
  gap: 12px;
  max-height: min(720px, calc(100vh - 32px));
  overflow: auto;
  padding: 14px;
  width: min(680px, 100%);
}

.notes-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.notes-header h2 {
  margin-bottom: 0;
}

.notes-dialog textarea {
  min-height: 150px;
  resize: vertical;
}

.deliverable-notes-dialog {
  max-height: min(820px, calc(100vh - 28px));
  width: min(980px, 100%);
}

.expanded-notes-input {
  font-size: 0.95rem;
  line-height: 1.45;
  height: min(780px, calc(100vh - 170px));
  min-height: min(780px, calc(100vh - 170px));
  resize: vertical;
}

.todos-dialog {
  width: min(760px, 100%);
}

.todo-form {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1fr) 136px auto;
}

.todo-form select[hidden] {
  display: none;
}

.todo-form:has(select[hidden]) {
  grid-template-columns: minmax(0, 1fr) 136px auto;
}

.todo-filter {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-size: 0.84rem;
  font-weight: 700;
  gap: 7px;
  justify-self: start;
}

.todos-list {
  display: grid;
  gap: 8px;
}

.todo-row {
  align-items: center;
  background: #f6f8fb;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 8px;
}

.todo-row label {
  align-items: start;
  color: var(--ink);
  display: grid;
  font-size: 0.9rem;
  font-weight: 600;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr);
}

.todo-row input {
  margin-top: 2px;
}

.todo-row span {
  display: grid;
  gap: 2px;
  overflow-wrap: anywhere;
}

.todo-row small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.todo-row.done span {
  color: var(--muted);
  text-decoration: line-through;
}

.todo-row button {
  background: transparent;
  color: var(--danger);
  min-height: 28px;
  padding: 0 8px;
}

.todo-group {
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 6px;
  padding: 8px;
}

.todo-group-title {
  background: transparent;
  color: var(--ink);
  display: grid;
  justify-content: stretch;
  min-height: 0;
  padding: 0;
  text-align: left;
}

.todo-group-title:hover {
  background: transparent;
}

.todo-group-title span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 2px;
}

.todo-group-heading {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

.todo-group-heading span {
  color: var(--muted);
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  margin-top: 2px;
}

.notes-expand-button {
  justify-self: start;
}

.reference-link-editor {
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) auto;
}

.reference-links-list {
  display: grid;
  gap: 7px;
}

.reference-link-row {
  align-items: center;
  background: #f6f8fb;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 8px;
}

.reference-link-row strong,
.reference-link-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-link-row span {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 2px;
}

.reference-link-row button {
  background: transparent;
  color: var(--danger);
  min-height: 28px;
  padding: 0 8px;
}

.drawer-header {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.drawer-header h2 {
  margin-bottom: 0;
}

.drawer-actions {
  display: grid;
  flex: 1 1 100%;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.drawer-actions .icon-button {
  min-width: 0;
  padding: 0 8px;
  white-space: normal;
}

.icon-button {
  background: #eef3f8;
  color: var(--ink);
  min-height: 30px;
  padding: 0 10px;
}

.context-menu {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(24, 32, 51, 0.2);
  display: grid;
  gap: 4px;
  min-width: 220px;
  padding: 8px;
  position: absolute;
  z-index: 10;
}

.context-menu[hidden] {
  display: none;
}

.context-menu button {
  background: transparent;
  border-radius: 5px;
  color: var(--ink);
  justify-content: flex-start;
  min-height: 34px;
  padding: 0 9px;
  text-align: left;
}

.context-menu button:hover {
  background: #eef3f8;
}

.context-menu .danger-item {
  color: var(--danger);
}

.menu-section {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
  margin-top: 4px;
  padding-top: 6px;
}

.menu-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0 9px 2px;
  text-transform: uppercase;
}

.menu-swatches {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(6, 1fr);
  padding: 0 4px;
}

.menu-swatches button {
  border: 1px solid #111827;
  border-radius: 3px;
  min-height: 26px;
  padding: 0;
}

.link-layer,
.node-layer {
  height: 1400px;
  left: 0;
  position: absolute;
  top: 0;
  width: 1800px;
}

.link-layer {
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}

.node-layer {
  z-index: 2;
}

.empty-state {
  color: var(--muted);
  left: 50%;
  max-width: 390px;
  pointer-events: none;
  position: absolute;
  text-align: center;
  top: 44%;
  transform: translate(-50%, -50%);
  z-index: 0;
}

.empty-state h2 {
  color: var(--ink);
  font-size: 1.2rem;
}

.deliverable {
  --node-color: var(--yellow);
  align-items: flex-start;
  background: var(--node-color);
  border: 2px solid #151515;
  border-radius: 2px;
  box-shadow: 0 7px 16px rgba(24, 32, 51, 0.13);
  color: #111;
  cursor: grab;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 92px;
  padding: 10px 11px;
  position: absolute;
  text-align: left;
  user-select: none;
  white-space: normal;
  width: 176px;
  transition: opacity 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.deliverable:active {
  cursor: grabbing;
}

.deliverable.selected {
  box-shadow: 0 0 0 5px rgba(19, 93, 102, 0.45), 0 9px 20px rgba(24, 32, 51, 0.2);
  z-index: 4;
}

.deliverable.predecessor {
  box-shadow: 0 0 0 4px rgba(163, 51, 61, 0.42), 0 7px 16px rgba(24, 32, 51, 0.13);
  z-index: 3;
}

.deliverable.successor {
  box-shadow: 0 0 0 4px rgba(28, 111, 76, 0.42), 0 7px 16px rgba(24, 32, 51, 0.13);
  z-index: 3;
}

.deliverable.unrelated {
  filter: saturate(0.55);
  opacity: 0.42;
}

.deliverable.due-alert {
  outline: 4px solid #c73524;
  outline-offset: 4px;
  filter: none;
  opacity: 1;
}

.due-alert-badge {
  background: #a82417;
  border-radius: 3px;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  margin-top: 7px;
  padding: 3px 6px;
}

#highlightDueBtn.active,
#dueDateLayoutBtn.active {
  background: #135d66;
  border-color: #135d66;
  color: #fff;
}

.date-bucket-layer {
  left: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
}

.date-bucket {
  background: rgba(238, 243, 248, 0.7);
  border: 1px solid #cbd5df;
  border-radius: 8px;
  padding: 14px 16px;
  position: absolute;
  top: 28px;
  width: 208px;
}

.date-bucket strong,
.date-bucket span {
  display: block;
  font-size: 0.78rem;
}

.date-bucket span {
  color: var(--muted);
  margin-top: 5px;
}

.deliverable.link-source {
  box-shadow: 0 0 0 4px rgba(163, 51, 61, 0.25), 0 7px 16px rgba(24, 32, 51, 0.13);
}

.deliverable.has-open-todos::after {
  background: #f2b705;
  border: 2px solid #111111;
  border-radius: 999px;
  content: "";
  height: 13px;
  position: absolute;
  right: 7px;
  top: 7px;
  width: 13px;
}

.deliverable[data-color="purple"] {
  color: #fff;
}

.deliverable-title {
  display: block;
  flex: 1;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
  width: 100%;
}

.deliverable-meta {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.15;
  margin-top: 8px;
  opacity: 0.72;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  width: 100%;
}

.status-pill {
  background: #ffffff;
  border: 1px solid #151515;
  border-radius: 999px;
  color: #111111;
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  margin-top: 7px;
  padding: 3px 7px;
}

.deliverable[data-status="in-work"] .status-pill {
  background: #1f8f5a;
  border-color: #176b43;
  color: #ffffff;
}

.deliverable[data-status="complete"] .status-pill {
  background: #1d6fd6;
  border-color: #15519d;
  color: #ffffff;
}

path.link,
path.link-backdrop {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

path.link-backdrop {
  opacity: 0.9;
  pointer-events: none;
  stroke: #ffffff;
  stroke-width: 7;
}

path.link-backdrop.highlighted {
  opacity: 1;
  stroke-width: 10;
}

path.link {
  stroke: #1a1a1a;
  stroke-width: 2.2;
  opacity: 0.86;
}

path.link.predecessor-link {
  stroke: #a3333d;
  stroke-width: 4.4;
  opacity: 1;
}

path.link.successor-link {
  stroke: #1c6f4c;
  stroke-width: 4.4;
  opacity: 1;
}

path.link.selected,
path.link.predecessor-link.successor-link {
  stroke: var(--accent);
  stroke-width: 4.8;
  opacity: 1;
}

path.link.unrelated {
  opacity: 0.18;
}

@media (max-width: 980px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .map-toolbar {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .topbar-actions,
  .legend,
  .map-toolbar > div:last-child {
    justify-content: flex-start;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .map-body {
    grid-template-columns: 1fr;
  }

  .map-body.details-open {
    grid-template-columns: 1fr;
  }

  .create-panel {
    grid-template-columns: 1fr;
  }

  .create-form {
    grid-template-columns: minmax(0, 1.4fr) minmax(110px, 0.6fr) minmax(0, 1fr);
  }

  .tools-panel {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .workspace {
    gap: 10px;
    padding: 10px;
  }

  .topbar {
    padding: 14px;
  }

  .map-toolbar {
    display: grid;
    gap: 4px 8px;
    grid-template-columns: minmax(0, 1fr);
    padding: 6px 8px;
  }

  .map-title-group {
    display: grid;
    gap: 0;
    min-width: 0;
  }

  .map-title-label {
    min-width: 0;
  }

  .map-title-input {
    width: 100%;
  }

  #mapMeta {
    font-size: 0.72rem;
  }

  .map-toolbar .legend {
    display: none;
  }

  .map-toolbar > div:last-child {
    justify-content: flex-start;
  }

  .zoom-controls {
    justify-content: flex-start;
  }

  .saved-views-select {
    max-width: 112px;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .create-panel {
    padding: 9px;
  }

  .create-panel > div:first-child {
    gap: 8px;
    grid-template-columns: 1fr;
  }

  .create-form {
    grid-template-columns: minmax(0, 1fr) minmax(96px, 0.55fr);
  }

  .create-form label:first-child,
  .create-form label:nth-child(3),
  .create-form label:nth-child(6) {
    grid-column: 1 / -1;
  }

  .create-form button {
    grid-column: 1 / -1;
  }

  .tools-panel {
    grid-template-columns: 1fr;
  }

  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reference-link-editor {
    grid-template-columns: 1fr;
  }

  .todo-form {
    grid-template-columns: 1fr;
  }

  .map-canvas {
    min-height: 500px;
  }
}
/* Online project library and owner login. */
.project-button {
  background: #1f6f78;
}

.save-status {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.74rem;
  font-weight: 700;
  min-height: 32px;
  padding: 0 4px;
}

.save-status::before {
  background: #9aa4b8;
  border-radius: 50%;
  content: "";
  height: 8px;
  margin-right: 6px;
  width: 8px;
}

.save-status[data-status="saved"]::before {
  background: #1f8f5a;
}

.save-status[data-status="saving"]::before,
.save-status[data-status="pending"]::before {
  background: #d18a16;
}

.save-status[data-status="error"] {
  color: var(--danger);
}

.save-status[data-status="error"]::before {
  background: var(--danger);
}

.projects-overlay {
  z-index: 80;
}

.projects-dialog {
  max-height: min(780px, 88vh);
  max-width: 820px;
  overflow: hidden;
  width: min(820px, calc(100vw - 28px));
}

.projects-header {
  align-items: flex-start;
}

.projects-header .eyebrow {
  margin-bottom: 3px;
}

.projects-header h2 {
  font-size: 1.35rem;
  margin: 0;
}

.projects-actions {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  padding-bottom: 14px;
}

.projects-actions p {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0;
}

.projects-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  max-height: 56vh;
  overflow: auto;
  padding-right: 3px;
}

.project-card {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px;
}

.project-card.active {
  background: #eef8f7;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(19, 93, 102, 0.1);
}

.project-open {
  align-items: flex-start;
  background: transparent;
  color: var(--ink);
  display: grid;
  justify-items: start;
  min-width: 0;
  padding: 7px 9px;
  text-align: left;
}

.project-open:hover {
  background: #e8f0f5;
}

.project-open strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-open span {
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 4px;
}

.project-card-actions {
  display: flex;
  gap: 6px;
}

.project-card-actions button {
  min-height: 32px;
  padding: 0 10px;
}

.projects-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.projects-empty h3 {
  color: var(--ink);
  margin: 0 0 6px;
}

.projects-empty p {
  margin: 0;
}

.login-page {
  align-items: center;
  background:
    radial-gradient(circle at top left, rgba(120, 211, 248, 0.34), transparent 42%),
    radial-gradient(circle at bottom right, rgba(118, 214, 114, 0.3), transparent 40%),
    var(--bg);
  display: flex;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-width: 430px;
  padding: 34px;
  width: 100%;
}

.login-card h1 {
  margin-bottom: 12px;
}

.login-intro {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  font-size: 0.8rem;
}

.login-form input {
  min-height: 44px;
}

.login-form button {
  min-height: 44px;
}

.login-error {
  background: #f8e8ea;
  border: 1px solid #efd3d7;
  border-radius: 6px;
  color: var(--danger);
  font-size: 0.82rem;
  margin-bottom: 16px;
  padding: 10px 12px;
}

@media (max-width: 700px) {
  .project-card {
    grid-template-columns: 1fr;
  }

  .project-card-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .projects-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Keep intentionally hidden controls out of the rendered interface. */
[hidden] {
  display: none !important;
}
