:root {
  --bg: #eef2f2;
  --surface: #ffffff;
  --ink: #1c2c30;
  --muted: #617276;
  --border: #d5e0e2;
  --primary: #0f6d73;
  --primary-soft: #e7f4f5;
  --plan: rgba(15, 109, 115, 0.18);
  --plan-border: #7aaeb2;
  --actual: #0f6d73;
  --delay: #b54a52;
  --delay-soft: #f8e8ea;
  --ok: #2a6b45;
  --warn: #8a5a12;
  --shadow: 0 10px 28px rgba(20, 42, 48, 0.08);
  --row-h: 84px;
  --label-w: 228px;
  --font: "IBM Plex Sans JP", "DM Sans", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(15, 109, 115, 0.08), transparent 42%),
    linear-gradient(180deg, #f4f7f7 0%, var(--bg) 100%);
}

button, input, select { font: inherit; }

.app {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 10px 12px 12px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  height: 100vh;
  min-height: 100vh;
  box-sizing: border-box;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

.brand-kicker {
  margin: 0 0 2px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary);
}

.brand h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.brand-sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.header-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.ctrl {
  display: grid;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}

.ctrl select,
.ctrl input,
.filters select {
  min-width: 160px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.anchor-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.anchor-nav input[type="date"] {
  min-width: 148px;
}

.btn-anchor {
  padding: 8px 10px;
  white-space: nowrap;
}

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: #f7fafa;
}

