:root {
  --ink: #20231f;
  --muted: #747a70;
  --line: #e8eae4;
  --line-strong: #dfe2da;
  --paper: #ffffff;
  --canvas: #f7f8f4;
  --accent: #7668e9;
  --accent-dark: #5c4fd1;
  --accent-soft: #eeecff;
  --mint: #5dbd9b;
  --peach: #e9976a;
  --blue: #5d91d8;
  --pink: #d87dac;
  --amber: #d6a542;
  --day-width: 38px;
  --task-width: 520px;
  --row-height: 62px;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 84% 5%, rgba(222, 218, 255, 0.34), transparent 23rem),
    var(--canvas);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
input[type="date"] {
  -webkit-tap-highlight-color: transparent;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 4vw;
  border-bottom: 1px solid rgba(223, 226, 218, 0.8);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand-mark,
.dialog-icon {
  display: grid;
  grid-template-columns: repeat(3, 5px);
  align-items: end;
  gap: 3px;
  width: 25px;
  height: 24px;
  padding: 4px;
  border-radius: 7px;
  color: white;
  background: var(--accent);
}

.brand-mark span,
.dialog-icon span {
  display: block;
  width: 5px;
  border-radius: 2px;
  background: currentColor;
}

.brand-mark span:nth-child(1),
.dialog-icon span:nth-child(1) {
  height: 7px;
}

.brand-mark span:nth-child(2),
.dialog-icon span:nth-child(2) {
  height: 13px;
}

.brand-mark span:nth-child(3),
.dialog-icon span:nth-child(3) {
  height: 10px;
}

.topbar-actions,
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 4px;
  color: var(--muted);
  font-size: 12px;
}

.save-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6cbc91;
  box-shadow: 0 0 0 3px rgba(108, 188, 145, 0.13);
  transition: background 160ms ease;
}

.save-state.saving .save-dot {
  background: #d8a64f;
}

.button,
.icon-button,
.zoom-control button {
  border: 0;
  cursor: pointer;
}

.button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-small {
  min-height: 34px;
  padding-inline: 12px;
}

.button-ghost {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.88);
}

.button-ghost:hover {
  border-color: #c8ccc3;
  background: white;
}

.button-primary {
  color: white;
  background: var(--accent);
  box-shadow: 0 7px 18px rgba(118, 104, 233, 0.22);
}

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

.start-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.start-button span {
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 9px;
  background: transparent;
}

.icon-button:hover,
.icon-button[aria-expanded="true"] {
  background: #f0f1ed;
}

.icon-button svg {
  fill: currentColor;
  stroke: none;
}

.menu-wrap {
  position: relative;
}

.menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 50;
  width: 230px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 16px 45px rgba(37, 42, 34, 0.15);
}

