﻿.command-center {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.42fr);
  gap: 24px;
  min-height: 0;
  align-items: start;
}

.command-main {
  display: grid;
  align-content: start;
  gap: 24px;
}

.command-side {
  display: grid;
  align-content: start;
  gap: 24px;
  min-height: 0;
  grid-auto-rows: max-content;
}

.daily-card,
.calendar-card,
.recent-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  background-color: rgba(22, 22, 26, 0.96);
  padding: 28px;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

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

.section-heading-row h3 {
  margin: 0;
}

.calendar-heading-row {
  align-items: start;
}

.calendar-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.daily-progress,
.calendar-status {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  background-color: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
}

.calendar-status.is-complete {
  color: #4ade80;
  background: transparent;
}

.calendar-nav-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  color: var(--ink-soft);
  border-color: rgba(255, 255, 255, 0.18);
  background-color: rgba(255, 255, 255, 0.08);
  opacity: 0.86;
}

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

.daily-task-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  margin-bottom: 10px;
}

.daily-task-form input {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  background-color: rgba(22, 22, 26, 0.96);
}

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

.daily-task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  background-color: rgba(22, 22, 26, 0.96);
  box-shadow: none;
}

.daily-task-row.is-just-completed {
  /* Re-rendered daily rows need a transient visual acknowledgement after a successful completion toggle. */
  animation: daily-task-complete 680ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.daily-task-row label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.daily-task-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--good);
}

.daily-task-row.is-just-completed input {
  animation: daily-check-pop 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.daily-task-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.daily-task-delete {
  color: #ffd2d8;
  border-color: rgba(243, 154, 169, 0.16);
  background-color: rgba(22, 22, 26, 0.96);
}

.daily-task-delete svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.calendar-weekdays,
.calendar-grid,
.calendar-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekdays {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.74rem;
  text-align: center;
}

.calendar-day {
  position: relative;
  display: grid;
  min-height: 74px;
  align-content: center;
  gap: 5px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  background-image: none;
  background-color: rgba(22, 22, 26, 0.96);
  color: var(--muted);
  font-weight: 600;
  box-shadow: none;
}

.calendar-day small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 400;
  line-height: 1;
}

.calendar-day strong {
  color: inherit;
  font-size: 1.05rem;
  line-height: 1.05;
}

.calendar-day.is-today {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.08);
  background-image: none;
  background-color: rgba(28, 28, 34, 0.98);
  box-shadow: none;
}

.calendar-day.is-today:not(.is-complete) {
  color: #ffe7a6;
  border-color: rgba(247, 197, 87, 0.28);
  background-color: rgba(247, 197, 87, 0.12);
}

.calendar-day.is-complete {
  color: #f3f4f6;
  border-color: rgba(74, 222, 128, 0.18);
  background-image: none;
  background-color: rgba(74, 222, 128, 0.08);
  box-shadow: none;
}

.calendar-day.is-complete + .calendar-day.is-complete::before {
  content: "";
  position: absolute;
  left: calc(-8px - 1px);
  top: 50%;
  width: 10px;
  height: 1px;
  border-radius: 999px;
  /* Match the completed-day border so adjacent successes connect without adding a new glow layer. */
  background: rgba(74, 222, 128, 0.18);
  transform: translateY(-50%);
}

.calendar-day.is-missed {
  color: #ffd2d8;
  border-color: rgba(243, 154, 169, 0.22);
  background-image: none;
  background-color: rgba(243, 154, 169, 0.09);
  box-shadow: none;
}

.calendar-day.is-complete small {
  color: rgba(156, 163, 175, 0.9);
}

.stats-grid,
.summary-strip {
  display: grid;
  gap: 10px;
}

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

.summary-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.stat-card,
.note-editor,
.frontmatter-box,
.mode-card,
.result-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  background-image: none;
  background-color: rgba(22, 22, 26, 0.96);
  padding: 24px;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.stat-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 76px;
  text-align: left;
}

