:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-soft: #f7f9f7;
  --line: #d9e0da;
  --line-strong: #c7d0c9;
  --text: #17221d;
  --muted: #66736b;
  --sidebar: #12231d;
  --sidebar-line: #30423a;
  --teal: #167763;
  --teal-hover: #0f6654;
  --teal-soft: #e4f3ed;
  --blue: #2762a4;
  --blue-soft: #eaf2fb;
  --amber: #9b6511;
  --amber-soft: #fff3d6;
  --red: #a5352c;
  --red-soft: #fff0ee;
  --green: #18794e;
  --shadow: 0 10px 28px rgba(25, 39, 31, 0.06);
  --sidebar-width: 264px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

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

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 28px 16px 18px;
  background: var(--sidebar);
  color: #f2f7f4;
  border-right: 1px solid #263a32;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 64px;
  padding: 0 5px 22px;
}

.brand-mark {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #eef5f1;
  color: var(--sidebar);
  font-size: 25px;
  font-weight: 900;
}

.sidebar-brand span,
.sidebar-brand strong,
.sidebar-status strong,
.sidebar-status small {
  display: block;
}

.sidebar-brand span {
  margin-bottom: 3px;
  color: #92b9a8;
  font-size: 12px;
  font-weight: 750;
}

.sidebar-brand strong {
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: 0;
}

.sidebar-nav {
  display: grid;
  gap: 7px;
}

.nav-item {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #dce9e2;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: #1a3027;
  border-color: var(--sidebar-line);
}

.nav-item.active {
  background: #f7faf7;
  border-color: #f7faf7;
  color: var(--text);
}

.nav-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
}

.nav-item.active .nav-icon {
  background: var(--teal-soft);
  color: var(--teal);
}

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

.nav-item strong,
.nav-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item strong {
  font-size: 14px;
  line-height: 1.3;
}

.nav-item small {
  margin-top: 4px;
  color: #91a49a;
  font-size: 11px;
}

.nav-item.active small {
  color: var(--muted);
}

.sidebar-status {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 15px 9px 5px;
  color: #c9d8d0;
}

.sidebar-status strong {
  font-size: 12px;
}

.sidebar-status small {
  margin-top: 3px;
  color: #799087;
  font-size: 11px;
}

.connection-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d6a22e;
  box-shadow: 0 0 0 3px rgba(214, 162, 46, 0.15);
}

.connection-dot.good {
  background: #42b883;
  box-shadow: 0 0 0 3px rgba(66, 184, 131, 0.16);
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(22px, 3vw, 44px);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--line);
}

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

.page-heading h1 {
  margin: 4px 0 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
  letter-spacing: 0;
}

.page-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  display: block;
  color: var(--teal);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.top-actions,