.view-btn {
  border: none;
  background: transparent;
  padding: 9px 14px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.view-btn.is-on {
  background: var(--primary);
  color: #fff;
}

.app-main {
  display: grid;
  grid-template-columns: minmax(460px, 520px) minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  height: 100%;
}

.pane {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.pane-gantt {
  min-width: 0;
}

.pane-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f8fbfb, #fff);
  flex-shrink: 0;
}

.pane-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.muted { color: var(--muted); margin: 4px 0 0; font-size: 0.82rem; }

.btn {
  border: none;
  border-radius: 12px;
  padding: 9px 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn.primary { background: var(--primary); color: #fff; }
.btn.ghost { background: #eef3f3; color: #355055; }
.btn-now { padding: 6px 12px; font-size: 0.8rem; }
.btn.danger { background: #f0d9dc; color: #8a3b42; }
.btn.btn-sm {
  padding: 4px 8px;
  font-size: 0.72rem;
  border-radius: 8px;
}

.btn.danger.btn-sm {
  margin-left: auto;
}

.pane-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.btn-edit,
.chip.edit {
  border: 1px solid rgba(15, 109, 115, 0.35);
  background: #e7f4f5;
  color: #0f6d73;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}

.btn-edit:hover,
.chip.edit:hover {
  background: #0f6d73;
  color: #fff;
}

.chip.edit {
  padding: 1px 7px;
  line-height: 1.4;
}

.th-order { width: 3.2rem; text-align: center; }

.order-cell {
  white-space: nowrap;
  vertical-align: middle;
  width: 3.2rem;
  padding-left: 8px !important;
  padding-right: 4px !important;
}

.order-btns {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}

.order-btns button {
  border: 1px solid var(--border);
  background: #fff;
  color: #355055;
  border-radius: 8px;
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.order-btns button:hover:not(:disabled) {
  background: #e7f4f5;
  border-color: rgba(15, 109, 115, 0.35);
  color: #0f6d73;
}

.order-btns button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.task-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  table-layout: fixed;
}

.task-table th:nth-child(2),
.task-table td:nth-child(2) {
  width: auto;
  min-width: 12em;
}

.task-table th:nth-child(3),
.task-table td:nth-child(3) {
  width: 4.5em;
}

.task-table th:nth-child(4),
.task-table td:nth-child(4) {
  width: 4.2em;
}

.task-table td:last-child {
  width: 7.5rem;
  white-space: nowrap;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafcfc;
}

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

.filters .check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 0.82rem;
  color: var(--ink);
}

.table-wrap {
  overflow: auto;
  flex: 1;
}

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

.task-table th {
  position: sticky;
  top: 0;
  background: #f7fafa;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  z-index: 1;
}

.task-table tbody tr {
  cursor: pointer;
  transition: background 120ms ease;
}

.task-table tbody tr:hover {
  background: #f7fbfb;
}

.task-table tbody tr.is-selected {
  background: #e7f4f5;
  box-shadow: inset 3px 0 0 var(--primary);
}

.task-table tbody tr.is-related {
  background: transparent;
  box-shadow: inset 3px 0 0 #b7c9cc;
}

.task-table tbody tr.is-related td:first-child .task-cat::after {
  content: " · 依存関連";
  color: var(--primary);
}

.task-table tbody tr.is-delayed {
  box-shadow: inset 3px 0 0 var(--delay);
  background: var(--delay-soft);
}

.task-table tbody tr.is-selected.is-delayed,
.task-table tbody tr.is-selected.is-related {
  background: #e7f4f5;
  box-shadow: inset 3px 0 0 var(--primary);
}

.task-name {
  font-weight: 700;
  margin: 0 0 2px;
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: normal;
}

.task-cat {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.badge.planned { background: #e8eef0; color: #4a5c60; }
.badge.in_progress { background: #e7f4f5; color: var(--primary); }
.badge.done { background: #dfeee5; color: var(--ok); }
.badge.delayed { background: #f0d9dc; color: var(--delay); }

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

.pane-head-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.layer-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: #f7fafa;
  gap: 0;
}

.layer-btn {
  border: none;
  background: transparent;
  padding: 8px 16px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  min-width: 72px;
}

.layer-btn.layer-plan {
  border-right: 1px solid var(--border);
}

/* 計画＝淡色＋破線イメージ / 実績＝濃色の塗り */
.layer-btn.layer-plan.is-on {
  background: #d8eef0;
  color: #0f6d73;
  box-shadow: inset 0 0 0 1.5px dashed #0f6d73;
}

.layer-btn.layer-actual.is-on {
  background: #0f6d73;
  color: #fff;
  box-shadow: none;
}

.layer-btn:not(.is-on) {
  background: #eef1f2;
  color: #9aa6a9;
  opacity: 0.75;
}

.layer-btn:not(.is-on):hover {
  opacity: 1;
  background: #e5ecee;
}

.layer-btn.is-on {
  /* .layer-plan / .layer-actual で上書き */
}

.leg {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.leg.plan {
  background: var(--plan);
  border-style: dashed;
  border-color: var(--plan-border);
}
.leg.actual { background: var(--actual); color: #fff; border-color: var(--actual); }
.leg.delay { background: var(--delay-soft); color: var(--delay); border-color: #e4b8bc; }
.leg.dep { background: #f3f6f6; color: #4a5c60; }
.leg.tone {
  border: none;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,0.12);
}

.gantt-swipe-hint {
  display: none;
  margin: 0;
  padding: 6px 12px 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.gantt-scroll {
  overflow: auto;
  flex: 1;
  position: relative;
  min-height: 0;
  background: #fbfcfc;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
}

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

.gantt-head,
.gantt-foot {
  display: flex;
  position: sticky;
  z-index: 6;
  background: #eef5f5;
  border-bottom: 1px solid var(--border);
  min-height: 42px;
}

.gantt-head { top: 0; }

.gantt-foot {
  bottom: 0;
  border-bottom: none;
  border-top: 1px solid var(--border);
}

.gantt-corner {
  position: sticky;
  left: 0;
  z-index: 7;
  flex: 0 0 var(--label-w);
  width: var(--label-w);
  padding: 10px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  background: #e4efef;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.gantt-tick {
  flex: 0 0 auto;
  border-right: 1px solid rgba(15, 109, 115, 0.14);
  padding: 8px 4px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #4a6368;
  background: linear-gradient(180deg, #f4fafb, #eaf3f3);
}

.gantt-tick.is-major {
  background: linear-gradient(180deg, #dff0f1, #d2e8e9);
  color: var(--primary);
}

.gantt-tick.is-weekend {
  background: linear-gradient(180deg, #fff4f0, #ffe8e0);
  color: #a85a45;
}

.gantt-stage {
  position: relative;
}

.gantt-grid {
  position: absolute;
  left: var(--label-w);
  top: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  display: flex;
}

.gantt-grid-line {
  flex: 0 0 auto;
  height: 100%;
  border-right: 1px solid rgba(15, 109, 115, 0.1);
  box-sizing: border-box;
}

.gantt-grid-line.is-major {
  border-right-color: rgba(15, 109, 115, 0.28);
  background: rgba(15, 109, 115, 0.03);
}

.gantt-grid-line.is-weekend {
  background: rgba(255, 140, 100, 0.06);
  border-right-color: rgba(200, 110, 80, 0.18);
}

.gantt-now {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: #e11d48;
  z-index: 6;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(225, 29, 72, 0.15);
}

.gantt-now-label {
  position: absolute;
  top: 6px;
  left: 6px;
  background: #e11d48;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.35);
}

.gantt-body {
  position: relative;
  z-index: 1;
}

.gantt-row {
  position: relative;
  display: flex;
  height: var(--row-h);
  border-bottom: 1px solid rgba(15, 109, 115, 0.08);
}

.gantt-row.is-delayed {
  background: rgba(181, 74, 82, 0.07);
}

.gantt-row.is-selected {
  background: rgba(15, 109, 115, 0.1);
}

.gantt-row.is-related {
  background: rgba(15, 109, 115, 0.04);
}

.gantt-row.is-flash,
.task-table tbody tr.is-flash {
  animation: gantt-flash 1.1s ease;
}

@keyframes gantt-flash {
  0%, 100% { box-shadow: none; }
  20%, 55% { box-shadow: inset 0 0 0 2px #f59e0b; background: rgba(245, 158, 11, 0.18); }
}

.gantt-row-label {
  position: sticky;
  left: 0;
  z-index: 4;
  flex: 0 0 var(--label-w);
  width: var(--label-w);
  padding: 6px 10px;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  box-shadow: 2px 0 6px rgba(20, 42, 48, 0.04);
  min-width: 0;
  overflow: hidden;
}

.gantt-row.is-selected .gantt-row-label {
  background: #eef8f8;
  box-shadow: inset 3px 0 0 var(--primary);
}

.gantt-row-name {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: normal;
}

.gantt-row-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
  max-height: 2.6em;
  overflow: hidden;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.4;
}

.chip.assignee { color: #fff; }
.chip.status { background: #e8eef0; color: #4a5c60; }
.chip.status.in_progress { background: #d9f0ff; color: #1b6f9a; }
.chip.status.done { background: #dfeee5; color: #2a6b45; }
.chip.status.delayed { background: #f0d9dc; color: #8a3b42; }
.chip.status.planned { background: #eceff3; color: #556069; }

.gantt-row-track {
  position: relative;
  flex: 1 0 auto;
  height: 100%;
}

.gantt-bars {
  position: absolute;
  inset: 6px 0;
  pointer-events: none;
}

.bar {
  position: absolute;
  top: 0;
  height: 22px;
  border-radius: 8px;
  min-width: 4px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0 8px;
}

.bar.plan {
  top: 0;
  background: color-mix(in srgb, var(--tone, #0f6d73) 16%, #fff);
  border: 2px dashed color-mix(in srgb, var(--tone, #0f6d73) 75%, #fff);
  z-index: 1;
  color: color-mix(in srgb, var(--tone, #0f6d73) 78%, #1c2c30);
}

.bar.actual {
  top: 26px;
  background: linear-gradient(90deg, var(--tone, #0f6d73), color-mix(in srgb, var(--tone, #0f6d73) 62%, #111));
  border: 2px solid color-mix(in srgb, var(--tone, #0f6d73) 85%, #000);
  z-index: 2;
  color: #fff;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--tone, #0f6d73) 35%, transparent);
}

.bar.actual.is-open {
  border-top-right-radius: 2px;
  border-bottom-right-radius: 2px;
  background: repeating-linear-gradient(
    -45deg,
    var(--tone, #0f6d73),
    var(--tone, #0f6d73) 8px,
    color-mix(in srgb, var(--tone, #0f6d73) 75%, #fff) 8px,
    color-mix(in srgb, var(--tone, #0f6d73) 75%, #fff) 16px
  );
}

/* 片方だけ表示するときはバーを中央に大きく */
.gantt-body.show-plan-only .bar.plan,
.gantt-body.show-actual-only .bar.actual {
  top: 10px;
  height: 36px;
  font-size: 0.75rem;
}

.gantt-body.show-plan-only .bar.actual,
.gantt-body.show-actual-only .bar.plan {
  display: none;
}

.bar-text {
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  max-width: 100%;
}

.bar-label {
  position: absolute;
  top: -2px;
  left: 0;
  transform: translateY(-100%);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--delay);
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
}

.gantt-hit {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: transparent;
  border: none;
  z-index: 5;
}

.gantt-arrows {
  position: absolute;
  left: var(--label-w);
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 5;
}

.gantt-arrows path {
  fill: none;
  stroke: #7a9498;
  stroke-width: 1.6;
  marker-end: url(#arrowHead);
  opacity: 0.75;
}

.gantt-arrows path.is-strong {
  stroke: var(--primary);
  stroke-width: 2.2;
  opacity: 1;
}

.app-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.stat {
  display: grid;
  gap: 2px;
  min-width: 100px;
}

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

.stat strong {
  font-size: 1.05rem;
  color: var(--primary);
}

.stat.note {
  flex: 1;
  min-width: 220px;
}

.stat.note span {
  font-weight: 500;
  color: var(--muted);
}

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

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

.modal {
  width: min(640px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 48px rgba(20, 42, 48, 0.2);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 { margin: 0; font-size: 1.1rem; }

.icon-btn {
  border: none;
  background: #eef3f3;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--ink);
}

.modal-body { padding: 16px; }

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

.form-grid label {
  display: grid;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.form-grid .full { grid-column: 1 / -1; }

.form-grid input,
.form-grid select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fff;
}

.hint {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
}

.delay-info {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7fafa;
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
}

.delay-info.is-late {
  background: var(--delay-soft);
  border-color: #e4b8bc;
  color: var(--delay);
}

.modal-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}

.modal-actions .spacer { flex: 1; }

.modal-report { width: min(720px, 100%); }

.report-task-name {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.report-history,
.report-form {
  margin-top: 14px;
}

.report-history h3,
.report-form h3 {
  margin: 0 0 10px;
  font-size: 0.92rem;
}
.voice-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.btn.is-rec {
  background: #f0d9dc;
  color: #8a3b42;
  border-color: #e4c9b0;
}

.report-empty {
  color: var(--muted);
  font-size: 0.86rem;
  padding: 10px 12px;
  background: #f7fafa;
  border-radius: 10px;
  border: 1px dashed var(--border);
}

.report-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
}

.report-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.84rem;
}

.report-card-head .who { font-weight: 700; }
.report-card-head .when { color: var(--muted); }
.report-card-head .pct {
  margin-left: auto;
  background: #e7f4f5;
  color: #0f6d73;
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 800;
  font-size: 0.78rem;
}

.report-card-note {
  margin: 0 0 8px;
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.5;
}

.report-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-photos button {
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
}

.report-photos img,
.report-photo-draft img {
  width: 88px;
  height: 66px;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.report-photo-draft {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-photo-draft .draft-item {
  position: relative;
}

.report-photo-draft .draft-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: none;
  background: #8a3b42;
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
}

.badge-report {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #fff4e5;
  color: #9a5b14;
  border: 1px solid #f0d4a8;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.68rem;
  font-weight: 800;
  margin-top: 4px;
  vertical-align: middle;
  max-width: 100%;
  white-space: nowrap;
}

.btn-report {
  border: 1px solid rgba(154, 91, 20, 0.35);
  background: #fff7ec;
  color: #9a5b14;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}

.btn-report:hover {
  background: #9a5b14;
  color: #fff;
}

.chip.report {
  border: 1px solid rgba(154, 91, 20, 0.35);
  background: #fff7ec;
  color: #9a5b14;
  border-radius: 999px;
  padding: 1px 7px;
  line-height: 1.4;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}

.chip.report:hover {
  background: #9a5b14;
  color: #fff;
}

.task-actions {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
}

.photo-lightbox {
  position: relative;
  max-width: min(920px, 100%);
  max-height: calc(100vh - 40px);
  background: #0b1c20;
  border-radius: 14px;
  padding: 12px;
}

.photo-lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 80px);
  margin: 0 auto;
  border-radius: 8px;
}

.photo-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

@media (max-width: 980px) {
  :root { --label-w: 128px; }
  .app {
    height: auto;
    min-height: 100vh;
    grid-template-rows: auto auto auto;
  }
  .app-main {
    grid-template-columns: 1fr;
    height: auto;
  }
  .pane-list { max-height: 220px; }
  .pane-gantt { min-height: 72vh; height: 72vh; }
  .gantt-swipe-hint { display: block; }
  .gantt-row-label .chip.edit,
  .gantt-row-label .chip.report { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}
