:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #172033;
  --muted: #64748b;
  --border: #d9e0ea;
  --border-strong: #b9c4d2;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --green: #0f766e;
  --amber: #d97706;
  --red: #dc2626;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  font-family:
    "Segoe UI",
    "Yu Gothic UI",
    "Meiryo",
    system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

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

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

.app-shell {
  min-height: 100vh;
  padding: 18px;
}

.standalone-page {
  display: grid;
  align-content: start;
  gap: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.brand {
  min-width: 0;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.3rem, 2vw, 1.9rem);
  line-height: 1.2;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.35rem;
  line-height: 1.3;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.topbar-actions,
.detail-actions,
.modal-footer,
.section-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.icon-button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 13px;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  font-weight: 700;
}

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

.secondary-button {
  background: #eef4ff;
  color: #1e40af;
  border-color: #bfdbfe;
  font-weight: 700;
}

.ghost-button {
  background: #ffffff;
  color: var(--text);
  border-color: var(--border);
}

.danger-button {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
  font-weight: 700;
}

.icon-button {
  width: 38px;
  padding: 0;
  background: #ffffff;
  color: var(--text);
  border-color: var(--border);
}

.danger-icon {
  color: var(--red);
  background: #fff7f7;
  border-color: #fecaca;
}

.context-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 700;
}

.context-pill.ok {
  background: #ecfdf5;
  color: #047857;
}

.context-pill.danger {
  background: #fef2f2;
  color: #b91c1c;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  min-height: calc(100vh - 106px);
}

.project-sidebar,
.project-pane {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.project-sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-tools {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.field {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-weight: 700;
}

.field span {
  color: var(--muted);
  font-size: 0.78rem;
}

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

.field textarea {
  resize: vertical;
}

.field.compact input,
.field.compact select {
  min-height: 36px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}

.summary-item {
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 10px 12px;
  background: var(--surface-soft);
}

.summary-label,
.muted {
  color: var(--muted);
}

.summary-label {
  font-size: 0.78rem;
  font-weight: 700;
}

.summary-item strong {
  font-size: 1.25rem;
}

.project-list {
  display: grid;
  gap: 8px;
  padding: 12px;
  overflow: auto;
}

.project-list.loading {
  opacity: 0.65;
}

.project-item {
  position: relative;
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  min-height: 78px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
}

.project-item:hover,
.project-item.active {
  border-color: #93c5fd;
  background: #f8fbff;
}

.project-accent {
  width: 5px;
  border-radius: 999px;
}

.project-item-main {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
}

.project-item-main strong,
.project-item-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-item-main span {
  color: var(--muted);
  font-size: 0.85rem;
}

.project-item-meta {
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.status-badge,
.task-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-badge.active,
.task-status.active {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-badge.on_hold,
.task-status.planned {
  background: #f1f5f9;
  color: #475569;
}

.status-badge.completed,
.task-status.done {
  background: #dcfce7;
  color: #15803d;
}

.task-status.blocked {
  background: #fee2e2;
  color: #b91c1c;
}

.late-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 800;
}

.list-empty,
.empty-state {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  min-height: 220px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.list-empty {
  min-height: 140px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
}

.list-empty strong,
.empty-state h2 {
  color: var(--text);
}

.project-pane {
  overflow: hidden;
}

.project-detail {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.detail-header > div:first-child {
  min-width: 0;
}

.detail-header h2 {
  overflow-wrap: anywhere;
}

.detail-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.metric {
  display: grid;
  gap: 6px;
  min-height: 72px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.metric span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.metric strong {
  overflow-wrap: anywhere;
}

.task-section,
.gantt-section {
  display: grid;
  gap: 10px;
}

.section-title-row {
  justify-content: space-between;
}

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.gantt-title-row {
  align-items: center;
}

.gantt-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.segmented-control {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.segmented-control button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 0 11px;
  background: transparent;
  color: #475569;
  font-weight: 800;
}

.segmented-control button.active {
  background: #ffffff;
  color: #1d4ed8;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.task-table {
  width: 100%;
  min-width: 805px;
  border-collapse: collapse;
  table-layout: fixed;
}

.task-table th:nth-child(1),
.task-table td:nth-child(1) {
  width: 150px;
}

.task-table th:nth-child(2),
.task-table td:nth-child(2) {
  width: 150px;
}

.task-table th:nth-child(3),
.task-table td:nth-child(3),
.task-table th:nth-child(4),
.task-table td:nth-child(4) {
  width: 145px;
}

.task-table th:nth-child(5),
.task-table td:nth-child(5) {
  width: 105px;
}

.task-table th:nth-child(6),
.task-table td:nth-child(6) {
  width: 110px;
}

.task-table th,
.task-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.task-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
}

.task-table th:first-child,
.task-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 150px;
  background: #ffffff;
}

.task-table th:first-child {
  z-index: 3;
  background: #f8fafc;
}

.task-table tr:last-child td {
  border-bottom: 0;
}

.task-table tr.dirty {
  background: #f8fbff;
}

.task-table tr.new-task-row td {
  background: #f8fbff;
}

.row-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.progress-cell {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 44px;
  align-items: center;
  gap: 8px;
}

.inline-progress-cell {
  grid-template-columns: minmax(86px, 1fr) 42px;
}

.inline-progress-cell .progress-track {
  display: none;
}

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

.progress-track span {
  display: block;
  height: 100%;
  background: var(--green);
}

.task-inline-select,
.task-inline-title,
.task-inline-date {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  background: #ffffff;
  color: var(--text);
}

.task-inline-date {
  padding-inline: 6px;
  font-size: 0.92rem;
}

.task-inline-title {
  font-weight: 700;
}

.task-inline-status {
  min-width: 96px;
}

.task-inline-progress {
  width: 100%;
  min-height: 28px;
}

.task-row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.compact-action {
  min-height: 32px;
  padding-inline: 10px;
}

.compact-icon {
  width: 34px;
  min-height: 32px;
}

.gantt-preview-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.gantt-editor-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

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

.control-field span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 800;
}

.control-field input[type="range"],
.control-field select {
  width: 100%;
}

.control-field select {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  background: #ffffff;
  color: var(--text);
}

.ppt-preview-shell {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #e5e7eb;
}

.ppt-preview-label {
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
}

.gantt-viewport {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

#ganttSvg {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  max-width: none;
  border-radius: 0;
  background: #ffffff;
}

#ganttSvg rect,
#ganttSvg circle {
  stroke: none;
  stroke-width: 0;
}

#ganttSvg .gantt-stroked {
  stroke: #d9e0ea;
  stroke-width: 1.4;
}

#ganttSvg .gantt-divider {
  stroke: #d9e0ea;
  stroke-width: 1.2;
}

