:root {
  color-scheme: light;
  --bg: #f7f5df;
  --bg-deep: #d9eaf4;
  --panel: #f9f8f3;
  --panel-strong: #fcfbf7;
  --text: #15314f;
  --muted: #60748a;
  --border: rgba(15, 76, 122, 0.14);
  --shadow: 0 10px 18px rgba(13, 61, 115, 0.08);
  --accent: #f6b21a;
  --accent-dark: #0f5d95;
  --accent-soft: #9ec5df;
  --success: #30735e;
  --danger: #9a3b2e;
  --blue-light: #cfe4f4;
  --blue-mid: #93bfe0;
  --blue-strong: #0b679f;
  --blue-deep: #0c4277;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Montserrat", Helvetica, Arial, sans-serif;
  font-size: 13px;
  background: #d3d3d3;
}

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

button {
  border: 0;
  cursor: pointer;
}

.page {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 10px 22px;
}

.backdrop {
  position: absolute;
  border-radius: 999px;
  filter: blur(16px);
  pointer-events: none;
  opacity: 0.22;
}

.backdrop-a {
  top: 16px;
  right: 9%;
  width: 150px;
  height: 150px;
  background: rgba(246, 178, 26, 0.12);
}

.backdrop-b {
  bottom: 28px;
  left: -24px;
  width: 190px;
  height: 190px;
  background: rgba(13, 61, 115, 0.08);
}

.panel {
  position: relative;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 16px;
  box-shadow: none;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 12px;
  margin-bottom: 12px;
}

.eyebrow,
.section-label {
  margin: 0 0 8px;
  text-transform: none;
  letter-spacing: 0.03em;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--blue-deep);
}

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

h1 {
  max-width: 12ch;
  font-family: "Montserrat", Helvetica, Arial, sans-serif;
  font-weight: 600;
  font-size: clamp(1.2rem, 4.3vw, 1.65rem);
  line-height: 0.95;
}

.lede {
  margin-top: 6px;
  max-width: 60ch;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.4;
}

.hero-actions,
.panel-heading,
.date-controls,
.form-actions,
.status-cluster,
.chart-header,
.comparison-row,
.history-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.hero-actions {
  align-self: flex-start;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ghost-button,
.primary-button,
.range-tab,
.icon-button {
  border-radius: 999px;
  transition:
    transform 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

.ghost-button,
.range-tab {
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  border: 1px solid rgba(15, 76, 122, 0.12);
}

.primary-button {
  background: var(--accent);
  color: var(--blue-deep);
  box-shadow: none;
  border: 1px solid rgba(15, 76, 122, 0.12);
}

.ghost-button,
.primary-button,
.range-tab {
  padding: 0.52rem 0.78rem;
  font-size: 0.66rem;
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 1.45rem;
  display: grid;
  place-items: center;
}

.ghost-button:hover,
.primary-button:hover,
.range-tab:hover {
  transform: translateY(-1px);
}

.ghost-button:focus-visible,
.primary-button:focus-visible,
.range-tab:focus-visible,
.icon-button:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid rgba(15, 76, 122, 0.24);
  outline-offset: 2px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 12px 12px;
  margin-bottom: 10px;
}

.date-block h2 {
  font-family: "Montserrat", Helvetica, Arial, sans-serif;
  font-weight: 600;
  font-size: clamp(0.95rem, 3.1vw, 1.1rem);
}

.date-controls {
  justify-content: space-between;
  gap: 6px;
}

.muted {
  color: var(--muted);
}

.status-cluster {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.status-pill {
  min-width: 96px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 76, 122, 0.08);
  padding: 7px 8px;
}

.status-label {
  display: block;
  color: var(--muted);
  font-size: 0.62rem;
  margin-bottom: 4px;
}

.dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.registry-panel,
.insights-panel,
.history-panel {
  padding: 12px;
}

.panel-heading {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.panel-heading h2 {
  font-family: "Montserrat", Helvetica, Arial, sans-serif;
  font-weight: 600;
  font-size: clamp(0.9rem, 2.6vw, 1.1rem);
}

.registry-form {
  display: grid;
  gap: 8px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.field {
  display: grid;
  gap: 5px;
}

.duration-group {
  display: grid;
  gap: 6px;
}

.duration-grid {
  display: grid;
  gap: 6px;
}

.duration-card {
  display: grid;
  gap: 5px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(15, 76, 122, 0.08);
}

.duration-title {
  font-weight: 400;
  font-size: 0.78rem;
}

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

.field-label {
  font-weight: 400;
  font-size: 0.74rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(15, 76, 122, 0.14);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 0.75rem 0.85rem;
  font-size: 13px;
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.exercise-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.mini-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 76, 122, 0.12);
}

.mini-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue-strong);
}

