﻿:root {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #6b7280;
  --field-muted: #8f96a1;
  --line: #d7dee8;
  --accent: #3e7428;
  --accent-strong: #315d20;
  --warn: #b45309;
  --danger: #b91c1c;
  --blue: #2563eb;
  --shadow: 0 18px 50px rgba(31, 41, 51, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

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

.app-topnav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 60px;
  min-height: 60px;
  padding: 10px 28px;
  background: var(--accent);
  color: white;
}

body.expenses-view .app-topnav {
  background: #274e74;
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topnav-logo {
  display: block;
  width: 157px;
  height: 24px;
  border-radius: 0;
  object-fit: contain;
}

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

h1 {
  font-size: 20px;
}

.build-marker {
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.72);
  padding: 2px 5px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

#weightTitleDate span,
#sugarTitleDate span,
#sleepTitleDate span {
  font-weight: 400;
}

.form-head p,
.panel-head p,
.list-panel p,
.settings-panel p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.section-menu {
  position: relative;
}

.section-menu[hidden] {
  display: none;
}

.topnav-sections {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topnav-sections .nav-item {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 12px;
  color: white;
  background: transparent;
  font-weight: 700;
}

.topnav-sections .nav-item:hover,
.topnav-sections .nav-item.active {
  background: rgba(255, 255, 255, 0.14);
  color: white;
  box-shadow: none;
}

.section-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 8px;
  min-height: 38px;
  padding: 0 12px;
  color: white;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 700;
}

.section-dropdown {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  display: grid;
  gap: 4px;
  width: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
  padding: 8px;
}

.section-dropdown[hidden] {
  display: none;
}

.nav-item {
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 1px 0 rgba(31, 41, 51, 0.04);
}

.topnav-sections .nav-item {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 12px;
  color: white;
  background: transparent;
  font-weight: 700;
}

.topnav-sections .nav-item:hover,
.topnav-sections .nav-item.active {
  background: rgba(255, 255, 255, 0.14);
  color: white;
  box-shadow: none;
}

.topnav-date {
  margin-left: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

.topnav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.topnav-voice-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  font-size: 28px;
  line-height: 1;
}

.topnav-voice-button:hover {
  background: #ffffff;
}

.workspace {
  padding: 28px;
  max-width: 1240px;
  width: 100%;
}

.workspace.health-workspace {
  background: #92a691;
  max-width: none;
  min-height: 100vh;
}

.workspace.expenses-workspace {
  background: #8e94a4;
  max-width: none;
  min-height: 100vh;
}

.health-page {
  max-width: 1240px;
  margin: 18px 0 0;
}

.expenses-page {
  max-width: 1240px;
  margin: 18px 0 0;
}

.topbar,
.panel-head,
.settings-actions,
.topbar-actions,
.period-toolbar,
.period-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

h2 {
  font-size: 30px;
}

.health-workspace .eyebrow {
  display: none;
}

.health-workspace #viewTitle {
  color: white;
}

.health-workspace #viewTitle span {
  font-weight: 400;
}

.primary-button,
.ghost-button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 42px;
}

.primary-button {
  padding: 0 16px;
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.ghost-button {
  padding: 0 14px;
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  background: var(--panel);
  border-color: var(--line);
}

.full {
  width: 100%;
}

.voice-panel,
.settings-panel,
.intake-card,
.intake-result,
.entry-form,
.list-panel,
.metric-card,
.health-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.voice-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding: 18px;
}

.voice-panel[hidden],
.settings-panel[hidden],
.health-page[hidden],
.intake-page[hidden],
.topbar[hidden],
.metrics-grid[hidden],
.content-grid[hidden] {
  display: none;
}

.voice-panel p {
  color: var(--muted);
  margin-top: 4px;
}

.intake-page {
  display: grid;
  grid-template-columns: minmax(320px, 640px) minmax(280px, 420px);
  gap: 18px;
  align-items: start;
  padding-top: 22px;
}