.gantt-axis,
.gantt-month,
.gantt-label,
.gantt-owner,
.gantt-progress,
.gantt-today-label {
  font-family: "Segoe UI", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  letter-spacing: 0;
  stroke: none;
}

.gantt-axis {
  fill: #64748b;
  font-size: 11px;
}

.gantt-month {
  fill: #172033;
  font-size: 12px;
  font-weight: 800;
}

.gantt-label {
  fill: #172033;
  font-size: 12px;
  font-weight: 800;
}

.gantt-owner {
  fill: #64748b;
  font-size: 11px;
}

.gantt-progress {
  fill: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.gantt-grid,
.gantt-row-line {
  stroke: #e2e8f0;
  stroke-width: 1;
}

.gantt-divider {
  stroke: #cbd5e1;
  stroke-width: 1;
}

.gantt-month-line {
  stroke: #bfdbfe;
  stroke-width: 1;
}

.gantt-today {
  stroke: #be123c;
  stroke-width: 2;
}

.gantt-today-label {
  fill: #be123c;
  font-size: 11px;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.42);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  display: grid;
  gap: 16px;
  width: min(1120px, 100%);
  max-height: min(92vh, 980px);
  overflow: auto;
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.small-modal {
  width: min(460px, 100%);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.message {
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 700;
}

.message.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.message.warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.message ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.span-2 {
  grid-column: span 2;
}

.task-editor-section {
  display: grid;
  gap: 10px;
}

.task-title-toolbar {
  align-items: end;
  gap: 12px;
}

.task-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-width: min(100%, 560px);
}

.template-select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.task-editor {
  display: grid;
  gap: 10px;
}

.task-edit-row {
  display: grid;
  grid-template-columns: 34px repeat(12, minmax(0, 1fr)) 38px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.task-edit-row > .field {
  min-width: 0;
}

.task-edit-row input,
.task-edit-row select {
  min-width: 0;
}

.task-row-number {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  display: grid;
  place-items: center;
  width: 28px;
  height: 38px;
  border-radius: 8px;
  background: #e2e8f0;
  color: #334155;
  font-weight: 800;
}

.task-title-field {
  grid-column: 2 / span 4;
}

.task-owner-field {
  grid-column: 6 / span 3;
}

.task-start-field {
  grid-column: 9 / span 2;
}

.task-end-field {
  grid-column: 11 / span 3;
}

.task-status-field {
  grid-column: 2 / span 2;
}

.progress-edit {
  grid-column: 4 / span 2;
}

.compact-select select,
.progress-edit input {
  padding-inline: 8px;
}

.progress-control {
  display: grid;
  grid-template-columns: minmax(88px, 1fr) 44px;
  gap: 8px;
  align-items: center;
  min-height: 38px;
}

.progress-control input[type="range"] {
  min-height: 28px;
  padding: 0;
}

.progress-control output {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: right;
}

.color-presets {
  display: grid;
  grid-template-columns: repeat(8, 24px);
  gap: 6px;
  align-items: center;
}

.color-swatch {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--border-strong);
}

.color-swatch:hover,
.color-swatch.active {
  box-shadow: 0 0 0 2px var(--primary);
}

.color-swatch.active {
  position: relative;
}

.color-swatch.active::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px solid #ffffff;
  border-left: 0;
  border-top: 0;
  transform: rotate(45deg);
}

