@import url("./design-system.css");

:root {
  --green: #2f6b50;
  --shadow-float: 0 18px 48px rgba(35, 25, 29, 0.12), 0 2px 8px rgba(35, 25, 29, 0.05);
  --ease-move: var(--ease-in-out);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font: 100%/1.5 var(--sans);
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body { margin: 0; background: var(--canvas); }
button, input { font: inherit; }
button { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
input { font-size: max(1rem, 16px); }
svg { display: block; }

.module-preview { padding: 24px; }

.roadmap-module {
  width: min(1480px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(45, 36, 40, 0.08);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-module);
}

html.is-embedded,
html.is-embedded body { background: var(--surface); }
html.is-embedded .module-preview { padding: 0; }
html.is-embedded .roadmap-module {
  width: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.module-header {
  display: grid;
  min-height: 82px;
  grid-template-columns: minmax(250px, 1fr) minmax(230px, 340px) minmax(370px, 1fr);
  align-items: center;
  gap: 28px;
  padding: 16px 20px 16px 24px;
}

.module-title { display: flex; min-width: 0; align-items: center; gap: 12px; }
.title-mark { width: 5px; height: 24px; border-radius: 999px; background: var(--accent); }
.module-header h1 { margin: 0; font-size: clamp(1.35rem, 2vw, 1.7rem); font-weight: 680; line-height: 1.08; letter-spacing: -0.035em; }

.overall-progress {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 4px 16px;
  padding: 2px 2px 12px;
}
.overall-progress > span { color: var(--secondary); font-size: 0.75rem; font-weight: 620; }
.overall-progress strong { font-size: 1.12rem; font-weight: 720; font-variant-numeric: tabular-nums; letter-spacing: -0.025em; }
.overall-progress i { position: absolute; right: 2px; bottom: 2px; left: 2px; height: 4px; overflow: hidden; border-radius: 999px; background: rgba(45, 36, 40, 0.09); }
.overall-progress i b { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--accent); transform: scaleX(0); transform-origin: left center; transition: transform 200ms var(--ease-out); }

.header-tools { position: relative; display: flex; min-width: 0; align-items: center; justify-content: flex-end; }
.sync-state { position: absolute; right: calc(100% + 12px); display: inline-flex; min-width: max-content; align-items: center; gap: 7px; color: var(--tertiary); font-size: 0.7rem; font-weight: 560; transition: opacity 140ms ease, visibility 140ms ease; }
.sync-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--tertiary); transition: background-color 160ms ease, box-shadow 160ms ease; }
.sync-state[data-state="saved"] { visibility: hidden; opacity: 0; pointer-events: none; }
.sync-state[data-state="saving"] i, .sync-state[data-state="loading"] i { background: var(--gold); box-shadow: 0 0 0 4px rgba(181, 138, 69, 0.09); }
.sync-state[data-state="error"] { color: var(--danger); }
.sync-state[data-state="error"] i { background: var(--danger); box-shadow: 0 0 0 4px rgba(179, 58, 63, 0.09); }

.view-switch { display: inline-flex; gap: 2px; padding: 4px; border-radius: 12px; background: #efede9; box-shadow: inset 0 0 0 1px rgba(35, 25, 29, 0.025); }
.view-button { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--secondary); font-size: 0.72rem; font-weight: 580; cursor: pointer; }
.view-button svg, .quiet-button svg, .icon-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.view-button.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(35, 25, 29, 0.10), 0 4px 12px rgba(35, 25, 29, 0.05); }

.status-dashboard { display: grid; grid-template-columns: minmax(590px, 1.22fr) minmax(470px, 0.78fr); min-height: 252px; border-top: 1px solid var(--line-soft); }
.countdown-column { display: grid; grid-template-rows: 1fr auto; gap: 20px; padding: 25px 32px 24px; border-right: 1px solid var(--line-soft); }
.countdown { display: grid; min-width: 0; align-content: space-between; gap: 13px; }
.countdown > span { color: var(--accent); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; }
.countdown > strong { display: flex; min-width: 0; align-items: baseline; justify-content: center; gap: clamp(8px, 0.9vw, 14px); font-variant-numeric: tabular-nums; white-space: nowrap; }
.time-part { display: inline-flex; align-items: baseline; gap: 3px; color: var(--ink); }
.time-part b { font-size: clamp(4.2rem, 5.4vw, 5.35rem); line-height: 0.88; font-weight: 700; letter-spacing: -0.065em; }
.time-part small { color: var(--secondary); font-size: 0.72rem; font-weight: 590; }
.time-part.is-days b { color: var(--accent); }