.menu button {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  padding: 10px 11px;
  border: 0;
  border-radius: 8px;
  color: #454a42;
  background: transparent;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.menu button:hover {
  background: #f6f7f3;
}

.menu button.danger {
  color: #c35757;
}

.menu svg {
  width: 17px;
  height: 17px;
}

.page {
  width: min(1480px, calc(100% - 8vw));
  margin: 0 auto;
  padding: 48px 0 36px;
}

.project-head {
  margin-bottom: 32px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.19em;
}

.title-row {
  display: flex;
  align-items: center;
  width: min(760px, 100%);
}

.project-title {
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.2;
}

.project-title:focus {
  text-decoration: underline;
  text-decoration-color: rgba(118, 104, 233, 0.3);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

.edit-hint {
  color: #a5aaa1;
}

.edit-hint svg {
  width: 18px;
}

.project-meta {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.date-field {
  display: grid;
  gap: 5px;
}

.date-field span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.date-field input {
  height: 35px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: 0;
  color: #444941;
  background: white;
  font-size: 12px;
}

.date-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(118, 104, 233, 0.1);
}

.date-arrow {
  align-self: flex-end;
  padding-bottom: 8px;
  color: #9da298;
}

.period-pill {
  align-self: flex-end;
  margin-left: 4px;
  padding: 7px 11px;
  border-radius: 999px;
  color: #6459bb;
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 600;
}

.summary {
  display: grid;
  grid-template-columns: minmax(270px, 1.6fr) repeat(3, minmax(160px, 0.8fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-card {
  display: flex;
  min-height: 96px;
  align-items: center;
  gap: 13px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.83);
  box-shadow: 0 5px 18px rgba(35, 40, 32, 0.025);
}

.summary-main {
  display: grid;
  align-content: center;
}

.summary-main > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.summary-label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.summary-card strong {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.summary-main strong {
  color: var(--accent);
}

.progress-track {
  overflow: hidden;
  height: 6px;
  border-radius: 999px;
  background: #eeefe9;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7869e8, #988cf4);
  transition: width 250ms ease;
}

.summary-icon {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
}

.summary-icon svg {
  width: 19px;
  height: 19px;
}

.summary-icon.lavender {
  color: #7467d8;
  background: #eeecff;
}

.summary-icon.mint {
  color: #4a9b7d;
  background: #e4f5ef;
}

.summary-icon.peach {
  color: #c6764d;
  background: #fbece3;
}

.gantt-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 10px 32px rgba(35, 40, 32, 0.04);
}

.gantt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.gantt-toolbar h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.gantt-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.zoom-control {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #f8f9f6;
}

.zoom-control button {
  display: grid;
  width: 32px;
  height: 30px;
  place-items: center;
  border-radius: 7px;
  color: #858b81;
  background: transparent;
}

.zoom-control button:hover,
.zoom-control button.active {
  color: var(--ink);
  background: white;
  box-shadow: 0 2px 6px rgba(34, 39, 31, 0.09);
}

.zoom-control svg {
  width: 15px;
  height: 15px;
}

.nonbusiness-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  color: #656b62;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

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

.toggle-track {
  position: relative;
  display: block;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #d8dcd3;
  transition: background 150ms ease;
}

.toggle-track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(32, 35, 31, 0.2);
  transition: transform 150ms ease;
}

.nonbusiness-toggle input:checked + .toggle-track {
  background: var(--accent);
}

.nonbusiness-toggle input:checked + .toggle-track i {
  transform: translateX(14px);
}

.nonbusiness-toggle input:focus-visible + .toggle-track {
  outline: 3px solid rgba(118, 104, 233, 0.18);
  outline-offset: 2px;
}

.gantt-scroll {
  overflow: auto;
  max-height: min(61vh, 720px);
  scrollbar-color: #c7cbc2 #f3f4f0;
  scrollbar-width: thin;
}

.gantt-content {
  position: relative;
  min-width: 100%;
}

.gantt-header {
  position: sticky;
  top: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: var(--task-width) max-content;
  height: 76px;
  border-bottom: 1px solid var(--line-strong);
  background: white;
}

.task-header {
  position: sticky;
  left: 0;
  z-index: 18;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 106px 106px 54px 52px 34px;
  align-items: end;
  height: 76px;
  padding: 0 9px 12px 19px;
  border-right: 1px solid var(--line-strong);
  background: white;
  color: #93988f;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.task-header span:not(:first-child) {
  padding-left: 8px;
}

.calendar-header {
  width: calc(var(--day-count) * var(--day-width));
}

.month-row,
.day-row {
  display: grid;
  grid-template-columns: repeat(var(--day-count), var(--day-width));
}

.month-row {
  height: 37px;
  border-bottom: 1px solid var(--line);
}

.month-label {
  display: flex;
  align-items: center;
  padding-left: 12px;
  border-right: 1px solid var(--line);
  color: #555b52;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
}

.day-row {
  height: 39px;
}

.day-label {
  display: grid;
  place-items: center;
  border-right: 1px solid #f1f2ee;
  color: #747a70;
  font-size: 9px;
  line-height: 1;
}

.day-label span {
  display: block;
  margin-top: 2px;
  color: #a3a79f;
  font-size: 8px;
}

.day-label.weekend {
  color: #c18585;
  background: #fbf7f5;
}

.day-label.holiday {
  color: #bd5f63;
  background: #fff3f3;
}

.day-label.holiday span {
  overflow: hidden;
  width: calc(var(--day-width) - 4px);
  color: #bd5f63;
  font-size: 7px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-label.today {
  color: white;
  background: var(--accent);
}

.day-label.today span {
  color: rgba(255, 255, 255, 0.72);
}

.gantt-row {
  display: grid;
  grid-template-columns: var(--task-width) max-content;
  height: var(--row-height);
  border-bottom: 1px solid var(--line);
}

.gantt-row:last-child {
  border-bottom: 0;
}

.gantt-row.dragging {
  opacity: 0.45;
}

.gantt-row.drag-over {
  box-shadow: inset 0 2px 0 var(--accent);
}

.task-cell {
  position: sticky;
  left: 0;
  z-index: 7;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 106px 106px 54px 52px 34px;
  align-items: center;
  padding: 0 9px 0 12px;
  border-right: 1px solid var(--line-strong);
  background: white;
}

.gantt-row:hover .task-cell {
  background: #fdfdfb;
}

.task-name-wrap {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.drag-grip {
  display: grid;
  flex: 0 0 auto;
  width: 13px;
  grid-template-columns: repeat(2, 3px);
  gap: 2px;
  opacity: 0.55;
  cursor: grab;
}

.drag-grip:active {
  cursor: grabbing;
}

.drag-grip i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #adb1aa;
}

.phase-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--task-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--task-color) 15%, white);
}

.task-input,
.task-date,
.task-progress {
  min-width: 0;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 7px;
  outline: 0;
  color: #3c413a;
  background: transparent;
  font-size: 11px;
}

.business-days {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 25px;
  border-radius: 999px;
  color: #5e655b;
  background: #f0f2ed;
  font-size: 10px;
  font-weight: 700;
}

.task-input {
  width: 100%;
  padding: 0 5px;
  font-weight: 600;
  text-overflow: ellipsis;
}

.task-date {
  width: 100px;
  padding: 0 5px;
  color: #666c63;
  font-size: 10px;
}

.task-progress {
  width: 47px;
  padding: 0 4px;
  text-align: right;
}

.task-input:hover,
.task-date:hover,
.task-progress:hover {
  border-color: var(--line);
  background: white;
}

.task-input:focus,
.task-date:focus,
.task-progress:focus {
  border-color: var(--accent);
  background: white;
  box-shadow: 0 0 0 3px rgba(118, 104, 233, 0.09);
}

.delete-task {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: #afb3ac;
  background: transparent;
  opacity: 0;
  cursor: pointer;
  transition: opacity 100ms ease;
}

.gantt-row:hover .delete-task,
.delete-task:focus {
  opacity: 1;
}

.delete-task:hover {
  color: #c55d5d;
  background: #fff0f0;
}

.delete-task svg {
  width: 15px;
  height: 15px;
}

.timeline-cell {
  position: relative;
  display: grid;
  width: calc(var(--day-count) * var(--day-width));
  grid-template-columns: repeat(var(--day-count), var(--day-width));
}

.day-cell {
  border-right: 1px solid #f1f2ee;
}

.day-cell.weekend {
  background: #fbf9f6;
}

.day-cell.holiday {
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(203, 96, 100, 0.025),
      rgba(203, 96, 100, 0.025) 4px,
      rgba(203, 96, 100, 0.065) 4px,
      rgba(203, 96, 100, 0.065) 5px
    ),
    #fff8f7;
}