.stat-card strong {
  display: block;
  grid-column: 2;
  color: #f3f4f6;
  font-size: 1.55rem;
  font-weight: 600;
}

.folder-stat .folder-icon {
  grid-row: span 2;
  flex-basis: 38px;
  width: 38px;
  height: 38px;
}

.folder-stat .folder-icon svg {
  width: 20px;
  height: 20px;
}

.note-editor,
.mode-card {
  display: grid;
  gap: 10px;
}

.note-editor textarea,
.mode-card textarea,
.mode-card input {
  padding: 14px;
}

.note-editor textarea {
  min-height: 360px;
  resize: vertical;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

.detail-actions {
  display: grid;
  min-height: 80px;
  justify-items: end;
  align-content: space-between;
  gap: 10px;
}

.detail-header h2 {
  margin-bottom: 0;
}

.raw-toggle {
  min-width: 66px;
}

.close-detail {
  min-width: 0;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  font-size: 1.35rem;
  line-height: 1;
}

.proposal-detail {
  grid-template-columns: minmax(0, 0.828fr) minmax(154px, 0.172fr);
}

.proposal-detail .detail-canvas {
  display: grid;
  min-height: min(72vh, 760px);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 18px;
}

.proposal-header h2 {
  max-width: 24ch;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.proposal-reason,
.proposal-diff-panel {
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  background-color: rgba(22, 22, 26, 0.96);
  box-shadow: none;
}

.proposal-reason {
  padding: 20px 22px;
}

.proposal-reason strong,
.proposal-diff-panel header span {
  color: #f3f4f6;
  font-weight: 600;
}

.proposal-reason p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  line-height: 1.35;
}

.proposal-diff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
}