.mini-check span {
  font-weight: 400;
}

.inline-field {
  align-self: start;
}

.range-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

input[type="range"] {
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--blue-light);
  outline: none;
  padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--blue-strong);
  box-shadow: 0 4px 12px rgba(15, 76, 122, 0.18);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--blue-strong);
}

output {
  font-weight: 600;
  color: var(--blue-deep);
  white-space: nowrap;
  font-size: 0.75rem;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 76, 122, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-size: 0.66rem;
}

.chip[data-active="true"] span {
  background: rgba(246, 178, 26, 0.14);
  border-color: rgba(246, 178, 26, 0.4);
  color: var(--blue-deep);
}

.finance-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.finance-item {
  display: grid;
  gap: 5px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(15, 76, 122, 0.08);
}

.finance-item > span {
  font-weight: 400;
  font-size: 0.78rem;
}

.form-actions {
  justify-content: space-between;
  padding-top: 2px;
}

.insights-grid {
  display: grid;
  gap: 14px;
}

.insights-panel,
.notes-panel {
  padding: 0;
  overflow: hidden;
}

.pie-card,
.comparison-card {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(15, 76, 122, 0.08);
  padding: 12px;
}

.chart-header {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.chart-header h3 {
  font-family: "Montserrat", Helvetica, Arial, sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
}

.mini-stat {
  text-align: right;
}

.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  margin-bottom: 2px;
}

.pie-wrap {
  position: relative;
  display: grid;
  place-items: center;
  margin: 2px 0 6px;
}

#pie-chart {
  width: min(100%, 260px);
  height: auto;
}

.pie-center {
  position: absolute;
  display: grid;
  gap: 2px;
  text-align: center;
}

.pie-kicker,
.pie-subtitle {
  color: var(--muted);
  font-size: 0.66rem;
}

.pie-center strong {
  font-family: "Montserrat", Helvetica, Arial, sans-serif;
  font-size: 1.35rem;
  line-height: 1;
}

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

.legend-item {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  border-radius: 14px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(15, 76, 122, 0.08);
}

.legend-swatch {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.legend-item strong {
  display: block;
  font-size: 0.66rem;
}

.legend-item p {
  color: var(--muted);
  font-size: 0.66rem;
  margin-top: 2px;
}

.comparison-list,
.finance-comparison-list {
  display: grid;
  gap: 6px;
}

.comparison-row {
  justify-content: space-between;
  align-items: center;
  border-radius: 14px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(15, 76, 122, 0.08);
}

.comparison-label {
  color: var(--muted);
  font-size: 0.66rem;
  margin-bottom: 4px;
}

.comparison-value {
  font-size: 0.75rem;
}

.comparison-delta {
  font-size: 0.66rem;
  font-weight: 600;
  white-space: nowrap;
}

.comparison-delta.positive {
  color: var(--success);
}

.comparison-delta.negative {
  color: var(--danger);
}

.comparison-delta.neutral {
  color: var(--muted);
}

.history-panel {
  grid-column: 1 / -1;
  padding: 0;
  overflow: hidden;
}

.priority-panel,
.notes-panel {
  padding: 12px;
}

.priority-card {
  display: grid;
  gap: 6px;
}

.priority-card textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid rgba(15, 76, 122, 0.14);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 0.75rem 0.85rem;
  font-size: 13px;
}

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