.day-cell.today {
  background: rgba(118, 104, 233, 0.045);
}

.today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 5;
  width: 1px;
  background: rgba(118, 104, 233, 0.6);
  pointer-events: none;
}

.task-bar {
  position: absolute;
  top: 16px;
  z-index: 6;
  height: 30px;
  min-width: 10px;
  border-radius: 8px;
  color: var(--bar-color);
  background: color-mix(in srgb, var(--bar-color) 18%, white);
  border: 1px solid color-mix(in srgb, var(--bar-color) 35%, white);
  cursor: grab;
  user-select: none;
  touch-action: none;
  overflow: hidden;
  box-shadow: 0 3px 8px color-mix(in srgb, var(--bar-color) 12%, transparent);
}

.task-bar:active {
  cursor: grabbing;
}

.task-bar-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress);
  background: color-mix(in srgb, var(--bar-color) 68%, white);
  opacity: 0.75;
}

.task-bar-label {
  position: relative;
  z-index: 2;
  display: block;
  overflow: hidden;
  padding: 7px 13px;
  color: color-mix(in srgb, var(--bar-color) 82%, #20231f);
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.resize-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: 9px;
  cursor: ew-resize;
}

.resize-handle::after {
  position: absolute;
  top: 10px;
  width: 2px;
  height: 9px;
  border-radius: 2px;
  background: currentColor;
  content: "";
  opacity: 0;
}

.task-bar:hover .resize-handle::after {
  opacity: 0.45;
}

.resize-handle.left {
  left: 0;
}

.resize-handle.left::after {
  left: 4px;
}

.resize-handle.right {
  right: 0;
}

.resize-handle.right::after {
  right: 4px;
}

.add-row {
  position: relative;
  z-index: 20;
  display: flex;
  min-height: 65px;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-top: 1px solid var(--line);
  background: white;
}

.add-task-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  color: var(--accent-dark);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.add-task-button:hover {
  background: var(--accent-soft);
}

.add-task-button span {
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.add-help {
  color: #9da298;
  font-size: 10px;
}

.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 18px 0 0;
  color: #9ba097;
  font-size: 10px;
}

.privacy-note svg {
  width: 13px;
  height: 13px;
}

.help-dialog {
  width: min(430px, calc(100% - 32px));
  padding: 34px;
  border: 0;
  border-radius: 20px;
  color: var(--ink);
  box-shadow: 0 25px 80px rgba(27, 31, 25, 0.25);
}

.help-dialog::backdrop {
  background: rgba(28, 31, 27, 0.35);
  backdrop-filter: blur(4px);
}

.setup-dialog {
  width: min(720px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  background: white;
  box-shadow: 0 28px 90px rgba(27, 31, 25, 0.27);
}

.setup-dialog::backdrop {
  background: rgba(28, 31, 27, 0.4);
  backdrop-filter: blur(5px);
}

.setup-shell {
  display: flex;
  max-height: calc(100vh - 40px);
  flex-direction: column;
}

.setup-header {
  position: relative;
  flex: 0 0 auto;
  padding: 28px 34px 20px;
  border-bottom: 1px solid var(--line);
}

.setup-kicker {
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.setup-header h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.035em;
}

.setup-progress {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 17px 34px;
  border-bottom: 1px solid var(--line);
  background: #fafbf8;
}

.setup-progress span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #a0a59c;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.setup-progress span i {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #eceee8;
  font-size: 9px;
  font-style: normal;
}

.setup-progress span.active {
  color: var(--accent-dark);
}

.setup-progress span.active i {
  color: white;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(118, 104, 233, 0.1);
}

.setup-progress span.done {
  color: #6d746a;
}

.setup-progress span.done i {
  color: white;
  background: #67b493;
}

.setup-progress b {
  width: 70px;
  height: 1px;
  margin: 0 14px;
  background: #dfe2da;
}

.setup-body {
  overflow-y: auto;
  min-height: 330px;
  padding: 30px 34px;
}

.setup-step {
  display: none;
}

.setup-step.active {
  display: block;
  animation: setup-in 180ms ease;
}

@keyframes setup-in {
  from {
    opacity: 0;
    transform: translateX(7px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.setup-question {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 26px;
}

.question-number {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 700;
}

.setup-question h3 {
  margin: 0 0 3px;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.setup-question p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.setup-field {
  display: grid;
  gap: 7px;
}

.setup-field > span {
  color: #60665d;
  font-size: 11px;
  font-weight: 700;
}

.setup-field input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: 0;
  color: var(--ink);
  background: white;
  font-size: 13px;
}

.setup-field input:focus,
.phase-editor input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(118, 104, 233, 0.1);
}

.setup-date-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 14px;
  margin-top: 18px;
}

.setup-date-grid > span {
  padding-bottom: 12px;
  color: #a1a69d;
}

.setup-error {
  margin: 12px 0 0;
  color: #c65757;
  font-size: 11px;
}

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

.phase-editor {
  display: grid;
  grid-template-columns: 38px 1fr 36px;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fafbf8;
}

.phase-index {
  color: #969c92;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}

.phase-editor input {
  height: 36px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  outline: 0;
  color: #3b4039;
  background: white;
  font-size: 12px;
  font-weight: 600;
}

.phase-editor button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: #adb2aa;
  background: transparent;
  cursor: pointer;
}

.phase-editor button:hover {
  color: #c45c5c;
  background: #fff0f0;
}

.phase-editor button svg {
  width: 14px;
  height: 14px;
}

.add-phase-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.add-phase-button:hover {
  background: #e5e1ff;
}

.add-phase-button span {
  font-size: 16px;
  font-weight: 400;
}

.setup-review {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.review-title {
  display: grid;
  gap: 4px;
  padding: 17px 19px;
  border-bottom: 1px solid var(--line);
  background: #fafbf8;
}

.review-title span,
.review-meta span,
.review-phases > span {
  color: #92988f;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.review-title strong {
  font-size: 16px;
  letter-spacing: -0.025em;
}

.review-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.review-meta div {
  display: grid;
  gap: 4px;
  padding: 14px 19px;
  border-right: 1px solid var(--line);
}

.review-meta div:last-child {
  border-right: 0;
}

.review-meta strong {
  font-size: 12px;
}

.review-phases {
  display: grid;
  gap: 10px;
  padding: 16px 19px 18px;
}

.review-phases > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.review-phases > div span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #555b52;
  background: white;
  font-size: 10px;
  font-weight: 600;
}

.review-phases i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--phase-color);
}