.button-row,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-label {
  margin-right: 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.menu-button {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.menu-button svg {
  width: 20px;
  height: 20px;
}

.content {
  width: min(1500px, 100%);
  padding: 24px clamp(22px, 3vw, 44px) 42px;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: view-enter 0.18s ease-out;
}

@keyframes view-enter {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.rhythm-panel,
.quick-panel {
  grid-column: 1 / 2;
}

.pulse-panel {
  grid-column: 2 / 3;
  grid-row: 1 / span 2;
}

.panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.narrow-panel {
  width: min(860px, 100%);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 4px 0 0;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #edf1ee;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.status-pill.good {
  background: var(--teal-soft);
  color: var(--teal);
}

.status-pill.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-pill.bad {
  background: var(--red-soft);
  color: var(--red);
}

.icon-button,
.small-button,
.deploy-button,
.quick-link {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.icon-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  font-weight: 750;
}

.icon-button svg,
.small-button svg,
.deploy-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.icon-button:hover,
.small-button:hover,
.deploy-button:hover,
.quick-link:hover {
  border-color: #a8b5ac;
  background: var(--surface-soft);
}

.icon-button:active,
.small-button:active,
.deploy-button:active,
.quick-link:active {
  transform: translateY(1px);
}

.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.primary:hover {
  border-color: var(--teal-hover);
  background: var(--teal-hover);
}

.small-button {
  min-height: 34px;
  padding: 0 11px;
  font-weight: 750;
}

.small-button.ghost {
  background: var(--surface-soft);
  color: var(--muted);
}

.small-button:disabled,
.deploy-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.rhythm-grid {
  display: grid;
  grid-template-columns: 190px minmax(220px, 1fr);
  gap: 14px;
}

.focus-box {
  min-height: 154px;
  display: grid;
  align-content: center;
  gap: 11px;
  padding: 16px;
  border: 1px solid #bdd8ce;
  border-radius: 8px;
  background: var(--teal-soft);
}

.focus-box span,
.today-goal label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.focus-box strong {
  font-size: 36px;
  line-height: 1;
  letter-spacing: 0;
}

.today-goal {
  display: grid;
  align-content: start;
  gap: 9px;
  padding-top: 4px;
}

.today-goal p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.today-goal input,
.task-form input,
.task-form select,
.notes-panel textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

.today-goal input {
  min-height: 46px;
  padding: 0 13px;
}

.today-goal input:focus,
.task-form input:focus,
.task-form select:focus,
.notes-panel textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(22, 119, 99, 0.12);
}

.pulse-list {
  display: grid;
  gap: 10px;
}

.pulse-item {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.pulse-item strong {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 14px;
}

.pulse-item code,
.command-item code {
  display: block;
  overflow-wrap: anywhere;
  color: #3c4d44;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

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

.quick-link {
  min-height: 112px;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 13px;
  text-align: left;
}

.quick-link > span {
  color: var(--teal);
  font: 800 12px/1.2 "SFMono-Regular", Consolas, monospace;
}

.quick-link strong {
  font-size: 14px;
}

.quick-link small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.workflow {
  display: grid;
}

.flow-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 15px 2px;
  border-bottom: 1px solid #e8ede9;
}

.flow-step:last-child {
  border-bottom: 0;
}

.flow-step input {
  width: 19px;
  height: 19px;
  margin: 2px 0 0;
  accent-color: var(--teal);
}

.flow-step strong,
.flow-step small {
  display: block;
}

.flow-step strong {
  font-size: 14px;
}

.flow-step small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.mvp-page-head {
  margin-bottom: 14px;
}

.mvp-hero {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(300px, 0.9fr);
  gap: 18px;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid #b8dacd;
  border-radius: 10px;
  background: linear-gradient(135deg, #edf8f3 0%, #f7fbf8 72%);
}

.mvp-hero > div > strong {
  display: block;
  max-width: 650px;
  font-size: 18px;
  line-height: 1.55;
}

.mvp-hero p {
  margin: 9px 0 0;
  color: #4a6258;
  font-size: 13px;
  line-height: 1.7;
}

.mvp-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mvp-role-grid span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #d6e8df;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.mvp-role-grid b {
  color: var(--teal);
  font-size: 12px;
}

.mvp-role-grid small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.mvp-section {
  margin-top: 28px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.mvp-section-title {
  margin-bottom: 14px;
}

.mvp-section-title h3 {
  margin: 4px 0 0;
  font-size: 19px;
}

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

.mvp-gates article {
  position: relative;
  min-height: 166px;
  padding: 17px 15px 14px;
  border: 1px solid #dce7e1;
  border-radius: 9px;
  background: var(--surface-soft);
}

.mvp-gates article > span {
  display: block;
  margin-bottom: 10px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
}

.mvp-gates strong {
  font-size: 15px;
}

.mvp-gates p {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.mvp-gates em {
  position: absolute;
  right: 13px;
  bottom: 12px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #e1eee8;
  color: #28664e;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.mvp-tip {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--amber);
  border-radius: 5px;
  background: var(--amber-soft);
  color: #73521d;
  font-size: 12px;
  line-height: 1.65;
}

.mvp-flow-diagram {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 22px minmax(150px, 1.1fr) 22px minmax(130px, 1fr) 22px minmax(160px, 1.15fr) 22px minmax(150px, 1.1fr) 22px minmax(145px, 1.05fr);
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding: 3px 2px 8px;
}

.mvp-flow-node {
  min-width: 130px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 13px 12px;
  border: 1px solid #bfd8ce;
  border-radius: 8px;
  background: #f7fbf8;
}

.mvp-flow-node.gate {
  border-color: #e2c789;
  background: var(--amber-soft);
}

.mvp-flow-node.primary-node {
  border-color: #9ccbbd;
  background: var(--teal-soft);
}

.mvp-flow-node.external {
  border-color: #c5d6e9;
  background: var(--blue-soft);
}

.flow-kicker {
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.mvp-flow-node.gate .flow-kicker {
  color: var(--amber);
}

.mvp-flow-node.external .flow-kicker {
  color: var(--blue);
}

.mvp-flow-node strong {
  font-size: 13px;
  line-height: 1.45;
}

.mvp-flow-node small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.mvp-flow-arrow {
  min-width: 22px;
  display: grid;
  place-items: center;
  color: var(--teal);
  font-size: 19px;
  font-weight: 850;
}

.mvp-flow-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mvp-flow-rules span {
  padding: 7px 9px;
  border-radius: 7px;
  background: var(--surface-soft);
  color: #4d5e54;
  font-size: 11px;
  line-height: 1.45;
}

.mvp-flow-rules b {
  color: var(--teal);
}

.mvp-step-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.mvp-step-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  padding: 15px;
  border: 1px solid #dce7e1;
  border-radius: 9px;
  background: #ffffff;
}

.mvp-step-card:last-child {
  grid-column: 1 / -1;
}

.mvp-step-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
}

.mvp-step-card h4 {
  margin: 1px 0 8px;
  font-size: 15px;
}

.mvp-step-card p {
  margin: 5px 0;
  color: #52635a;
  font-size: 12px;
  line-height: 1.65;
}

.mvp-step-card b {
  color: #33473c;
}

.mvp-step-card code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #edf3ef;
  color: #22624b;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

.mvp-reference-intro {
  max-width: 880px;
  margin: -2px 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

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

.mvp-reference-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #dce7e1;
  border-radius: 9px;
  background: #ffffff;
}

.mvp-reference-card > a {
  position: relative;
  display: block;
  min-height: 130px;
  overflow: hidden;
  background: #1c2420;
}

.mvp-reference-card > a img {
  width: 100%;
  height: 156px;
  display: block;
  object-fit: cover;
  object-position: top center;
  opacity: 0.88;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.mvp-reference-card > a:hover img {
  transform: scale(1.03);
  opacity: 1;
}

.mvp-reference-card > a span {
  position: absolute;
  right: 7px;
  bottom: 7px;
  max-width: calc(100% - 14px);
  padding: 4px 6px;
  border-radius: 5px;
  background: rgba(12, 24, 18, 0.78);
  color: #ffffff;
  font-size: 10px;
  line-height: 1.3;
}

.mvp-reference-card > div {
  grid-column: 1 / -1;
  padding: 13px;
}

.mvp-reference-card h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.mvp-reference-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.plan-source-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 13px 14px;
  border: 1px solid #bfd8ce;
  border-radius: 8px;
  background: var(--teal-soft);
}

.plan-source-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.plan-source-copy strong,
.plan-source-copy small {
  display: block;
}

.plan-source-copy strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-source-copy small {
  margin-top: 4px;
  color: #527066;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.plan-file-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 7px;
  background: #ffffff;
  color: var(--teal);
}

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

.plan-filters {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(160px, 0.45fr);
  gap: 10px;
  margin-bottom: 12px;
}

.plan-filters label {
  display: grid;
  gap: 6px;
}

.plan-filters label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.plan-filters select {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.plan-week-summary {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(280px, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid #cbd8e7;
  border-radius: 8px;
  background: var(--blue-soft);
}

.plan-week-summary[hidden] {
  display: none;
}

.week-summary-title strong,
.week-summary-title small {
  display: block;
}

.week-summary-title strong {
  margin-top: 3px;
  font-size: 14px;
}

.week-summary-title small {
  margin-top: 4px;
  color: #59708a;
  font-size: 11px;
}

.plan-week-summary > p {
  margin: 0;
  color: #405b76;
  font-size: 12px;
  line-height: 1.6;
}

.plan-week-summary details {
  min-width: 190px;
  color: var(--blue);
  font-size: 12px;
}

.week-summary-note {
  min-width: 190px;
  color: #59708a;
  font-size: 12px;
  line-height: 1.55;
}

.plan-week-summary summary,
.plan-task-details summary {
  cursor: pointer;
  font-weight: 800;
}

.plan-week-summary ol {
  margin: 10px 0 0;
  padding-left: 20px;
  color: #405b76;
  line-height: 1.55;
}

.task-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 120px 90px auto;
  gap: 9px;
  margin-bottom: 16px;
}

.task-form input,
.task-form select {
  min-height: 40px;
  padding: 0 11px;
}

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

.task-lane {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}

.lane-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.task-stack {
  min-height: 100px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.task-card {
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid #e2e8e3;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #ffffff;
}

.task-card[data-priority="P1"] { border-left-color: var(--red); }
.task-card[data-priority="P2"] { border-left-color: var(--amber); }

.task-title {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.task-title input {
  margin-top: 2px;
  accent-color: var(--teal);
}

.task-title span {
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.45;
}

.task-card.done .task-title span {
  color: var(--muted);
  text-decoration: line-through;
}

.task-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.week-tag {
  background: var(--blue-soft);
  color: var(--blue);
}

.plan-task-details {
  padding: 8px;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
}

.plan-task-details ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #4e5d54;
  line-height: 1.55;
}

.task-source-mark {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: #839087;
  font-size: 10px;
  font-weight: 750;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eaeFEB;
  color: #4e5d54;
  font-size: 11px;
  font-weight: 800;
}

.task-actions {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.task-actions button {
  min-width: 30px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 800;
}

.context-intro,
.deploy-notice,
.notes-prompt {
  margin-bottom: 14px;
  padding: 13px 14px;
  border: 1px solid #bfd8ce;
  border-radius: 8px;
  background: var(--teal-soft);
}

.context-intro strong,
.deploy-notice strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.context-intro p,
.deploy-notice span {
  margin: 0;
  color: #486158;
  font-size: 12px;
  line-height: 1.6;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.skill-block {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.skill-block h3,
.command-item h3 {
  margin: 0 0 8px;
  font-size: 14px;
  letter-spacing: 0;
}

.skill-block ul {
  margin: 0;
  padding-left: 17px;
  color: #3c4d44;
}

.skill-block li {
  margin: 5px 0;
  line-height: 1.5;
}

.deploy-notice {
  border-color: #ead4a7;
  background: var(--amber-soft);
}

.deploy-notice span {
  color: #73521e;
}

.deploy-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.deploy-button {
  min-height: 78px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  padding: 14px;
  border-color: #acd1c3;
  background: var(--teal-soft);
  color: var(--teal);
  text-align: left;
}

.deploy-button svg {
  grid-row: 1 / span 2;
}

.deploy-button span {
  min-width: 0;
  font-weight: 850;
}

.deploy-button small {
  color: var(--muted);
  font-weight: 750;
}

.deploy-button.danger {
  border-color: #efbbb6;
  background: var(--red-soft);
  color: var(--red);
}

.log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.log-view {
  min-height: 310px;
  max-height: 480px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-radius: 8px;
  background: #101914;
  color: #d7f5e5;
  font: 12px/1.6 "SFMono-Regular", Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

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

.command-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.command-item h3 {
  grid-column: 1 / -1;
}

.command-item code {
  min-height: 76px;
  padding: 10px;
  border: 1px solid #dfe5e0;
  border-radius: 7px;
  background: #ffffff;
}

.notes-prompt {
  border-color: #cbd8e7;
  background: var(--blue-soft);
  color: #48617e;
  font-size: 12px;
  line-height: 1.6;
}

.notes-prompt span {
  margin-right: 8px;
  color: var(--blue);
  font-weight: 850;
}

.notes-panel textarea {
  min-height: 380px;
  padding: 14px;
  resize: vertical;
  line-height: 1.65;
}

.saved-state {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(10, 20, 15, 0.45);
}

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

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

.modal {
  width: min(460px, 100%);
  padding: 20px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.modal h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.modal p {
  margin: 0 0 14px;
  color: #3c4d44;
  line-height: 1.6;
}

.confirm-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

.confirm-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

@media (max-width: 1120px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .rhythm-panel,
  .quick-panel,
  .pulse-panel {
    grid-column: auto;
    grid-row: auto;
  }

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

  .mvp-reference-grid {
    grid-template-columns: 1fr;
  }

  .mvp-reference-card {
    grid-template-columns: minmax(180px, 0.8fr) minmax(180px, 0.8fr) minmax(240px, 1.2fr);
  }

  .mvp-reference-card > div {
    grid-column: auto;
  }
}

@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .workspace {
    margin-left: 0;
  }

  .menu-button {
    display: grid;
  }

  .topbar {
    min-height: 92px;
  }

  .page-heading p {
    display: none;
  }

  .date-label {
    display: none;
  }

  .command-list,
  .skill-grid {
    grid-template-columns: 1fr;
  }

  .plan-week-summary {
    grid-template-columns: 1fr;
  }

  .mvp-hero,
  .mvp-gates,
  .mvp-step-list {
    grid-template-columns: 1fr;
  }

  .mvp-step-card:last-child {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    padding: 14px 15px;
  }

  .page-heading h1 {
    font-size: 21px;
  }

  .top-actions .icon-button span {
    display: none;
  }

  .top-actions .icon-button {
    width: 38px;
    padding: 0;
  }

  .content {
    padding: 15px 12px 30px;
  }

  .panel {
    padding: 15px;
  }

  .rhythm-grid,
  .quick-grid,
  .task-board,
  .task-form,
  .deploy-actions,
  .plan-filters {
    grid-template-columns: 1fr;
  }

  .mvp-role-grid,
  .mvp-reference-card {
    grid-template-columns: 1fr;
  }

  .mvp-reference-card > div {
    grid-column: auto;
  }

  .plan-source-bar {
    align-items: flex-start;
  }

  .focus-box {
    min-height: auto;
  }

  .section-head {
    align-items: flex-start;
  }

  .task-form .icon-button {
    width: 100%;
  }

  .log-view {
    min-height: 260px;
  }
}