.finance-accordion {
  padding: 0;
  border: 0;
}

.finance-accordion > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
  margin-bottom: 4px;
}

.finance-accordion > summary::after {
  content: "+";
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1;
}

.finance-accordion[open] > summary::after {
  content: "−";
}

.finance-accordion > summary::-webkit-details-marker {
  display: none;
}

.finance-accordion .finance-grid {
  margin-top: 8px;
}

.history-summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
  padding: 12px 12px;
  cursor: pointer;
}

.history-summary::-webkit-details-marker {
  display: none;
}

.history-summary h2 {
  font-family: "Montserrat", Helvetica, Arial, sans-serif;
  font-weight: 600;
  font-size: clamp(0.94rem, 2.8vw, 1.08rem);
}

.history-summary-copy {
  color: var(--muted);
  font-size: 0.66rem;
  white-space: nowrap;
}

.history-panel[open] .history-summary {
  border-bottom: 1px solid rgba(15, 76, 122, 0.08);
}

.history-body {
  padding: 12px 12px 12px;
}

.notes-list {
  display: grid;
  gap: 6px;
}

.note-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(15, 76, 122, 0.08);
}

.note-time {
  color: var(--muted);
  font-size: 0.62rem;
  margin-bottom: 4px;
}

.note-text {
  font-size: 0.75rem;
  line-height: 1.4;
}

.notes-empty {
  font-size: 0.66rem;
}

.range-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.range-tab.active {
  background: var(--blue-deep);
  color: #fff;
}

.trend-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.trend-bar {
  display: grid;
  gap: 5px;
  justify-items: center;
  text-align: center;
  padding: 10px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(15, 76, 122, 0.08);
}

.trend-bar.selected {
  background: rgba(246, 178, 26, 0.1);
  border-color: rgba(246, 178, 26, 0.22);
}

.trend-track {
  width: 100%;
  height: 82px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 14px;
  background: rgba(207, 228, 244, 0.72);
  padding: 6px;
}

.trend-fill {
  width: 100%;
  border-radius: 12px;
  min-height: 8px;
  background: var(--blue-strong);
  box-shadow: none;
}

.trend-bar strong {
  font-size: 0.66rem;
}

.trend-bar span,
.trend-bar em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.66rem;
}

.history-list {
  display: grid;
  gap: 6px;
}

.history-row {
  justify-content: space-between;
  padding: 7px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(15, 76, 122, 0.08);
}

.history-date {
  font-weight: 600;
  margin-bottom: 2px;
  font-size: 0.75rem;
}

.history-meta {
  color: var(--muted);
  max-width: 62ch;
  line-height: 1.45;
  font-size: 0.66rem;
}

.history-values {
  text-align: right;
  white-space: nowrap;
}

.history-total {
  display: block;
  font-size: 0.74rem;
}

.history-steps {
  color: var(--muted);
  font-size: 0.66rem;
}

.hidden-field {
  display: none;
}

@media (min-width: 960px) {
  .toolbar {
    grid-template-columns: 1.4fr 0.9fr 1fr;
  }

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

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

@media (min-width: 1100px) {
  .dashboard {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }
}

@media (max-width: 1080px) {
  .hero {
    flex-direction: column;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .status-cluster {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .page {
    padding: 8px 8px 20px;
  }

  .panel,
  .hero {
    border-radius: 16px;
  }

  .panel,
  .history-summary,
  .history-body,
  .priority-panel,
  .notes-panel {
    padding-left: 10px;
    padding-right: 10px;
  }

  .legend {
    grid-template-columns: 1fr;
  }

  .exercise-row {
    grid-template-columns: 1fr;
  }

  .date-controls {
    flex-wrap: wrap;
  }

  .form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .history-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .history-values {
    text-align: left;
  }

  .note-row {
    flex-direction: column;
  }
}