.safe-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  color: #467b65;
  background: #edf8f3;
  font-size: 10px;
  line-height: 1.5;
}

.safe-note svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
}

.setup-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 34px;
  border-top: 1px solid var(--line);
  background: white;
}

.setup-footer > div {
  display: flex;
  gap: 8px;
}

.setup-safety {
  color: #979c94;
  font-size: 9px;
}

.dialog-close {
  position: absolute;
  top: 15px;
  right: 15px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #8b9087;
  background: #f3f4f0;
  font-size: 20px;
  cursor: pointer;
}

.dialog-icon {
  width: 40px;
  height: 40px;
  grid-template-columns: repeat(3, 6px);
  gap: 4px;
  padding: 7px;
  border-radius: 11px;
}

.dialog-icon span {
  width: 6px;
}

.help-dialog h2 {
  margin: 20px 0 5px;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.help-dialog > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.help-dialog ol {
  display: grid;
  gap: 16px;
  margin: 26px 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
}

.help-dialog li {
  position: relative;
  display: grid;
  gap: 2px;
  padding-left: 38px;
  counter-increment: steps;
}

.help-dialog li::before {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 700;
  content: counter(steps);
}

.help-dialog li strong {
  font-size: 13px;
}

.help-dialog li span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.dialog-action {
  width: 100%;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  padding: 12px 16px;
  border-radius: 10px;
  color: white;
  background: #2c302b;
  font-size: 12px;
  box-shadow: 0 12px 35px rgba(25, 29, 24, 0.2);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  :root {
    --task-width: 470px;
  }

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

  .summary-main {
    grid-column: 1 / -1;
  }

  .task-header,
  .task-cell {
    grid-template-columns: minmax(140px, 1fr) 93px 93px 48px 42px 30px;
    padding-left: 9px;
    padding-right: 5px;
  }

  .task-date {
    width: 88px;
    font-size: 9px;
  }

  .task-progress {
    width: 38px;
  }
}

@media (max-width: 640px) {
  :root {
    --task-width: 310px;
  }

  .topbar {
    padding-inline: 16px;
  }

  .save-state,
  #helpButton {
    display: none;
  }

  .start-button {
    padding-inline: 11px;
  }

  .page {
    width: calc(100% - 24px);
    padding-top: 30px;
  }

  .project-head {
    margin-bottom: 24px;
  }

  .project-title {
    font-size: 28px;
  }

  .summary {
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
  }

  .summary-card {
    min-height: 82px;
    padding: 13px;
  }

  .summary-main {
    min-height: 86px;
  }

  .summary-icon {
    display: none;
  }

  .summary-card strong {
    font-size: 17px;
  }

  .gantt-toolbar {
    align-items: flex-start;
    padding: 15px;
  }

  .gantt-toolbar p {
    display: none;
  }

  #todayButton {
    display: none;
  }

  .nonbusiness-toggle > span:last-child {
    display: none;
  }

  .task-header,
  .task-cell {
    grid-template-columns: minmax(140px, 1fr) 94px 48px 32px;
  }

  .task-header span:nth-child(3),
  .task-header span:nth-child(5),
  .task-date:nth-of-type(3),
  .task-progress {
    display: none;
  }

  .delete-task {
    opacity: 0.65;
  }

  .add-help {
    display: none;
  }

  .setup-dialog {
    width: calc(100% - 18px);
    max-height: calc(100vh - 18px);
    border-radius: 17px;
  }

  .setup-shell {
    max-height: calc(100vh - 18px);
  }

  .setup-header {
    padding: 22px 20px 16px;
  }

  .setup-header h2 {
    padding-right: 30px;
    font-size: 18px;
  }

  .setup-progress {
    padding: 13px 18px;
  }

  .setup-progress b {
    width: 25px;
    margin: 0 7px;
  }

  .setup-progress span {
    gap: 4px;
    font-size: 9px;
  }

  .setup-progress span i {
    width: 21px;
    height: 21px;
  }

  .setup-body {
    min-height: 0;
    padding: 22px 20px;
  }

  .setup-date-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .setup-date-grid > span {
    display: none;
  }

  .review-meta {
    grid-template-columns: 1fr;
  }

  .review-meta div {
    grid-template-columns: 65px 1fr;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .review-meta div:last-child {
    border-bottom: 0;
  }

  .setup-footer {
    align-items: stretch;
    padding: 13px 20px;
  }

  .setup-safety {
    display: none;
  }

  .setup-footer > div {
    width: 100%;
  }

  .setup-footer .button {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