.pinned-node {
  display: grid;
  width: 100%;
  min-height: 58px;
  grid-template-columns: 8px auto 1fr 20px;
  align-items: center;
  gap: 12px;
  padding: 8px 15px;
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  background: var(--surface-soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.pinned-signal { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.pinned-label { color: var(--secondary); font-size: 0.72rem; font-weight: 620; }
.pinned-node strong { display: flex; min-width: 0; align-items: baseline; gap: 12px; }
.pinned-node strong b { color: var(--ink); font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.035em; }
.pinned-node strong span { overflow: hidden; font-size: 0.92rem; font-weight: 640; text-overflow: ellipsis; white-space: nowrap; }
.pinned-node svg { width: 17px; height: 17px; fill: none; stroke: var(--tertiary); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.owner-progress-panel { padding: 28px 30px 24px; }
.owner-progress-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.owner-progress-panel > header div { display: grid; gap: 3px; }
.owner-progress-panel > header div > span { font-size: 0.9rem; font-weight: 680; letter-spacing: -0.012em; }
.owner-progress-panel > header small { color: var(--tertiary); font-size: 0.72rem; }
.scope-badge { padding: 5px 8px; border-radius: 99px; background: var(--surface-muted); color: var(--secondary); font-size: 0.68rem; font-weight: 600; }
.owner-progress-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 28px; }
.owner-progress-item { display: grid; grid-template-columns: 29px 1fr auto; align-items: center; gap: 9px; }
.owner-avatar { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 50%; background: #ebe7e4; color: var(--accent); font-size: 0.68rem; font-weight: 720; }
.owner-progress-item strong { overflow: hidden; font-size: 0.78rem; font-weight: 640; text-overflow: ellipsis; white-space: nowrap; }
.owner-progress-item > b { color: var(--secondary); font-size: 0.75rem; font-weight: 680; font-variant-numeric: tabular-nums; }
.owner-progress-item i { grid-column: 2 / 4; height: 4px; overflow: hidden; border-radius: 999px; background: rgba(45, 36, 40, 0.08); }
.owner-progress-item i b { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--accent); transform: scaleX(0); transform-origin: left center; transition: transform 200ms var(--ease-out); }

.flow-section { border-top: 1px solid var(--line-soft); background: var(--surface-soft); }
.flow-header { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 24px; }
.flow-header > div { display: flex; align-items: baseline; gap: 12px; }
.flow-header h2 { margin: 0; font-size: 0.92rem; font-weight: 680; letter-spacing: -0.015em; }
.flow-header > div span { color: var(--tertiary); font-size: 0.72rem; }
.quiet-button, .primary-button, .danger-button, .text-button, .icon-button, .remove-action { border: 0; cursor: pointer; }
.quiet-button { display: inline-flex; min-height: 35px; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 254, 250, 0.88); color: var(--ink); font-size: 0.73rem; font-weight: 590; }

.view-host { min-height: 225px; border-top: 1px solid var(--line-soft); }
.node-viewport { position: relative; }
.node-scroll { overflow-x: auto; overscroll-behavior-inline: contain; padding: 20px 24px; scrollbar-width: none; -ms-overflow-style: none; }
.node-scroll::-webkit-scrollbar { display: none; }
.node-track { position: relative; display: flex; width: max-content; min-width: 100%; align-items: flex-start; gap: 0; }
.node-unit { position: relative; width: 276px; flex: 0 0 276px; }
.node-unit:not(:last-of-type)::after { position: absolute; z-index: 0; top: 78px; left: 100%; width: 24px; height: 10px; border: 1px solid rgba(107, 33, 57, 0.18); border-right: 0; border-left: 0; background: rgba(107, 33, 57, 0.025); content: ""; }
.node-unit:not(:last-of-type)::before { position: absolute; z-index: 1; top: 80px; left: calc(100% + 2px); width: 20px; height: 6px; background: repeating-linear-gradient(135deg, transparent 0 4px, rgba(107, 33, 57, 0.48) 4px 5.5px, transparent 5.5px 9px); content: ""; }

.node-card {
  position: relative;
  z-index: 2;
  display: grid;
  width: 276px;
  min-height: 166px;
  grid-template-rows: auto 1fr auto;
  padding: 18px 19px 17px;
  overflow: hidden;
  border: 1px solid rgba(45, 36, 40, 0.09);
  border-radius: 21px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(35, 25, 29, 0.03), 0 9px 24px rgba(35, 25, 29, 0.04);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 180ms ease, transform 120ms var(--ease-out);
}
.node-card::after { position: absolute; right: 19px; bottom: 18px; width: 18px; height: 8px; border-bottom: 1.5px solid currentColor; content: ""; opacity: 0.34; }
.node-unit.is-current .node-card { border-color: transparent; background: linear-gradient(145deg, #6f2740, #481626); color: #fff; box-shadow: 0 14px 32px rgba(84, 27, 47, 0.18); }
.node-unit.is-complete .node-card { border-color: rgba(47, 107, 80, 0.18); background: #f8fbf8; }
.node-unit.is-overdue .node-card { border-color: rgba(179, 58, 63, 0.22); background: #fff8f7; }
.node-unit.is-selected .node-card { border-color: rgba(107, 33, 57, 0.52); box-shadow: 0 0 0 3px rgba(107, 33, 57, 0.09), 0 13px 30px rgba(35, 25, 29, 0.08); }
.node-unit.is-current.is-selected .node-card { border-color: rgba(255, 255, 255, 0.35); box-shadow: 0 0 0 3px rgba(107, 33, 57, 0.12), 0 16px 34px rgba(84, 27, 47, 0.22); }
.node-meta { display: flex; align-items: center; justify-content: space-between; }
.node-meta-end { display: inline-flex; align-items: center; gap: 8px; }
.node-pin { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 7px; background: var(--accent-soft); color: var(--accent); }
.node-pin svg { width: 10px; height: 10px; fill: currentColor; }
.node-card time { color: var(--secondary); font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.node-index { color: var(--tertiary); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; }
.node-unit.is-current .node-card time, .node-unit.is-current .node-index { color: rgba(255, 255, 255, 0.68); }
.node-unit.is-current .node-pin { background: rgba(255, 255, 255, 0.14); color: #fff; }
.node-card > strong { align-self: center; max-width: 220px; font-size: 1.16rem; font-weight: 690; line-height: 1.3; letter-spacing: -0.025em; }
.node-progress { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.72rem; }
.node-progress b { min-width: 40px; font-size: 0.76rem; font-weight: 680; font-variant-numeric: tabular-nums; text-align: right; }
.node-progress i { width: 116px; height: 4px; overflow: hidden; border-radius: 999px; background: rgba(45, 36, 40, 0.10); }
.node-progress i span { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--accent); transform: scaleX(0); transform-origin: left center; transition: transform 200ms var(--ease-out); }
.node-unit.is-current .node-progress i { background: rgba(255, 255, 255, 0.20); }
.node-unit.is-current .node-progress i span { background: #fff; }

.insert-zone { position: relative; width: 24px; min-height: 166px; flex: 0 0 24px; }
.insert-zone button { position: absolute; z-index: 8; top: 68px; left: 50%; display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid rgba(107, 33, 57, 0.18); border-radius: 50%; background: var(--surface); color: var(--accent); box-shadow: 0 6px 18px rgba(35, 25, 29, 0.10); opacity: 0; pointer-events: none; cursor: pointer; transform: translateX(-50%) scale(0.92); transition: opacity 120ms ease, transform 160ms var(--ease-out); }
.insert-zone svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.node-scroll.is-ctrl .insert-zone { width: 38px; flex-basis: 38px; }
.node-scroll.is-ctrl .node-unit:not(:last-of-type)::after { width: 38px; }
.node-scroll.is-ctrl .node-unit:not(:last-of-type)::before { width: 34px; }
.node-scroll.is-ctrl .insert-zone button { opacity: 1; pointer-events: auto; transform: translateX(-50%) scale(1); }


.list-view { display: grid; gap: 1px; padding: 10px 16px 16px; }
.list-head, .list-row { display: grid; grid-template-columns: 90px minmax(220px, 1fr) minmax(160px, 0.65fr) 150px 32px; align-items: center; gap: 16px; }
.list-head { padding: 8px 16px; color: var(--tertiary); font-size: 0.68rem; font-weight: 620; }
.list-row { min-height: 62px; padding: 10px 16px; border: 1px solid transparent; border-radius: 14px; background: rgba(255, 254, 250, 0.64); cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease, transform 100ms var(--ease-out); }
.list-row.is-selected { border-color: rgba(107, 33, 57, 0.22); background: var(--surface); }
.list-row time { color: var(--accent); font-size: 0.78rem; font-weight: 700; }
.list-row strong { font-size: 0.86rem; font-weight: 650; }
.list-row > span { overflow: hidden; color: var(--secondary); font-size: 0.75rem; text-overflow: ellipsis; white-space: nowrap; }
.list-row .node-progress i { width: 85px; }
.list-arrow { width: 17px; height: 17px; fill: none; stroke: var(--tertiary); stroke-width: 1.7; }

.gantt-view { display: grid; gap: 10px; padding: 18px 20px 22px; }
.gantt-row { display: grid; grid-template-columns: 92px minmax(160px, 240px) 1fr 60px; align-items: center; gap: 15px; min-height: 42px; }
.gantt-row time { color: var(--secondary); font-size: 0.75rem; font-weight: 680; }
.gantt-row strong { overflow: hidden; font-size: 0.78rem; font-weight: 630; text-overflow: ellipsis; white-space: nowrap; }
.gantt-track { position: relative; height: 26px; overflow: hidden; border-radius: 8px; background: #ece9e6; }
.gantt-track::before { position: absolute; inset: 0; background-image: linear-gradient(90deg, transparent 24.5%, rgba(45, 36, 40, 0.07) 25%, transparent 25.5%, transparent 49.5%, rgba(45, 36, 40, 0.07) 50%, transparent 50.5%, transparent 74.5%, rgba(45, 36, 40, 0.07) 75%, transparent 75.5%); content: ""; }
.gantt-bar { position: absolute; top: 4px; bottom: 4px; left: var(--bar-left); width: var(--bar-width); min-width: 18px; border: 0; border-radius: 6px; background: #cfc8c8; cursor: pointer; }
.gantt-bar.is-current { background: var(--accent); }
.gantt-bar.is-selected { box-shadow: 0 0 0 3px rgba(107, 33, 57, 0.12); }
.gantt-row > b { color: var(--secondary); font-size: 0.73rem; font-weight: 680; font-variant-numeric: tabular-nums; text-align: right; }

.action-stage { border-top: 1px solid var(--line-soft); background: var(--surface); }
.action-stage.is-updating .action-stage-head, .action-stage.is-updating .action-stage-body { opacity: 0.52; transform: translateY(3px); }
.action-stage-head, .action-stage-body { transition: opacity 150ms ease, transform 180ms var(--ease-out); }
.action-stage-head { display: flex; min-height: 78px; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 24px; border-bottom: 1px solid var(--line-soft); }
.action-stage-title { display: grid; gap: 4px; }
.stage-kicker { color: var(--accent); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.035em; }
.action-stage-title h2 { margin: 0; font-size: 1.18rem; font-weight: 690; letter-spacing: -0.025em; }
.action-stage-meta { display: flex; align-items: center; gap: 9px; }
.action-stage-meta > span { color: var(--secondary); font-size: 0.74rem; }
.action-stage-meta > strong { min-width: 58px; font-size: 0.84rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.icon-button { display: grid; width: 34px; height: 34px; place-items: center; padding: 0; border-radius: 10px; background: transparent; color: var(--secondary); }
.icon-button.is-active { background: rgba(181, 138, 69, 0.12); color: #8b6429; }
.action-stage-body { padding: 8px 24px 20px; }
.action-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
.action-item { display: grid; min-height: 49px; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: start; gap: 9px; padding: 11px 2px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.action-item input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
.action-copy { display: grid; gap: 2px; }
.action-copy > span { font-size: 0.79rem; line-height: 1.5; }
.action-copy small { color: var(--tertiary); font-size: 0.68rem; }
.action-order { margin-top: 2px; color: #b3adaf; font-size: 0.63rem; font-variant-numeric: tabular-nums; }
.action-item:has(input:checked) .action-copy > span { color: var(--tertiary); text-decoration: line-through; text-decoration-thickness: 1px; }
.action-item:has(input:checked) .action-copy small { opacity: 0.72; }

.all-action-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding-top: 4px; }
.action-group { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-soft); }
.action-group > header { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 13px; border-bottom: 1px solid var(--line-soft); }
.action-group > header div { display: grid; gap: 2px; }
.action-group > header span { color: var(--accent); font-size: 0.66rem; font-weight: 700; }
.action-group > header strong { font-size: 0.78rem; font-weight: 660; }
.action-group > header b { font-size: 0.72rem; font-weight: 680; font-variant-numeric: tabular-nums; }
.action-group .action-list { display: grid; grid-template-columns: 1fr; padding: 0 11px 7px; }

.node-editor { width: min(730px, calc(100vw - 28px)); max-height: min(780px, calc(100vh - 28px)); padding: 0; border: 1px solid rgba(255, 255, 255, 0.72); border-radius: 22px; background: rgba(255, 255, 255, 0.94); color: var(--ink); box-shadow: 0 32px 100px rgba(0, 0, 0, 0.24); backdrop-filter: blur(30px) saturate(170%); }
.node-editor::backdrop { background: rgba(29, 22, 25, 0.28); backdrop-filter: blur(4px); }
.node-editor[open] { animation: none; }
.node-editor form { display: grid; max-height: inherit; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.node-editor form > header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid var(--line-soft); }
.node-editor form > header span { color: var(--accent); font-size: 0.67rem; font-weight: 700; letter-spacing: 0.08em; }
.node-editor form > header h2 { margin: 3px 0 0; font-size: 1.28rem; font-weight: 690; letter-spacing: -0.025em; }
.editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; padding: 17px 20px; }
.editor-fields label { display: grid; gap: 6px; color: var(--secondary); font-size: 0.7rem; font-weight: 600; }
.editor-fields input, .editor-action-row input { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: rgba(255, 255, 255, 0.86); color: var(--ink); }
.editor-fields input:focus, .editor-action-row input:focus { border-color: rgba(107, 33, 57, 0.46); box-shadow: 0 0 0 3px rgba(107, 33, 57, 0.08); }
.editor-actions { min-height: 0; overflow: auto; padding: 0 20px 18px; }
.editor-section-title { position: sticky; z-index: 3; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 11px 0; background: rgba(255, 255, 255, 0.94); }
.editor-section-title h3 { margin: 0; font-size: 0.82rem; }
.text-button { padding: 5px 0; background: transparent; color: var(--accent); font-size: 0.72rem; font-weight: 620; }
.editor-action-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(120px, 0.34fr) 30px; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line-soft); }
.editor-action-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.editor-action-row input { min-height: 36px; font-size: 0.76rem; }
.remove-action { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; background: transparent; color: var(--tertiary); }
.remove-action svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.node-editor form > footer { display: grid; grid-template-columns: auto 1fr auto auto; gap: 9px; padding: 14px 20px 18px; border-top: 1px solid var(--line-soft); }
.primary-button, .danger-button { min-height: 38px; padding: 0 15px; border-radius: 10px; font-size: 0.75rem; font-weight: 620; }
.primary-button { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(107, 33, 57, 0.18); }
.danger-button { border: 1px solid rgba(179, 58, 63, 0.18); background: rgba(179, 58, 63, 0.06); color: var(--danger); }

@media (hover: hover) and (pointer: fine) {
  .view-button, .quiet-button, .icon-button, .primary-button, .danger-button, .pinned-node, .remove-action { transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease, transform 120ms var(--ease-out), box-shadow 160ms ease; }
  .view-button:not(.is-active):hover { color: var(--ink); }
  .quiet-button:hover, .icon-button:hover, .remove-action:hover { background: #e9e6e3; color: var(--ink); }
  .pinned-node:hover { border-color: rgba(107, 33, 57, 0.16); background: var(--surface-muted); }
  .node-card:hover { border-color: rgba(107, 33, 57, 0.22); background: #fffcf8; }
  .node-unit.is-current .node-card:hover { background: linear-gradient(145deg, #762c46, #4a1728); }
  .list-row:hover { border-color: rgba(107, 33, 57, 0.12); background: var(--surface); }
  .action-item:hover { background: linear-gradient(90deg, rgba(107, 33, 57, 0.035), transparent); }
  button:active, .list-row:active, .node-card:active { transform: scale(0.985); transition-duration: 100ms; }
}

@media (max-width: 1040px) {
  .module-header { grid-template-columns: minmax(220px, 1fr) minmax(210px, 300px); }
  .header-tools { grid-column: 1 / -1; justify-content: space-between; }
  .status-dashboard { grid-template-columns: 1fr; }
  .countdown-column { border-right: 0; border-bottom: 1px solid var(--line-soft); }
}

@media (max-width: 760px) {
  .module-preview { padding: 9px; }
  .roadmap-module { border-radius: 20px; }
  .module-header { grid-template-columns: 1fr; gap: 16px; padding: 18px; }
  .overall-progress { grid-row: 2; }
  .header-tools { grid-column: 1; grid-row: 3; }
  .sync-state { display: none; }
  .view-switch { width: 100%; }
  .view-button { flex: 1; }
  .countdown-column { padding: 23px 18px 18px; }
  .countdown { gap: 14px; }
  .countdown > strong { width: 100%; justify-content: space-between; gap: 5px; }
  .time-part b { font-size: clamp(2rem, 10.5vw, 3.6rem); }
  .pinned-node { grid-template-columns: 8px 1fr 18px; }
  .pinned-label { display: none; }
  .pinned-node strong { gap: 9px; }
  .pinned-node strong b { font-size: 1.28rem; }
  .pinned-node strong span { font-size: 0.9rem; }
  .owner-progress-panel { padding: 22px 18px; }
  .owner-progress-grid { gap: 15px 18px; }
  .flow-header { padding: 10px 15px; }
  .flow-header > div span { display: none; }
  .node-scroll { padding-right: 15px; padding-left: 15px; }
  .action-stage-head { align-items: flex-start; padding: 15px 17px; }
  .action-stage-meta > span { display: none; }
  .action-stage-body { padding: 6px 17px 17px; }
  .action-list, .all-action-groups { grid-template-columns: 1fr; }
  .list-head { display: none; }
  .list-view { padding: 10px; }
  .list-row { grid-template-columns: 66px 1fr 28px; gap: 10px; }
  .list-row > span, .list-row .node-progress { display: none; }
  .gantt-row { grid-template-columns: 68px minmax(110px, 180px) 1fr; gap: 8px; }
  .gantt-row > b { display: none; }
  .editor-fields { grid-template-columns: 1fr; }
  .editor-action-row { grid-template-columns: 20px minmax(0, 1fr) 28px; }
  .editor-action-row .action-owner { grid-column: 2 / 3; }
}

@media (max-width: 480px) {
  .owner-progress-grid { grid-template-columns: 1fr; }
  .flow-header .quiet-button span { display: none; }
  .flow-header .quiet-button { width: 36px; justify-content: center; padding: 0; }
  .action-stage-meta > strong { min-width: 48px; }
}

@media (prefers-reduced-transparency: reduce) {
  .node-editor { background: #fff; backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  .roadmap-module, .node-card, .action-group, .node-editor { border-color: rgba(0, 0, 0, 0.42); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .node-card, .view-button, .quiet-button, .icon-button, .primary-button, .danger-button, .pinned-node, .list-row, .insert-zone, .insert-zone button { transition-property: color, background-color, border-color, opacity !important; transition-duration: 140ms !important; transform: none !important; }
  .overall-progress i b, .owner-progress-item i b, .node-progress i span { transition: none; }
}