.intake-card,
.intake-result {
  padding: 18px;
}

.intake-card textarea {
  min-height: 360px;
  resize: vertical;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
}

.intake-result h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

.intake-result ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 14px;
}

.intake-result p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 14px;
}

.intake-saved-text {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 14px;
  padding: 12px;
  white-space: pre-wrap;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.metric-card {
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  font-size: 28px;
  margin-top: 8px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(3, 402px);
  gap: 18px;
  justify-content: start;
  margin-bottom: 18px;
}

.chart-card {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}

.chart-card h3 {
  font-size: 16px;
}

.chart-card-weight {
  position: relative;
  min-height: 262px;
}

.chart-card-placeholder {
  min-height: 262px;
}

.dreams-preview-card {
  display: grid;
  grid-template-columns: 153px minmax(0, 1fr);
  gap: 12px;
  min-height: 262px;
  max-height: 262px;
  padding: 16px;
  cursor: zoom-in;
  overflow: hidden;
}

.dreams-preview-image,
.dreams-modal-image {
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  background: #d1d5db;
}

.dreams-preview-image {
  width: 153px;
  height: 230px;
  align-self: stretch;
  border-radius: 6px;
}

.dreams-preview-text {
  display: -webkit-box;
  min-width: 0;
  max-height: 230px;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 14;
}

.weight-chart {
  cursor: zoom-in;
  min-height: 230px;
  margin-top: 0;
}

.weight-chart-svg {
  display: block;
  width: 100%;
  height: 230px;
  overflow: visible;
}

.weight-chart-svg.large {
  height: 430px;
}

.weight-chart-head {
  position: absolute;
  top: 12px;
  right: 16px;
}

.chart-range-buttons {
  display: inline-flex;
  gap: 4px;
}

.chart-range-button {
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  border: 0;
  border-radius: 6px;
  background: #c7d8c5;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.chart-range-button.active {
  background: var(--accent);
  color: white;
}

.chart-range-button.close {
  background: #b91c1c;
  color: white;
}

.chart-grid-line {
  stroke: #d7dee8;
  stroke-width: 1;
}

.chart-x-label {
  fill: var(--muted);
  font-size: 10px;
}

.chart-y-label {
  fill: var(--muted);
  font-size: 10px;
}

.chart-value-label {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 400;
  text-anchor: middle;
}

.weight-chart-years-2 .chart-x-label,
.weight-chart-years-3 .chart-x-label {
  font-size: 9px;
}

.chart-x-label.strong {
  fill: var(--ink);
  font-weight: 700;
}

.chart-x-label {
  text-anchor: middle;
}

.chart-y-label {
  text-anchor: end;
}

.weight-chart-dialog {
  width: min(1240px, calc(100vw - 40px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

.weight-chart-dialog::backdrop {
  background: rgba(31, 41, 51, 0.58);
}

.dreams-dialog {
  width: min(1040px, calc(100vw - 40px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

.dreams-dialog::backdrop {
  background: rgba(31, 41, 51, 0.58);
}

.weight-chart-modal {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
  padding: 28px 34px 34px;
}

.dreams-modal {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
  padding: 26px 30px 30px;
}

.dreams-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 18px;
}

.dreams-favorite-button {
  width: auto;
  min-width: 96px;
  padding: 0 10px;
}

.dreams-favorite-button.active {
  background: #f59e0b;
  color: white;
}

.dreams-modal-body {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.dreams-modal-image {
  width: 100%;
}

.dreams-modal-text {
  max-height: 560px;
  overflow-y: auto;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  white-space: pre-wrap;
}

.weight-chart-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.weight-chart-large {
  min-height: 430px;
  padding: 10px 14px 8px;
}

.chart-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.weight-zone-green {
  fill: var(--accent);
}

.weight-zone-blue {
  fill: #2f9cc3;
}

.weight-zone-orange {
  fill: #f59e0b;
}

.weight-zone-red {
  fill: #d12f24;
}

.weight-zone-black {
  fill: #111827;
}

.period-toolbar {
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.segment {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.segment.active {
  background: var(--ink);
  color: white;
}

.period-nav {
  justify-content: flex-end;
}

.period-nav strong {
  min-width: 190px;
  text-align: center;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(4, 402px);
  gap: 18px;
  align-items: start;
  justify-content: start;
}

.health-column {
  display: grid;
  gap: 0;
  width: 402px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.expenses-column-wide {
  grid-column: span 2;
  width: calc(402px * 2 + 18px);
}

.expenses-column {
  overflow: visible;
}

.health-card,
.chart-card {
  min-width: 402px;
  max-width: 402px;
  width: 100%;
}

.expenses-column-wide .health-card,
.expenses-column-wide .chart-card {
  min-width: 0;
  max-width: none;
}

.health-column .health-card,
.health-column .chart-card {
  min-width: 0;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.health-column .chart-card {
  padding-bottom: 0;
}

.health-column .health-card {
  padding-top: 0;
}

.health-card .form-head {
  margin: 0;
}

.health-card .form-head h3 {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 42px;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  padding: 0 14px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.expenses-card .form-head h3 {
  background: #274e74;
}

.health-view-toggle {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  min-height: 20px;
  border: 0;
  background: transparent;
  padding: 0;
}

.health-card .form-head h3 .health-view-toggle {
  margin-left: 0;
}

.health-card .form-head h3 .entry-view-toggle {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.finance-month-total {
  margin-left: auto;
  color: white;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.entry-view-toggle {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border: 1px solid #92a691;
  border-radius: 6px;
  background: #92a691;
}

.expenses-card .entry-view-toggle {
  border-color: #8e94a4;
  background: #8e94a4;
}

.health-view-toggle img {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.7;
}

.health-view-toggle:hover img,
.health-view-toggle:focus img {
  opacity: 1;
}

.health-card .form-head h3 > span:first-child {
  text-align: left;
}

.health-title-trigger {
  cursor: pointer;
}

.health-title-trigger:hover,
.health-title-trigger:focus {
  opacity: 0.78;
  outline: none;
}

.health-card .form-head .health-date-trigger {
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  font-weight: 400;
  opacity: 0.82;
  text-align: left;
}

.health-card .form-head .health-date-trigger {
  cursor: pointer;
  border-radius: 5px;
}

.health-card .form-head .health-date-trigger:hover,
.health-card .form-head .health-date-trigger:focus {
  color: white;
  opacity: 1;
  outline: none;
}

.health-card .form-head .health-date-trigger:hover strong,
.health-card .form-head .health-date-trigger:hover span,
.health-card .form-head .health-date-trigger:focus strong,
.health-card .form-head .health-date-trigger:focus span {
  color: white;
}

.health-card .form-head .health-date-trigger strong,
.health-card .form-head .health-date-trigger span {
  font-weight: 400;
}

.test-year-grid {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 2px;
  padding: 10px 0 14px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.test-year-head,
.test-year-day,
.test-year-empty {
  display: grid;
  aspect-ratio: 1 / 1;
  min-width: 0;
  place-items: center;
  border-radius: 3px;
}

.test-year-head {
  color: var(--muted);
  font-size: 9px;
}

.test-year-day {
  color: rgba(17, 24, 39, 0.72);
  font-size: 9px;
  font-weight: 400;
}

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

.health-year-head,
.health-year-day,
.health-year-empty {
  display: grid;
  aspect-ratio: 1 / 1;
  min-width: 0;
  place-items: center;
  border-radius: 3px;
}

.health-year-head {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.health-year-day {
  min-height: 0;
  border-top: 0;
  background: var(--month-bg);
  color: rgba(17, 24, 39, 0.72);
  font-size: 9px;
  font-weight: 400;
  text-align: center;
}

.health-year-day.filled {
  background: var(--month-filled-bg);
  color: rgba(17, 24, 39, 0.88);
}

.health-year-day.selected,
.health-year-day.selected.filled {
  background: var(--accent);
  color: white;
}

.expenses-page .health-year-day.selected,
.expenses-page .health-year-day.selected.filled {
  background: #274e74;
}

.sleep-month-table.year-mode .health-year-day {
  background: var(--month-bg);
  font-size: 9px;
  font-weight: 400;
}

.sleep-month-table.year-mode .health-year-day.filled {
  background: var(--month-filled-bg);
}

.sleep-month-table.year-mode .health-year-day.selected,
.sleep-month-table.year-mode .health-year-day.selected.filled {
  background: var(--accent);
  color: white;
}

.expenses-page .sleep-month-table.year-mode .health-year-day.selected,
.expenses-page .sleep-month-table.year-mode .health-year-day.selected.filled {
  background: #274e74;
}

.health-entry-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: end;
  gap: 6px;
}

.health-card > .health-entry-row {
  display: none;
}

.health-entry-row label {
  gap: 0;
  font-size: 0;
}

.health-entry-row .three-cols,
.health-entry-row .sleep-fields,
.health-entry-row .expense-fields,
.health-entry-row .income-fields {
  min-width: 0;
}

.health-entry-row input,
.health-entry-row textarea,
.health-entry-row .custom-select-button {
  padding-left: 6px;
  padding-right: 6px;
}

.finance-input-shell {
  position: relative;
  display: block;
}

.finance-money-input {
  padding-right: 22px;
}

.finance-currency-button {
  position: absolute;
  top: 1px;
  right: 1px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 40px;
  border: 0;
  border-radius: 0 5px 5px 0;
  background: transparent;
  color: var(--field-muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
}

.finance-currency-button:hover,
.finance-currency-button:focus {
  color: var(--ink);
  outline: none;
}

.finance-currency-picker {
  position: absolute;
  top: calc(100% + 3px);
  right: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  border-radius: 6px;
  background: #8e94a4;
  padding: 0 8px;
  box-shadow: 0 8px 22px rgba(31, 41, 51, 0.14);
}

.finance-currency-picker[hidden] {
  display: none;
}

.finance-currency-picker button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: white;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.finance-currency-picker button:hover,
.finance-currency-picker button:focus,
.finance-currency-picker button.selected {
  background: #274e74;
  outline: none;
}

.finance-note-editor {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 9;
  box-sizing: border-box;
  width: min(250px, calc(100vw - 32px));
  height: 150px;
  overflow: hidden;
  border: 1px solid #4b5563;
  border-radius: 5px;
  background: white;
  padding: 0;
  box-shadow: 0 8px 22px rgba(31, 41, 51, 0.14);
}

.finance-note-editor[hidden] {
  display: none;
}

.finance-note-editor.align-right {
  right: 0;
  left: auto;
}

.finance-note-editor textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  border: 0 !important;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.25;
  resize: vertical;
}

.finance-note-editor textarea:focus {
  outline: none;
  box-shadow: none;
}

.sleep-cell[data-cell-key] {
  position: relative;
  cursor: pointer;
}

.health-card input.linked-input-active,
.health-card textarea.linked-input-active,
.health-card .custom-select-button.linked-input-active,
.health-card input.linked-input-active:focus,
.health-card textarea.linked-input-active:focus,
.health-card .custom-select-button.linked-input-active:focus {
  background: white;
  border-color: #4b5563;
}

.health-card input.linked-input-dim,
.health-card textarea.linked-input-dim,
.health-card .custom-select-button.linked-input-dim {
  background: rgba(146, 166, 145, 0.2);
  border-color: var(--line);
}

.expenses-page .health-card input.linked-input-active,
.expenses-page .health-card textarea.linked-input-active,
.expenses-page .health-card .custom-select-button.linked-input-active,
.expenses-page .health-card input.linked-input-active:focus,
.expenses-page .health-card textarea.linked-input-active:focus,
.expenses-page .health-card .custom-select-button.linked-input-active:focus {
  background: white;
  border-color: #4b5563;
}

.expenses-page .health-card input.linked-input-dim,
.expenses-page .health-card textarea.linked-input-dim,
.expenses-page .health-card .custom-select-button.linked-input-dim {
  background: rgba(142, 148, 164, 0.2);
  border-color: var(--line);
}

.dreams-entry-row {
  align-items: start;
}

.dreams-entry-row textarea {
  width: 316px;
  height: 42px;
  min-height: 42px;
  max-width: 100%;
  overflow-y: auto;
  resize: none;
  font-weight: 400;
  line-height: 1.35;
}

.dreams-health-card.dreams-expanded .dreams-entry-row textarea {
  height: 450px;
}

.dreams-health-card.dreams-expanded .sleep-month-table {
  display: none;
}

.save-arrow-button {
  display: none;
  place-items: center;
  width: 42px;
  height: 42px;
  min-height: 42px;
  border: 1px solid #92a691;
  border-radius: 6px;
  background: #92a691;
}

.save-arrow-button:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.save-arrow-button span {
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid white;
}

.time-choice {
  appearance: none;
  background-image: none;
  cursor: pointer;
  padding-left: 8px;
  padding-right: 8px;
  text-align: left;
  font-weight: 700;
}

.month-choice {
  width: 112px;
}

.period-choice {
  width: 82px;
}

.year-choice {
  width: 58px;
}

.time-choice.active {
  border-color: var(--field-muted);
  box-shadow: none;
}

.feed-toggle-button {
  align-self: end;
  margin-left: auto;
  min-width: 58px;
  min-height: 28px;
  border: 0;
  border-radius: 5px;
  background: #c7d8c5;
  color: var(--accent-strong);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.feed-toggle-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.native-select-hidden {
  display: none;
}

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--field-muted);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 11px 8px;
  text-align: left;
  font-weight: 700;
}

.custom-select.active .custom-select-button,
.custom-select-button:focus {
  border-color: var(--field-muted);
  outline: none;
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  z-index: 20;
  display: grid;
  min-width: 100%;
  overflow: visible;
  border: 1px solid var(--field-muted);
  border-radius: 6px;
  background: white;
  box-shadow: 0 12px 30px rgba(31, 41, 51, 0.14);
  padding: 4px;
}

.custom-select-menu[hidden] {
  display: none;
}

.custom-select-option {
  min-height: 22px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  padding: 3px 8px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
}

.custom-select-option:hover,
.custom-select-option.selected {
  background: transparent;
  color: var(--accent);
}

.health-entry-row .custom-select-button {
  padding: 9px 8px;
  font-size: 15px;
}

.health-date-picker {
  position: fixed;
  z-index: 100;
  display: grid;
  grid-template-columns: auto 112px 58px;
  align-items: start;
  gap: 6px;
  border: 1px solid var(--field-muted);
  border-radius: 6px;
  background: white;
  box-shadow: 0 14px 34px rgba(31, 41, 51, 0.16);
  padding: 8px;
}

.health-date-picker[hidden] {
  display: none;
}

.date-picker-calendar {
  display: grid;
  grid-template-columns: repeat(7, 26px);
  gap: 3px;
}

.date-picker-weekday,
.date-picker-empty,
.date-picker-day,
.date-picker-option {
  color: #9aa3ad;
  font-size: 12px;
  font-weight: 400;
}

.date-picker-weekday {
  display: grid;
  place-items: center;
  min-height: 20px;
}

.date-picker-day,
.date-picker-option {
  border: 0;
  border-radius: 5px;
  background: transparent;
}

.date-picker-day {
  width: 26px;
  height: 24px;
  font-size: 14px;
}

.date-picker-list {
  display: grid;
  align-content: start;
  gap: 1px;
}

.date-picker-years {
  margin-left: -4px;
}

.date-picker-option {
  min-height: 20px;
  padding: 1px 5px;
  text-align: left;
}

.date-picker-day.selected,
.date-picker-option.selected {
  color: #4b5563;
}

.date-picker-day:hover,
.date-picker-option:hover {
  color: #2f9cc3;
}

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

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

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

.readonly-field {
  background: white;
  color: var(--accent-strong);
  font-weight: 700;
}

.sleep-period-controls {
  display: none;
  align-items: end;
  gap: 6px;
}

.sleep-period-controls label {
  width: auto;
}

.sleep-period-controls .compact-select-label {
  display: block;
  font-size: 0;
}

.sleep-period-controls .month-choice {
  width: 112px;
}

.sleep-period-controls .year-choice {
  width: 58px;
}

.sleep-period-controls .custom-select-button {
  min-height: 28px;
  border: 0;
  border-radius: 5px;
  background: #c7d8c5;
  color: var(--accent-strong);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.sleep-period-controls .custom-select.active .custom-select-button,
.sleep-period-controls .custom-select-button:focus {
  background: var(--accent);
  color: white;
  outline: none;
}

.sleep-month-table {
  display: grid;
  margin-top: 0;
}

.sleep-table-head,
.sleep-table-row {
  display: grid;
  gap: 0;
}

.table-cols-2 {
  grid-template-columns: 52px minmax(0, 1fr);
}

.sleep-month-table.feed-mode .table-cols-2 {
  grid-template-columns: 64px minmax(0, 1fr);
}

.dreams-table-row {
  grid-template-columns: 52px minmax(0, 1fr);
}

.sleep-month-table.feed-mode .dreams-table-row {
  grid-template-columns: 64px minmax(0, 1fr);
}

.expenses-table-row {
  grid-template-columns: 52px repeat(7, minmax(0, 1fr));
}

.sleep-month-table.feed-mode .expenses-table-row {
  grid-template-columns: 64px repeat(7, minmax(0, 1fr));
}

.income-table-row {
  grid-template-columns: 52px repeat(5, minmax(0, 1fr));
}

.sleep-month-table.feed-mode .income-table-row {
  grid-template-columns: 64px repeat(5, minmax(0, 1fr));
}

.table-cols-4 {
  grid-template-columns: 52px repeat(3, minmax(0, 1fr));
}

.sleep-month-table.feed-mode .table-cols-4 {
  grid-template-columns: 64px repeat(3, minmax(0, 1fr));
}

.table-cols-5 {
  grid-template-columns: 52px repeat(4, minmax(0, 1fr));
}

.sleep-month-table.feed-mode .table-cols-5 {
  grid-template-columns: 64px repeat(4, minmax(0, 1fr));
}

.sleep-table-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 0 0 4px;
}

.sleep-table-head span {
  min-width: 0;
  padding: 0 6px;
}

.sleep-table-row {
  min-height: 24px;
  border: 0;
  border-top: 1px solid #d1d5db;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  padding: 0;
  text-align: left;
}

.sleep-table-row.selected {
  background: transparent;
  color: var(--ink);
}

.expenses-page .sleep-table-row.selected {
  background: transparent;
}

.sleep-table-row.weekend .sleep-cell {
  background: #fff1f2;
}

.sleep-month-table.feed-mode .sleep-table-row.weekend .sleep-cell {
  background: transparent;
}

.sleep-table-row.selected .sleep-cell,
.expenses-page .sleep-table-row.selected .sleep-cell {
  background: transparent;
  color: var(--ink);
}

.sleep-table-row.selected.weekend .sleep-cell,
.expenses-page .sleep-table-row.selected.weekend .sleep-cell {
  background: #fff1f2;
}

.sleep-table-row.selected.weekend .inline-cell-editor input,
.sleep-table-row.selected.weekend .inline-cell-editor select,
.sleep-table-row.selected.weekend .inline-cell-editor textarea {
  background: #dfe7df;
}

.expenses-page .sleep-table-row.selected.weekend .inline-cell-editor input,
.expenses-page .sleep-table-row.selected.weekend .inline-cell-editor select,
.expenses-page .sleep-table-row.selected.weekend .inline-cell-editor textarea {
  background: #d8dbe1;
}

.sleep-table-row.selected.weekend .inline-cell-field.inline-cell-field-active,
.sleep-table-row.selected.weekend .inline-cell-field.inline-cell-field-active:focus,
.expenses-page .sleep-table-row.selected.weekend .inline-cell-field.inline-cell-field-active,
.expenses-page .sleep-table-row.selected.weekend .inline-cell-field.inline-cell-field-active:focus {
  background: white;
}

.sleep-table-row.inline-edit-row {
  min-height: 48px;
}

.sleep-table-row.inline-edit-row-noted {
  min-height: 72px;
}

.sleep-table-row.inline-edit-row-tall {
  min-height: 96px;
}

.sleep-table-row.inline-edit-row .sleep-cell {
  align-items: stretch;
  padding: 4px;
}

.sleep-table-row.inline-edit-row .sleep-cell:first-child {
  align-items: flex-start;
  padding: 4px 6px;
}

.sleep-table-row .sleep-cell:first-child {
  cursor: pointer;
}

.inline-cell-editor {
  position: relative;
  display: grid;
  grid-template-rows: minmax(34px, auto) minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  gap: 3px;
}

.inline-input-shell {
  position: relative;
  display: block;
  width: 100%;
}

.inline-cell-editor input,
.inline-cell-editor select,
.inline-cell-editor textarea {
  width: 100%;
  min-height: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(146, 166, 145, 0.2);
  color: var(--ink);
  padding: 4px 5px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
}

.inline-finance-editor input {
  padding-right: 20px;
}

.inline-finance-currency-button {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 14px;
  height: 18px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--field-muted);
  padding: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.15;
}

.inline-finance-currency-button:hover,
.inline-finance-currency-button:focus {
  color: var(--ink);
  outline: none;
}

.inline-finance-currency-picker {
  top: calc(100% + 3px);
  right: 0;
}

.inline-cell-field.inline-cell-field-active,
.inline-cell-field.inline-cell-field-active:focus {
  background: white;
  border-color: #4b5563;
}

.expenses-page .inline-cell-editor input,
.expenses-page .inline-cell-editor select,
.expenses-page .inline-cell-editor textarea {
  background: rgba(142, 148, 164, 0.2);
}

.expenses-page .inline-cell-field.inline-cell-field-active,
.expenses-page .inline-cell-field.inline-cell-field-active:focus {
  background: white;
  border-color: #4b5563;
}

.inline-cell-editor textarea {
  height: 82px;
  min-height: 82px;
  resize: none;
  font-weight: 400;
}

.inline-cell-editor input:focus,
.inline-cell-editor select:focus,
.inline-cell-editor textarea:focus {
  border-color: #4b5563;
  outline: none;
}

.inline-cell-note {
  display: block;
  overflow: visible;
  min-width: 0;
  color: rgba(17, 24, 39, 0.68);
  font-size: 9px;
  font-weight: 400;
  line-height: 1.15;
  cursor: pointer;
}

.inline-cell-note-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.finance-note-dot {
  display: inline-block;
  margin-left: 4px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.sleep-table-row .sleep-cell.cell-linked-active,
.sleep-table-row.selected .sleep-cell.cell-linked-active,
.expenses-page .sleep-table-row .sleep-cell.cell-linked-active,
.expenses-page .sleep-table-row.selected .sleep-cell.cell-linked-active {
  background: transparent;
  color: inherit;
}

.sleep-table-row.selected.weekend .sleep-cell.cell-linked-active,
.expenses-page .sleep-table-row.selected.weekend .sleep-cell.cell-linked-active {
  background: #fff1f2;
}

.finance-summary-row {
  font-weight: 700;
  cursor: default;
}

.finance-summary-row .sleep-cell {
  font-weight: 700;
}

.sleep-cell {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 4px 6px;
  text-align: left;
  border-left: 1px solid #d1d5db;
}

.sleep-cell:first-child {
  border-left: 0;
}

.dreams-preview {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.expenses-preview {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sleep-duration {
  font-weight: 700;
}

.entry-form,
.settings-panel,
.health-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

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

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

label {
  display: grid;
  gap: 7px;
  color: var(--field-muted);
  font-size: 13px;
}

.health-card label {
  gap: 4px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  min-height: 42px;
  padding: 9px 12px;
  font-size: 15px;
  font-weight: 700;
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: #c3cad1;
  opacity: 1;
}

.health-card input.default-value,
.health-card .custom-select-button.default-value {
  color: #c3cad1;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.health-card input,
.health-card textarea {
  border-color: var(--field-muted);
}

.health-card input,
.health-entry-row .custom-select-button {
  min-height: 42px;
}

select,
select option {
  border-radius: 6px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #4b5563;
  box-shadow: none;
}

.list-panel {
  min-height: 520px;
  padding: 18px;
}

.panel-actions {
  display: flex;
  gap: 8px;
}

.entry-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.health-list {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.health-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
}

.health-item strong,
.health-item span {
  display: block;
}

.health-item strong {
  font-size: 13px;
}

.health-item span,
.health-empty {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.health-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
}

.entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: white;
}

.entry-title {
  font-weight: 700;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.tag {
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef2ff;
  color: #3730a3;
}

.entry-row[data-type="expense"] .tag {
  background: #fff7ed;
  color: var(--warn);
}

.entry-row[data-type="health"] .tag {
  background: #ecfeff;
  color: #0e7490;
}

.entry-row[data-type="food"] .tag {
  background: #f0fdf4;
  color: #15803d;
}

.delete-button,
.health-delete-button {
  border: 0;
  border-radius: 8px;
  min-width: 36px;
  min-height: 36px;
  background: #fee2e2;
  color: var(--danger);
}

.health-delete-button {
  min-width: 32px;
  min-height: 32px;
}

.settings-panel {
  margin-top: 18px;
}

dialog {
  width: min(520px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--panel);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(31, 41, 51, 0.38);
}

.dialog-form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

@media (max-width: 900px) {
  .app-topnav {
    gap: 12px;
    padding: 5px 10px;
  }

  .workspace {
    padding: 18px 14px 28px;
  }

  .metrics-grid,
  .content-grid,
  .intake-page,
  .health-grid,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .health-column {
    width: 100%;
  }

  .expenses-column-wide {
    grid-column: auto;
    width: 100%;
  }

  .health-card,
  .chart-card {
    min-width: 0;
    max-width: none;
  }

  .three-cols,
  .sleep-fields,
  .expense-fields,
  .income-fields {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 520px) {
  .topnav-date {
    display: none;
  }

  .topnav-logo {
    width: 157px;
    height: 24px;
  }

  .topbar,
  .panel-head,
  .voice-panel,
  .period-toolbar,
  .period-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .panel-actions,
  .settings-actions,
  .period-nav,
  .segmented-control {
    width: 100%;
  }

  .topbar-actions .primary-button,
  .panel-actions .ghost-button,
  .settings-actions button,
  .period-nav button {
    flex: 1;
  }

  .period-nav {
    flex-direction: row;
    align-items: center;
  }

  .period-nav strong {
    min-width: 0;
    flex: 1;
  }

  .two-cols {
    grid-template-columns: 1fr;
  }

  h2 {
    font-size: 25px;
  }
}