.proposal-diff-panel {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.proposal-diff-panel header {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.proposal-diff-old header {
  border-color: rgba(243, 154, 169, 0.18);
}

.proposal-diff-new header {
  border-color: rgba(74, 222, 128, 0.18);
}

.proposal-diff-panel pre {
  max-height: none;
  min-height: 0;
  margin: 0;
  padding: 16px;
  overflow: auto;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.proposal-diff-old pre {
  background-color: rgba(243, 154, 169, 0.035);
}

.proposal-diff-new pre {
  background-color: rgba(74, 222, 128, 0.035);
}

.proposal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 2px;
}

.proposal-action-button {
  min-width: 104px;
  color: var(--ink);
  background-color: transparent;
  background-image: none;
  box-shadow: none;
  font-weight: 600;
}

.proposal-action-approve {
  border-color: rgba(74, 222, 128, 0.26);
}

.proposal-action-reject {
  border-color: rgba(243, 154, 169, 0.28);
}

.proposal-action-approve:hover,
.proposal-action-approve:focus-visible {
  border-color: rgba(74, 222, 128, 0.42);
  background-color: rgba(74, 222, 128, 0.06);
}

.proposal-action-reject:hover,
.proposal-action-reject:focus-visible {
  border-color: rgba(243, 154, 169, 0.44);
  background-color: rgba(243, 154, 169, 0.055);
}

.proposal-sidebar {
  gap: 14px;
}

.proposal-sidebar .frontmatter-box {
  padding: 20px;
}

.proposal-sidebar p {
  overflow-wrap: anywhere;
}

.todo-open {
  display: grid;
  justify-items: start;
  gap: 5px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 0;
  box-shadow: none;
  text-align: left;
  appearance: none;
}

.cognitive-core {
  display: grid;
  grid-template-columns: 82px minmax(92px, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 270px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 28px;
  background: transparent;
  background-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.core-ring {
  width: 72px;
  height: 72px;
  transform: rotate(-90deg);
}

.core-ring-track,
.core-ring-progress {
  fill: none;
  stroke-width: 5;
}

.core-ring-track {
  stroke: rgba(255, 255, 255, 0.08);
}

.core-ring-progress {
  stroke: #62ff9d;
  stroke-dasharray: 188.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 760ms cubic-bezier(0.16, 1, 0.3, 1), opacity 220ms ease;
}

.cognitive-core.is-animating .core-ring-progress {
  /* The ring is rebuilt during dashboard refreshes, so this draws from empty to the new progress value. */
  animation: core-ring-fill 820ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cognitive-core.is-progress-decreasing .core-ring-progress {
  /* Use the previous offset from JS so adding/unchecking a task visibly drains to the new lower percentage. */
  animation: core-ring-drain 980ms cubic-bezier(0.58, 0, 0.12, 1) both;
}

.core-readout {
  display: grid;
  align-content: center;
  gap: 1px;
}

.core-readout strong {
  color: #f8fff9;
  font-size: 2.35rem;
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.core-readout span {
  color: rgba(255, 255, 255, 0.3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.core-waveform {
  grid-column: 1 / -1;
  width: 100%;
  height: 28px;
}

.core-waveform line {
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0.84;
  transform-box: fill-box;
  transform-origin: center bottom;
  transition: color 260ms ease, filter 260ms ease, opacity 260ms ease, stroke-width 260ms ease;
}

.cognitive-core.is-animating .core-waveform line,
.cognitive-core.is-progress-decreasing .core-waveform line {
  animation: core-waveform-pop 1040ms cubic-bezier(0.16, 1, 0.24, 1) both;
  animation-delay: calc(var(--wave-index, 0) * 36ms);
}

.core-waveform .is-complete {
  color: rgba(98, 255, 157, 0.96);
  filter: drop-shadow(0 0 6px rgba(98, 255, 157, 0.36));
}

.core-waveform .is-missed {
  color: rgba(255, 111, 131, 0.92);
  filter: drop-shadow(0 0 6px rgba(255, 111, 131, 0.3));
}

.core-waveform .is-today-open {
  color: rgba(255, 211, 90, 0.96);
  filter: drop-shadow(0 0 7px rgba(255, 211, 90, 0.38));
}

@keyframes core-ring-fill {
  from {
    opacity: 0.42;
    stroke-dashoffset: 188.5;
  }
  66% {
    opacity: 1;
  }
  to {
    opacity: 1;
  }
}

@keyframes core-ring-drain {
  from {
    opacity: 1;
    stroke-dashoffset: var(--core-ring-from-offset, 0);
  }
  42% {
    opacity: 0.9;
    stroke-width: 4.2;
  }
  72% {
    opacity: 1;
    stroke-width: 5.8;
  }
  to {
    opacity: 1;
    stroke-width: 5;
  }
}

@keyframes core-waveform-pop {
  from {
    opacity: 0.38;
    stroke-width: 1.8;
    filter: brightness(0.82) saturate(1);
    transform: translateY(0) scaleY(0.82);
  }
  36% {
    opacity: 0.92;
    stroke-width: 4.8;
    filter: brightness(1.18) saturate(1.18);
    transform: translateY(-1px) scaleY(1.38);
  }
  62% {
    opacity: 1;
    stroke-width: 4.1;
    filter: brightness(1.32) saturate(1.24);
    transform: translateY(0.8px) scaleY(0.94);
  }
  to {
    opacity: 0.84;
    stroke-width: 3;
    filter: brightness(1) saturate(1);
    transform: translateY(0) scaleY(1);
  }
}

@keyframes daily-task-complete {
  from {
    border-color: rgba(126, 226, 168, 0.12);
    background-color: rgba(22, 22, 26, 0.96);
  }
  42% {
    border-color: rgba(126, 226, 168, 0.46);
    background-color: rgba(126, 226, 168, 0.12);
  }
  to {
    border-color: rgba(255, 255, 255, 0.05);
    background-color: rgba(22, 22, 26, 0.96);
  }
}

@keyframes daily-check-pop {
  from {
    transform: scale(0.86);
  }
  58% {
    transform: scale(1.16);
  }
  to {
    transform: scale(1);
  }
}
