:root {
  color-scheme: light;
  --bg: #eef4fa;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --navy: #12314d;
  --navy-2: #19476f;
  --orange: #ff7417;
  --teal: #139b9a;
  --magenta: #c12861;
  --green: #5cab47;
  --line: #d4e0eb;
  --line-strong: #b8c8d8;
  --text: #13243a;
  --muted: #62748b;
  --shadow: 0 16px 42px rgba(18, 49, 77, 0.13);
  --radius: 8px;
  --gantt-columns: 145px 74px 270px minmax(1120px, 2fr) 250px;
  --gantt-min-width: 1859px;
  --timeline-months: 36;
  --quadrimester-width: 11.111111%;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  overflow-x: hidden;
}

.public-shell {
  min-height: 100vh;
}

.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  padding: 12px clamp(18px, 2vw, 36px);
  background: rgba(255, 255, 255, 0.93);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(18, 49, 77, 0.08);
  backdrop-filter: blur(14px);
}

.public-header .header-main-logo-link {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.public-header .header-main-logo {
  display: block;
  width: auto;
  height: clamp(46px, 4vw, 62px);
  max-width: min(58vw, 270px);
  object-fit: contain;
}

.public-content {
  width: 100vw;
  max-width: none;
  padding: clamp(16px, 2vw, 34px);
}

.public-board {
  min-height: calc(100vh - 114px);
}

.public-view .gantt-head {
  top: 0;
}

.public-activity-cell {
  grid-template-columns: 30px minmax(0, 1fr);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 78px;
  padding: 12px clamp(18px, 2vw, 36px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(18, 49, 77, 0.08);
  backdrop-filter: blur(14px);
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand-logo img {
  display: block;
  width: auto;
  height: clamp(46px, 4.8vw, 66px);
  max-width: min(48vw, 430px);
  object-fit: contain;
}

.public-header .header-side-logo {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  min-width: 0;
}

.public-header .header-side-logo img {
  display: block;
  width: auto;
  height: clamp(46px, 4vw, 62px);
  max-width: min(28vw, 320px);
  object-fit: contain;
}

.topbar-actions,
.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--navy);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.status-pill.is-online {
  color: #086461;
  background: #e3f7f5;
  border-color: rgba(19, 155, 154, 0.28);
}

.status-pill.is-dirty {
  color: #9a4508;
  background: #fff0e5;
  border-color: rgba(255, 116, 23, 0.3);
}

.toolbar {
  position: sticky;
  top: 78px;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px clamp(18px, 2vw, 36px);
  background: rgba(238, 244, 250, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.search-field {
  display: grid;
  grid-template-columns: 20px minmax(190px, 360px);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 3px 12px rgba(18, 49, 77, 0.06);
}

.search-field input {
  min-height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
}

.btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--navy);
  background: var(--surface);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
  box-shadow: 0 3px 12px rgba(18, 49, 77, 0.06);
  text-decoration: none;
}

.btn:hover {
  color: var(--navy);
  background: #f9fcff;
  border-color: #9fb2c4;
}

.btn.is-active,
.btn[aria-pressed="true"] {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.btn.is-active:hover,
.btn[aria-pressed="true"]:hover {
  color: #fff;
  background: var(--navy-2);
  border-color: var(--navy-2);
}

.btn svg,
.search-field svg {
  width: 16px;
  height: 16px;
  color: inherit;
  stroke: currentColor;
  stroke-width: 2.2;
}

.btn-icon {
  width: 38px;
  padding-inline: 8px;
}

.btn-primary {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.btn-primary:hover {
  color: #fff;
  background: var(--navy-2);
  border-color: var(--navy-2);
}

.btn-accent {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.btn-accent:hover {
  color: #fff;
  background: #0f8584;
  border-color: #0f8584;
}

.btn-warning {
  color: #fff;
  background: var(--orange);
  border-color: var(--orange);
}

.btn-warning:hover {
  color: #fff;
  background: #d9630f;
  border-color: #d9630f;
}

.btn-danger {
  color: #fff;
  background: var(--magenta);
  border-color: var(--magenta);
}

.btn-danger:hover {
  color: #fff;
  background: #a91f52;
  border-color: #a91f52;
}

.content {
  width: 100vw;
  max-width: none;
  padding: clamp(16px, 2vw, 34px);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.login-card {
  width: min(430px, 100%);
  display: grid;
  gap: 24px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-card img {
  width: min(100%, 340px);
}

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

.login-error {
  margin: 0;
  color: var(--magenta);
  font-size: 13px;
  font-weight: 800;
}

.project-ribbon {
  display: grid;
  grid-template-columns: minmax(330px, 0.55fr) minmax(660px, 1fr) minmax(280px, 0.42fr);
  gap: 12px;
  margin-bottom: 18px;
}

.project-card,
.axis-preview,
.reference-card {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(18, 49, 77, 0.08);
}

.project-card {
  display: grid;
  align-items: center;
  padding: 18px;
}

.project-card img {
  width: min(100%, 500px);
}

.reference-card {
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 18px;
}

.reference-card span {
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.reference-card strong {
  color: var(--navy);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.axis-preview-grid {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr 1fr;
}

.axis-preview-row {
  display: grid;
  grid-template-columns: repeat(var(--segments), minmax(0, 1fr));
}

.axis-preview-cell {
  display: grid;
  place-items: center;
  min-height: 54px;
  color: #fff;
  background: var(--navy);
  border-right: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
}

.axis-preview-row:last-child .axis-preview-cell {
  min-height: 58px;
  background: var(--orange);
  font-size: 13px;
  line-height: 1.18;
}

.axis-preview-cell:last-child {
  border-right: 0;
}

.timeline-board {
  width: 100%;
  min-height: 560px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.gantt-grid {
  min-width: max(100%, var(--gantt-min-width));
  display: grid;
  grid-template-columns: var(--gantt-columns);
}

body.is-fit-view {
  overflow: hidden;
}

body.is-fit-view .content {
  padding-block: 10px;
}

body.is-fit-view .toolbar {
  position: static;
}

body.is-fit-view .timeline-board {
  height: var(--fit-board-height, 560px);
  min-height: 0;
  overflow: hidden;
}

body.is-fit-view .gantt-grid {
  width: var(--fit-grid-width, var(--gantt-min-width));
  min-width: var(--fit-grid-width, var(--gantt-min-width));
  height: var(--fit-grid-height, auto);
  transform: scale(var(--fit-scale, 1));
  transform-origin: top left;
}

body.is-fit-view .legend {
  margin-top: 10px;
}

.gantt-head,
.wp-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: var(--gantt-columns);
}

.gantt-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f8fbfe;
  border-bottom: 1px solid var(--line-strong);
}

.th,
.cell {
  min-width: 0;
  padding: 14px;
  border-right: 1px solid var(--line);
}

.th {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

button.th {
  border-top: 0;
  border-left: 0;
  border-bottom: 0;
  background: #f8fbfe;
  text-align: left;
}

.column-head-label {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.th.is-align-left {
  justify-content: flex-start;
  text-align: left;
}

.th.is-align-center {
  justify-content: center;
  text-align: center;
}

.th.is-align-right {
  justify-content: flex-end;
  text-align: right;
}

.th.is-align-justify {
  justify-content: stretch;
  text-align: justify;
}

.th.is-align-justify .column-head-label {
  display: block;
  width: 100%;
  text-align: justify;
  text-align-last: left;
}

.is-column-chosen {
  background: #eef4fa !important;
}

.is-column-ghost {
  opacity: 0.42;
}

.is-column-dragging {
  box-shadow: 0 14px 28px rgba(18, 49, 77, 0.18);
}

body.is-column-sorting {
  user-select: none;
}

button.th:hover {
  color: var(--navy);
  background: #eef4fa;
}

.timeline-head-edit:hover {
  color: var(--navy);
  background: #fff;
  border-color: var(--line-strong);
}

.timeline-head {
  position: relative;
  display: block;
  padding: 0;
  cursor: grab;
}

.timeline-head:active,
.column-head:active,
.activity-cell:active {
  cursor: grabbing;
}

.timeline-head-edit {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 3;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 6px;
  color: #fff;
  background: rgba(18, 49, 77, 0.18);
}

.timeline-head-edit svg {
  width: 15px;
  height: 15px;
}

.axis-stack {
  height: 100%;
  width: 100%;
  display: grid;
  grid-template-rows: 1fr 1fr;
}

.axis-line {
  display: grid;
  grid-template-columns: repeat(var(--segments), minmax(0, 1fr));
}

.axis-year,
.axis-qm {
  display: grid;
  place-items: center;
  min-height: 36px;
  color: #fff;
  background: var(--navy);
  border-right: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.axis-qm {
  gap: 2px;
  min-height: 42px;
  color: var(--navy);
  background: #eaf2fa;
  border-right: 2px solid rgba(18, 49, 77, 0.2);
  line-height: 1.05;
}

.axis-qm-label,
.axis-qm-months {
  display: block;
}

.axis-qm-label {
  font-size: 12px;
  font-weight: 950;
}

.axis-qm-months {
  font-size: 11px;
  font-weight: 850;
}

.wp-row {
  min-height: 96px;
  border-bottom: 1px solid var(--line);
}

.wp-row:nth-child(even) {
  background: #fbfdff;
}

button.cell {
  width: 100%;
  text-align: left;
  font: inherit;
  border-top: 0;
  border-left: 0;
  border-bottom: 0;
  background: transparent;
}

button.cell:hover {
  color: var(--navy);
  background: rgba(238, 244, 250, 0.72);
}

.cell.is-align-left,
button.cell.is-align-left {
  text-align: left;
}

.cell.is-align-center,
button.cell.is-align-center {
  text-align: center;
}

.cell.is-align-right,
button.cell.is-align-right {
  text-align: right;
}

.cell.is-align-justify,
button.cell.is-align-justify {
  text-align: justify;
  text-align-last: left;
}

.cell.is-align-center .unit-grid {
  justify-content: center;
}

.cell.is-align-right .unit-grid {
  justify-content: flex-end;
}

.cell.is-align-justify .unit-grid {
  justify-content: space-between;
}

.activity-cell {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding-inline: 10px;
  cursor: grab;
  touch-action: none;
}

.wp-row.is-row-chosen {
  background: #eef4fa;
}

.wp-row.is-row-ghost {
  opacity: 0.42;
}

.wp-row.is-row-dragging {
  box-shadow: 0 14px 28px rgba(18, 49, 77, 0.18);
}

body.is-row-sorting {
  user-select: none;
}

body.is-task-dragging {
  cursor: grabbing;
  user-select: none;
}

.wp-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--wp-color, var(--navy));
}

.wp-title {
  display: block;
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
}

.wp-subtitle,
.meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.unit-grid,
.legend-pack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.unit-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 24px;
  padding: 4px 7px;
  border-radius: 6px;
  color: var(--unit-text, #fff);
  background: var(--unit-color, var(--navy));
  font-size: 12px;
  font-weight: 900;
}

.unit-chip.is-labelled {
  gap: 7px;
  min-height: 30px;
  padding: 3px 9px 3px 3px;
  border: 1px solid var(--line);
  color: var(--navy);
  background: #fff;
  box-shadow: 0 2px 8px rgba(18, 49, 77, 0.06);
}

.unit-chip.is-labelled:hover {
  color: var(--navy);
  background: #f9fcff;
  border-color: var(--line-strong);
}

.unit-number {
  min-width: 24px;
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  color: var(--unit-text, #fff);
  background: var(--unit-color, var(--navy));
  line-height: 1;
}

.unit-name {
  color: var(--text);
  font-weight: 800;
}

.core-cell,
.outputs-cell,
.custom-cell {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.timeline-cell {
  position: relative;
  min-height: var(--row-height, 116px);
  overflow: hidden;
  cursor: copy;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(var(--quadrimester-width) - 2px), rgba(18, 49, 77, 0.18) calc(var(--quadrimester-width) - 2px) var(--quadrimester-width)),
    repeating-linear-gradient(90deg, rgba(212, 224, 235, 0.75) 0 1px, transparent 1px calc(100% / var(--timeline-months))),
    linear-gradient(180deg, rgba(247, 250, 252, 0.84), rgba(255, 255, 255, 0.34));
}

.timeline-cell:hover {
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(var(--quadrimester-width) - 2px), rgba(18, 49, 77, 0.22) calc(var(--quadrimester-width) - 2px) var(--quadrimester-width)),
    repeating-linear-gradient(90deg, rgba(212, 224, 235, 0.82) 0 1px, transparent 1px calc(100% / var(--timeline-months))),
    linear-gradient(180deg, rgba(235, 245, 252, 0.9), rgba(255, 255, 255, 0.48));
}

.public-view .timeline-cell:hover {
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(var(--quadrimester-width) - 2px), rgba(18, 49, 77, 0.18) calc(var(--quadrimester-width) - 2px) var(--quadrimester-width)),
    repeating-linear-gradient(90deg, rgba(212, 224, 235, 0.75) 0 1px, transparent 1px calc(100% / var(--timeline-months))),
    linear-gradient(180deg, rgba(247, 250, 252, 0.84), rgba(255, 255, 255, 0.34));
}

.bar {
  position: absolute;
  left: var(--start);
  top: var(--top);
  width: var(--width);
  height: 19px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--bar-bg, linear-gradient(90deg, var(--bar-color), color-mix(in srgb, var(--bar-color) 74%, #fff)));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35), 0 8px 18px rgba(18,49,77,.18);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  will-change: transform, width;
}

.bar.is-selected {
  outline: 3px solid rgba(255, 116, 23, 0.28);
  outline-offset: 2px;
}

.bar:active,
.bar.is-drag-preview {
  cursor: grabbing;
}

.bar.is-drag-preview {
  z-index: 5;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4), 0 12px 26px rgba(18,49,77,.28);
}

.bar-text {
  display: block;
  padding: 3px 10px;
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bar.intensity-secondary {
  color: var(--navy);
}

.bar.intensity-multi {
  color: #fff;
}

.resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 14px;
  height: 100%;
  cursor: ew-resize;
}

body.public-view,
body.public-view *,
body.public-view *::before,
body.public-view *::after {
  cursor: default !important;
}

.marker {
  position: absolute;
  left: var(--at);
  top: var(--top);
  z-index: 2;
  width: 17px;
  height: 17px;
  border: 2px solid #fff;
  background: var(--magenta);
  box-shadow: 0 7px 16px rgba(18,49,77,.22);
  transform: translate(-50%, -50%);
}

.marker.is-milestone {
  background: var(--orange);
  border-radius: 3px;
  transform: translate(-50%, -50%) rotate(45deg);
}

.marker.is-deliverable {
  border-radius: 999px;
}

.legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.legend-title {
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.legend-swatch {
  width: 28px;
  height: 12px;
  border-radius: 999px;
  background: var(--navy);
}

.legend-swatch.is-multi {
  background: linear-gradient(90deg, #0d2344 0 16.66%, #7a3eb1 16.66% 33.33%, #3a9dac 33.33% 50%, #5cab47 50% 66.66%, #ef7d30 66.66% 83.33%, #c12861 83.33% 100%);
}

.legend-swatch.is-secondary {
  background: #aeb5bf;
}

.legend-marker {
  width: 14px;
  height: 14px;
  background: var(--magenta);
}

.legend-marker.is-deliverable {
  border-radius: 999px;
}

.legend-marker.is-milestone {
  background: var(--orange);
  border-radius: 3px;
  transform: rotate(45deg);
}

.inspector {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 60;
  width: min(460px, 100vw);
  height: 100vh;
  display: none;
  grid-template-rows: auto 1fr auto;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.inspector.is-open {
  display: grid;
}

.inspector-header,
.inspector-footer {
  position: relative;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.inspector-header .btn-icon {
  position: absolute;
  top: 14px;
  right: 14px;
}

.inspector-header h2 {
  margin: 0;
  padding-right: 54px;
  color: var(--navy);
  font-size: 20px;
}

.inspector-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.inspector-body {
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

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

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.is-full,
.form-grid > .is-full {
  grid-column: 1 / -1;
}

.field span {
  color: var(--navy);
  font-size: 12px;
  font-weight: 850;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  background: #fff;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field select[multiple] {
  min-height: 118px;
}

.editor-section {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.inline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--navy);
  background: var(--surface-soft);
}

.inline-row:hover {
  color: var(--navy);
  background: #eef4fa;
  border-color: var(--line-strong);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(18,49,77,.46);
}

.modal.is-open {
  display: grid;
}

.modal-dialog {
  width: min(520px, 100%);
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.instant-hint {
  position: fixed;
  z-index: 120;
  max-width: min(320px, calc(100vw - 16px));
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 7px;
  color: #fff;
  background: rgba(18,49,77,.96);
  box-shadow: 0 12px 28px rgba(18,49,77,.24);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.instant-hint[hidden] {
  display: none;
}

.context-menu {
  position: fixed;
  z-index: 110;
  display: grid;
  min-width: 230px;
  max-width: min(320px, calc(100vw - 16px));
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.context-menu button {
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  color: var(--navy);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.context-menu button:hover,
.context-menu button:focus-visible {
  color: var(--navy);
  background: #eef4fa;
  outline: none;
}

.context-menu button.is-danger {
  color: #a42836;
}

.context-menu button.is-danger:hover,
.context-menu button.is-danger:focus-visible {
  color: #7f1d2a;
  background: #fff1f3;
}

.context-menu-separator {
  display: block;
  height: 1px;
  margin: 5px 4px;
  background: var(--line);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  width: min(390px, calc(100vw - 36px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  background: rgba(255,255,255,.97);
  box-shadow: var(--shadow);
}

.toast strong,
.toast span {
  display: block;
}

.toast span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.is-hidden,
[hidden] {
  display: none !important;
}

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

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

  .project-ribbon {
    grid-template-columns: 1fr;
  }

  .brand-logo img {
    width: auto;
    height: 44px;
    max-width: 76vw;
  }

  .public-header .header-side-logo img {
    height: 44px;
    max-width: 70vw;
  }

  .gantt-grid {
    min-width: 1540px;
  }
}

@media (max-width: 560px) {
  .content {
    padding-inline: 12px;
  }

  .toolbar {
    top: 0;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .search-field {
    width: 100%;
    grid-template-columns: 20px 1fr;
  }

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

@media print {
  .topbar,
  .toolbar,
  .inspector,
  .modal,
  .toast {
    display: none !important;
  }

  .content {
    padding: 0;
  }

  .timeline-board {
    overflow: visible;
    box-shadow: none;
  }

  .bar,
  .marker,
  .unit-chip {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