.task-notes {
  grid-column: 6 / 14;
}

.task-remove-button {
  grid-column: 14;
  grid-row: 1 / span 2;
  align-self: center;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
}

.member-chip span,
.member-color {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.conflict-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  color: #78350f;
}

.conflict-title {
  font-weight: 900;
}

.conflict-panel ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.conflict-panel li {
  line-height: 1.5;
}

.member-modal {
  width: min(980px, 100%);
}

.member-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 1fr);
  gap: 16px;
}

.member-form-panel,
.member-list-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

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

.compact-footer {
  padding-top: 0;
}

.member-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
}

.member-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.member-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.member-main strong,
.member-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-main span {
  color: var(--muted);
  font-size: 0.84rem;
}

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

.template-modal {
  width: min(980px, 100%);
}

.template-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 1fr);
  gap: 16px;
}

.template-form-panel,
.template-list-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

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

.template-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
}

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

.template-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.template-main strong,
.template-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-main span {
  color: var(--muted);
  font-size: 0.84rem;
}

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

.spacer {
  flex: 1;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #052e2b;
  color: #ffffff;
  box-shadow: var(--shadow);
  font-weight: 800;
}

.toast.error {
  background: #7f1d1d;
}

.toast[hidden] {
  display: none;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 320px minmax(0, 1fr);
  }

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

  .task-edit-row {
    grid-template-columns: 34px repeat(8, minmax(0, 1fr)) 38px;
  }

  .task-title-field {
    grid-column: 2 / span 4;
  }

  .task-owner-field {
    grid-column: 6 / span 4;
  }

  .task-start-field {
    grid-column: 2 / span 2;
  }

  .task-end-field {
    grid-column: 4 / span 2;
  }

  .task-status-field {
    grid-column: 6 / span 2;
  }

  .progress-edit {
    grid-column: 8 / span 2;
  }

  .task-notes {
    grid-column: 2 / 10;
  }

  .task-remove-button {
    grid-column: 10;
    grid-row: 1 / span 3;
  }

  .member-grid,
  .template-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    padding: 10px;
  }

  .topbar,
  .detail-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .detail-actions,
  .task-title-toolbar,
  .gantt-title-row {
    justify-content: flex-start;
  }

  .task-title-toolbar,
  .gantt-title-row,
  .gantt-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .task-toolbar {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .segmented-control {
    width: 100%;
    grid-auto-columns: 1fr;
  }

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

  .project-sidebar {
    max-height: 420px;
  }

  .sidebar-tools,
  .summary-strip,
  .metrics-row,
  .form-grid,
  .gantt-preview-layout {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .task-edit-row {
    grid-template-columns: 34px 1fr;
  }

  .task-edit-row .field,
  .task-edit-row .danger-icon {
    grid-column: 2;
  }

  .task-row-number,
  .task-remove-button {
    grid-row: auto;
    align-self: end;
  }
}

@media (max-width: 560px) {
  .primary-button,
  .secondary-button,
  .ghost-button,
  .danger-button {
    width: 100%;
  }

  .topbar-actions,
  .detail-actions,
  .modal-footer {
    width: 100%;
  }

  .modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .spacer {
    display: none;
  }
}
