:root {
  --navy: #1d2945;
  --navy-2: #2b3758;
  --bg: #eef3f7;
  --panel: #ffffff;
  --soft: #f4f7fb;
  --soft-blue: #eef3fb;
  --line: #dfe7ef;
  --text: #111827;
  --muted: #6b7280;
  --green: #13936d;
  --green-soft: #e6f6ef;
  --blue: #3569d4;
  --gold: #d99a24;
  --coral: #e05252;
  --shadow: 0 12px 30px rgba(29, 41, 69, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: white;
  padding: 0.55rem 0.75rem;
  font-weight: 800;
  cursor: pointer;
  min-height: 34px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button.ghost {
  background: white;
  color: var(--text);
  border: 1px solid var(--line);
}

input,
select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  background: white;
  color: var(--text);
}

label {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--navy);
  color: white;
  padding: 1rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.2rem;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #86efac, #20c997);
  color: #0f2540;
  font-weight: 900;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.card h3,
.meal-day h4 {
  margin: 0;
}

.brand h1 {
  font-size: 0.98rem;
}

.brand p {
  color: #c4d0e3;
  font-size: 0.76rem;
  line-height: 1.25;
}

nav {
  display: grid;
  gap: 0.25rem;
}

.sidebar-household {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-household .household-control {
  width: 100%;
  color: #c4d0e3;
}

.sidebar-household .household-control select {
  height: 38px;
  background: #f8fafc;
  color: var(--text);
}

.sidebar-household-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.sidebar-household-actions button {
  min-height: 32px;
  padding: 0.4rem 0.5rem;
}

.sidebar-household-actions button.ghost {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.sidebar-household-actions button.danger-button {
  color: #fecaca;
}

.sidebar-household-actions .default-household-button {
  grid-column: 1 / -1;
}

.sidebar-household-actions .default-household-button:disabled {
  color: #a7f3d0;
  opacity: 1;
}

.nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: transparent;
  color: #d8e2f1;
  text-align: left;
  border: 1px solid transparent;
  padding: 0.58rem 0.65rem;
  font-weight: 700;
}

.nav-button span {
  width: 18px;
  color: #b8c5d9;
  text-align: center;
}

.nav-button.active,
.nav-button:hover {
  background: var(--navy-2);
  border-color: rgba(255, 255, 255, 0.08);
}

main {
  min-width: 0;
  padding: 1.2rem 1.35rem;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.topbar h2 {
  font-size: 1.75rem;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
}

.auth-mode .topbar-actions {
  display: none;
}

.auth-mode .topbar {
  justify-content: flex-start;
}

.eyebrow,
.card-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.month-control {
  width: 150px;
}

.week-control {
  width: 205px;
}

.week-control select {
  height: 48px;
}

.month-control input {
  height: 48px;
}

.icon-button {
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.icon-button.is-loading {
  animation: button-spin 0.8s linear infinite;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

.user-chip {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 0.35rem 0.6rem;
}

#signOutButton {
  height: 48px;
  min-height: 48px;
  padding-inline: 1rem;
}

.copy-budget-field {
  width: 220px;
}

.user-chip span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 900;
}

.user-chip strong,
.user-chip small {
  display: block;
  white-space: nowrap;
}

.user-chip small {
  color: var(--muted);
  font-size: 0.76rem;
}

.auth-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 420px));
  gap: 1rem;
}

.auth-form,
.card,
.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-form {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
}

.auth-form h2 {
  margin: 0;
}

.auth-form > p {
  margin: 0;
  color: var(--muted);
}

.text-button {
  justify-self: start;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  box-shadow: none;
}

.text-button:hover {
  background: transparent;
  text-decoration: underline;
}

.demo-access {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
}

.demo-access button {
  white-space: nowrap;
}

.app-dialog {
  width: min(460px, calc(100vw - 2rem));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--text);
  box-shadow: 0 24px 70px rgba(17, 24, 39, 0.28);
}

.app-dialog::backdrop {
  background: rgba(17, 24, 39, 0.48);
}

.app-dialog form {
  display: grid;
  gap: 1rem;
  padding: 1.1rem;
}

.app-dialog h2 {
  margin: 0;
}

.app-dialog .section-head {
  align-items: start;
}

.app-dialog .icon-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
}

.form-message {
  min-height: 1rem;
  margin: 0;
  color: var(--coral);
  font-weight: 700;
}

.workspace {
  display: grid;
  gap: 0.8rem;
}

.help-layout {
  display: grid;
  gap: 1rem;
  max-width: 1180px;
}

.help-visual-hero {
  min-height: 310px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 8px;
  background-color: rgba(15, 31, 57, 0.62);
  background-image: url("assets/famelo-help-household-planning.jpg");
  background-blend-mode: multiply;
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.help-visual-hero > div {
  max-width: 560px;
  padding: 2rem;
  color: white;
}

.help-visual-hero .card-label {
  color: #86efac;
}

.help-visual-hero h3 {
  margin: 0.35rem 0;
  font-size: 2rem;
}

.help-visual-hero p {
  margin: 0;
  color: #e2e8f0;
}

.help-journey {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.help-journey article {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  border-right: 1px solid var(--line);
}

.help-journey article:last-child {
  border-right: 0;
}

.help-journey article > span,
.empty-symbol {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f8f0;
  color: var(--green);
  font-weight: 900;
}

.help-journey small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
}

.help-visual-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.help-visual-feature img {
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.help-visual-feature > div {
  padding: 1.4rem;
}

.help-visual-feature h3 {
  margin: 0.3rem 0 0.5rem;
}

.help-visual-feature p {
  margin: 0;
  color: var(--muted);
}

.help-intro {
  padding: 0.25rem 0 0.5rem;
}

.help-intro h3 {
  max-width: 760px;
  margin: 0.2rem 0 0.35rem;
  font-size: 1.55rem;
}

.help-intro p,
.help-topic p,
.help-columns p,
.help-footer p {
  margin: 0;
  color: var(--muted);
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.help-topic {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 0.8rem;
  min-height: 120px;
  padding: 1rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.help-topic:nth-child(2n) {
  border-right: 0;
}

.help-topic:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.help-topic > span {
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 900;
}

.help-topic .help-topic-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--soft-blue);
  font-size: 1rem;
}

.onboarding-empty {
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.65rem;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  text-align: center;
  box-shadow: var(--shadow);
}

.onboarding-empty h3,
.onboarding-empty p {
  margin: 0;
}

.onboarding-empty p {
  max-width: 520px;
  color: var(--muted);
}

.compact-onboarding {
  min-height: 220px;
  box-shadow: none;
}

.onboarding-graphic {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.onboarding-graphic span {
  width: 54px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 2px solid #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 900;
}

.onboarding-graphic span:nth-child(2) {
  border-color: var(--green);
  color: var(--green);
  transform: translateY(-8px);
}

.goal-edit-grid {
  display: grid;
  grid-template-columns: minmax(170px, 1.3fr) repeat(3, minmax(120px, 0.8fr)) 38px;
  gap: 0.6rem;
  align-items: end;
}

.goal-edit-grid label {
  min-width: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.goal-edit-grid input {
  width: 100%;
  min-height: 40px;
  margin-top: 0.2rem;
  background: white;
  color: var(--text);
  font-weight: 800;
  text-transform: none;
}

.help-topic h3,
.help-columns h3,
.help-footer h3 {
  margin: 0 0 0.35rem;
}

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

.help-columns > article,
.help-footer {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.help-columns ol {
  display: grid;
  gap: 0.55rem;
  margin: 0.8rem 0;
  padding-left: 1.25rem;
}

.help-note {
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.help-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.metric {
  min-height: 74px;
  padding: 0.75rem;
  box-shadow: none;
  background: linear-gradient(180deg, #ffffff, #f7fbf8);
}

.metric span,
.metric small {
  color: var(--muted);
}

.metric span {
  display: block;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.metric strong {
  display: block;
  margin: 0.25rem 0 0.1rem;
  font-size: 1.2rem;
}

.metric:first-child {
  background: linear-gradient(90deg, #f5fff9, #fff);
}

.view {
  display: grid;
  gap: 0.8rem;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 0.8rem;
  align-items: start;
}

.transactions-grid {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
}

.wealth-layout {
  grid-template-columns: 1fr;
}

.calendar-layout {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
}

.calendar-layout > *,
.calendar-layout .side-stack,
.calendar-layout .side-stack .card {
  min-width: 0;
  width: 100%;
}

.calendar-main-card {
  overflow: hidden;
}

.calendar-main-card .section-head {
  flex-wrap: wrap;
}

.main-stack,
.side-stack,
.narrow-layout,
.meal-layout {
  min-width: 0;
  display: grid;
  gap: 0.8rem;
}

.narrow-layout {
  max-width: 720px;
}

.card {
  min-width: 0;
  padding: 0.85rem;
  display: grid;
  gap: 0.75rem;
}

.soft-card {
  background: #fbfdff;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.button-row {
  display: flex;
  gap: 0.45rem;
}

.sync-empty {
  min-height: 54px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: linear-gradient(90deg, white, #f5f8fc);
  border-radius: 6px;
}

.empty-inline {
  border-radius: 8px;
  background: var(--soft-blue);
  color: var(--muted);
  padding: 0.85rem;
  text-align: center;
  font-weight: 800;
}

.budget-table {
  display: grid;
  gap: 0.25rem;
}

.budget-ledger-card {
  max-width: 860px;
  margin-inline: auto;
  width: 100%;
}

.budget-ledger-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 150px;
  gap: 0.75rem;
  align-items: end;
  color: var(--muted);
}

.budget-ledger-head h3 {
  color: var(--text);
}

.budget-money-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 150px;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid #1f8ee8;
}

.line-name-input,
.money-input {
  border: 1px solid transparent;
  border-radius: 4px;
  min-height: 32px;
  background: transparent;
  padding: 0.2rem 0.35rem;
  color: var(--text);
}

.line-title-stack {
  display: grid;
  gap: 0.25rem;
}

.due-day-field {
  width: max-content;
  display: inline-grid;
  grid-template-columns: auto 150px;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.due-day-field input {
  min-height: 28px;
  padding: 0.15rem 0.3rem;
}

.line-name-input:focus,
.money-input:focus {
  border-color: #1f8ee8;
  background: white;
  outline: 0;
}

.money-input {
  text-align: right;
  font-weight: 800;
}

.link-button {
  justify-self: start;
  min-height: 28px;
  padding: 0;
  color: #0878d8;
  background: transparent;
}

.category-row {
  margin-top: 0.25rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  background: var(--soft-blue);
}

.category-title {
  display: grid;
  grid-template-columns: 7px minmax(120px, 1fr) auto auto auto 28px;
  align-items: center;
  gap: 0.45rem;
}

.category-title i {
  width: 7px;
  height: 22px;
  border-radius: 999px;
}

.category-title span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.category-title small {
  display: block;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
}

.category-title b {
  min-width: 96px;
  text-align: right;
}

.category-title .icon-button {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
}

.category-add-line {
  min-height: 28px;
  padding: 0 0.55rem;
  font-size: 0.72rem;
}

.category-adder {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 0.6rem;
  align-items: end;
  border-radius: 8px;
  background: var(--soft-blue);
  padding: 0.7rem;
}

.budget-line,
.assign-row {
  display: grid;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px solid var(--line);
  padding: 0.52rem 0.4rem;
}

.budget-line {
  grid-template-columns: minmax(180px, 1fr) 110px 88px 88px 34px;
}

.budget-line-value {
  min-width: 0;
}

.budget-line-value > small {
  display: none;
}

.budget-line-value span,
.budget-line-value b {
  overflow-wrap: anywhere;
}

.assign-row {
  grid-template-columns: minmax(160px, 1fr) 90px minmax(260px, 0.9fr) 48px 48px;
}

.ledger-assign-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  border-radius: 8px;
  background: var(--soft-blue);
  padding: 0.65rem;
}

.ledger-assign-row label {
  grid-column: 1 / -1;
}

.ledger-assign-row button {
  grid-column: 1 / -1;
  justify-self: stretch;
}

.ledger-assign-row strong,
.ledger-assign-row small {
  display: block;
}

.ledger-assign-row strong {
  color: var(--coral);
}

.ledger-assign-row small {
  color: var(--muted);
}

.budget-line strong,
.assign-row strong,
.compact-row strong {
  display: block;
}

.budget-line small,
.assign-row small,
.compact-row small {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  margin-top: 0.12rem;
}

.danger {
  color: var(--coral);
}

.danger-button {
  background: #fff0f0;
  color: var(--coral);
}

.compact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) auto auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem;
  border-radius: 6px;
  background: var(--soft-blue);
  min-width: 0;
}

.compact-row > div {
  min-width: 0;
}

.compact-row .pill {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.mini-form,
.paycheck-builder,
.meal-toolbar,
.invite-form,
.calendar-quick-add,
.transaction-subcategory-adder {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 0.5rem;
}

.invite-form {
  align-items: end;
}

.invite-form label {
  min-width: 0;
}

.invite-form label > input,
.invite-form label > select {
  width: 100%;
  margin-top: 0.25rem;
}

.invite-household-picker {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.invite-household-picker > span {
  font-weight: 800;
}

.invite-household-option {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  color: var(--text);
}

.invite-household-option input {
  width: auto;
  min-height: 0;
}

.sharing-member-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.sharing-member-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 6px;
  background: var(--soft-blue);
}

.sharing-member-row strong,
.sharing-member-row small {
  display: block;
}

.sharing-member-row small {
  margin-top: 3px;
  color: var(--muted);
}

.revoke-access-button {
  min-height: 42px;
  white-space: nowrap;
}

.sharing-member-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.member-add-household-picker > summary {
  list-style: none;
  cursor: pointer;
}

.member-add-household-picker > summary::-webkit-details-marker {
  display: none;
}

.ghost-summary {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  font-weight: 800;
  font-size: 0.85rem;
  white-space: nowrap;
}

.member-add-household-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 5;
  display: grid;
  gap: 8px;
  min-width: 220px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.member-add-household-panel label {
  font-size: 0.8rem;
}

@media (max-width: 720px) {
  .sharing-member-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .sharing-member-row .pill,
  .sharing-member-actions {
    justify-self: start;
  }

  .member-add-household-panel {
    position: static;
    box-shadow: none;
  }
}

.invite-email-status {
  grid-column: 1 / -1;
  margin: 0;
}

.transaction-entry-form {
  grid-template-columns: minmax(0, 1fr) 100px;
  align-items: end;
}

.meal-toolbar {
  grid-template-columns: 120px 120px minmax(180px, 1fr) 90px;
  align-items: end;
}

.meal-toolbar #addMealRecipeButton {
  grid-column: 3;
}

.meal-toolbar #planMealButton {
  grid-column: 4;
}

.meal-recipe-combobox {
  min-width: 0;
}

.meal-week-caption {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  color: var(--muted);
}

.meal-week-caption strong {
  color: var(--text);
}

.transaction-entry-form label:nth-of-type(3),
.transaction-entry-form button {
  grid-column: 1 / -1;
}

.ledger-assign-row .pill,
.ledger-assign-row select,
.assign-row select,
.transaction-entry-form select {
  min-width: 0;
  max-width: 100%;
}

.transaction-subcategory-adder {
  grid-template-columns: minmax(140px, 0.8fr) minmax(240px, 1.2fr) auto auto;
  align-items: end;
  border-radius: 8px;
  background: var(--soft-blue);
  padding: 0.7rem;
}

.custom-combobox {
  position: relative;
}

.combo-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
  padding: 0.25rem;
}

.combo-menu button {
  width: 100%;
  min-height: 36px;
  justify-content: flex-start;
  background: white;
  color: var(--text);
  text-align: left;
  padding: 0.45rem 0.6rem;
}

.combo-menu button:hover {
  background: var(--soft-blue);
}

.combo-empty {
  padding: 0.7rem;
  color: var(--muted);
  font-weight: 800;
}

.calendar-quick-add {
  grid-template-columns: minmax(110px, 0.7fr) minmax(180px, 1.5fr) minmax(145px, 1fr) minmax(130px, 1fr);
  align-items: end;
  border-radius: 8px;
  background: var(--soft-blue);
  padding: 0.7rem;
}

.calendar-member-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}

.member-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  background: white;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.member-chip.active {
  border-color: var(--navy);
  background: var(--soft-blue);
  color: var(--text);
}

.member-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.compact-row .member-dot {
  margin-right: 0.4rem;
}

.calendar-quick-add > button {
  min-width: 90px;
}

.calendar-form-status {
  grid-column: 1 / -1;
  min-height: 1rem;
  margin: 0;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
}

.chore-complete-button {
  min-width: 88px;
  color: var(--green);
}

.paycheck-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.paycheck-card,
.goal-card,
.debt-card {
  display: grid;
  gap: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 0.75rem;
}

.paycheck-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.paycheck-recurrence-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.paycheck-recurrence-field select {
  flex: 1;
}

.debt-card {
  background: var(--soft-blue);
}

.payment-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(180px, 260px) 42px;
  gap: 0.5rem;
  align-items: end;
  max-width: 560px;
}

.mini-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.mini-tags span {
  border-radius: 999px;
  background: var(--green-soft);
  color: #07654b;
  padding: 0.25rem 0.45rem;
  font-weight: 800;
  font-size: 0.72rem;
}

.split-stat {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.split-stat span,
.split-stat b,
.snapshot-grid span {
  display: block;
  border-radius: 6px;
  background: var(--soft);
  padding: 0.55rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.calendar-weekday {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--soft-blue);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-weekday:nth-child(7) {
  border-right: 0;
}

.day-cell {
  min-height: 112px;
  padding: 0.45rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: white;
}

.day-cell:nth-child(7n) {
  border-right: 0;
}

.muted-cell {
  background: #f0f4fa;
}

.outside-month {
  color: #9aa5b5;
}

.event {
  display: block;
  width: 100%;
  margin-top: 0.32rem;
  border: 0;
  border-radius: 4px;
  padding: 0.18rem 0.25rem;
  background: #eaf2ff;
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.event:hover,
.event:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

.event.birthday {
  background: #fff3ce;
  color: #9a6500;
}

.event.birthday-reminder {
  background: #fff7e6;
  color: #a86400;
  border-left: 2px solid var(--gold);
}

.event.Chore,
.event.chore {
  background: var(--green-soft);
  color: var(--green);
}

.meal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 0.55rem;
  overflow-x: auto;
}

.meal-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 0.55rem;
  display: grid;
  gap: 0.45rem;
}

.meal-day-date {
  margin-top: -0.3rem;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.66rem;
}

.meal-slot {
  border-radius: 6px;
  background: white;
  border: 1px solid var(--line);
  padding: 0.45rem;
}

.meal-slot-head {
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.meal-remove-button {
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  padding: 0;
  background: #fff0f0;
  color: var(--coral);
}

.meal-remove-button:hover {
  background: #ffe1e1;
}

.meal-slot em {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-style: normal;
}

.meal-servings-field {
  margin-top: 0.4rem;
}

.meal-servings-field input {
  min-height: 28px;
  padding: 0.25rem 0.4rem;
}

.recipe-panel {
  margin-top: 0.1rem;
}

.recipe-library {
  display: grid;
  gap: 0.8rem;
}

.recipe-builder {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(280px, 1.5fr) 110px 110px auto;
  gap: 0.55rem;
  align-items: end;
}

.recipe-form-actions {
  display: flex;
  gap: 0.45rem;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 0.65rem;
  overflow-x: auto;
}

.recipe-card {
  min-width: 180px;
  display: grid;
  gap: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 0.7rem;
}

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

.recipe-card .section-head > div {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.recipe-card .section-head strong,
.recipe-card .section-head small {
  display: block;
}

.recipe-card .section-head strong {
  overflow-wrap: anywhere;
}

.recipe-card .section-head small {
  color: var(--muted);
  line-height: 1.35;
}

.recipe-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 34px;
  gap: 0.45rem;
  align-items: center;
}

.progress-block {
  display: grid;
  gap: 0.35rem;
}

.progress-block > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--muted);
}

.bar,
.report-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eee9;
}

.bar span,
.report-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.invite-box,
.shared-box {
  border-radius: 8px;
  background: var(--soft-blue);
  padding: 0.85rem;
}

.invite-box {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  text-transform: uppercase;
}

.shared-box p {
  margin: 0.25rem 0 0.7rem;
  color: var(--muted);
  line-height: 1.45;
}

.share-all-toggle {
  width: max-content;
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
  padding: 0.45rem 0.65rem;
  color: var(--text);
  white-space: nowrap;
}

.share-all-toggle input,
.scope-toggle input {
  width: auto;
  min-height: 0;
}

.scope-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}

.scope-toggle {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 6px;
  background: white;
  border: 1px solid var(--line);
  padding: 0.45rem 0.55rem;
  color: var(--text);
}

.scope-toggle:has(input:checked) {
  background: var(--green-soft);
  border-color: #a7e4ca;
  color: #075f46;
}

.report-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 70px;
  align-items: center;
  gap: 0.75rem;
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.big-number {
  font-size: 2rem;
  font-weight: 900;
}

.net-worth-strip {
  display: grid;
  gap: 0.2rem;
  border-radius: 8px;
  background: linear-gradient(90deg, #e9fff5, #f4f1ff);
  padding: 0.85rem;
}

.net-worth-strip strong {
  font-size: 1.8rem;
}

.net-worth-strip span {
  color: var(--muted);
  font-weight: 800;
}

.net-worth-strip span b {
  color: inherit;
}

.debt-edit-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.35fr) repeat(4, minmax(120px, 0.75fr));
  gap: 0.65rem;
  align-items: end;
}

.debt-edit-grid label {
  min-width: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.debt-edit-grid input,
.debt-edit-grid select {
  width: 100%;
  min-height: 40px;
  margin-top: 0.2rem;
  border-color: var(--line);
  background: white;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: none;
}

.debt-asset-field {
  grid-column: 1 / -1;
  max-width: 520px;
}

.debt-payoff-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 260px)) auto;
  gap: 0.6rem;
  align-items: stretch;
}

.debt-payoff-summary span {
  display: grid;
  gap: 0.15rem;
  border-radius: 7px;
  background: white;
  padding: 0.65rem 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.debt-payoff-summary b {
  color: var(--text);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.payment-history {
  border-top: 1px solid var(--line);
  padding-top: 0.55rem;
}

.payment-history summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
}

.payment-history > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
}

.net-worth-items {
  display: grid;
  gap: 0.65rem;
}

.net-worth-item {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(88px, 0.7fr) minmax(100px, 0.85fr) 38px;
  align-items: end;
  gap: 0.55rem;
  border-left: 5px solid var(--green);
  border-radius: 7px;
  background: var(--soft-blue);
  padding: 0.7rem;
}

.net-worth-item:not(.liability):not(.stock) {
  grid-template-columns: minmax(160px, 1.25fr) minmax(100px, 0.6fr) minmax(130px, 0.8fr) minmax(130px, 0.8fr) 42px;
}

.net-worth-item.stock {
  grid-template-columns: minmax(150px, 1.1fr) 100px 130px 110px 110px 130px minmax(130px, 0.85fr) 42px;
}

.stock-market-value {
  display: grid;
  gap: 0.2rem;
  align-self: end;
  min-height: 38px;
  border-radius: 6px;
  background: var(--green-soft);
  padding: 0.45rem 0.65rem;
}

.stock-market-value span {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.stock-market-value strong {
  color: var(--green);
}

.net-worth-item.liability {
  border-left-color: var(--coral);
}

.net-worth-item label {
  min-width: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.net-worth-item input,
.net-worth-item select {
  width: 100%;
  min-height: 38px;
  margin-top: 0.2rem;
  background: white;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: none;
}

.net-worth-item .icon-button {
  min-height: 38px;
}

.donut {
  width: 170px;
  aspect-ratio: 1;
  margin: 0.6rem auto;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0 52%, var(--blue) 52% 78%, var(--gold) 78% 100%);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: white;
}

.notes-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.notes-filter-panel {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 0.25rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.notes-filter-panel > button {
  width: 100%;
  min-height: 40px;
  justify-content: flex-start;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.notes-filter-panel button.active {
  background: #fff1b9;
}

.notes-filter-label,
.notes-section-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.notes-filter-label {
  padding: 0.65rem 0.65rem 0.2rem;
}

.notes-filter-panel .notes-edit-labels {
  margin-bottom: 0.5rem;
  color: var(--muted);
}

.note-labels-dialog-content {
  display: grid;
  gap: 1rem;
  padding: 1.1rem;
}

.note-label-create-form,
.note-label-manager-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  gap: 0.45rem;
  align-items: center;
}

.app-dialog .note-label-create-form,
.app-dialog .note-label-manager-row {
  gap: 0.45rem;
  padding: 0;
}

.note-label-create-form {
  grid-template-columns: minmax(0, 1fr) 36px;
  padding: 0;
}

.note-label-create-form input,
.note-label-manager-row input {
  min-width: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.note-label-create-form button,
.note-label-manager-row button {
  min-width: 36px;
  min-height: 36px;
  padding: 0;
}

.note-label-manager-list {
  display: grid;
  gap: 0.5rem;
}

.note-label-manager-row {
  padding: 0.25rem 0;
}

.note-label-row-leading {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
}

.note-label-tag-icon {
  color: var(--muted);
  text-align: center;
}

.note-label-hover-delete {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.note-label-manager-row:hover .note-label-tag-icon,
.note-label-manager-row:focus-within .note-label-tag-icon {
  opacity: 0;
}

.note-label-manager-row:hover .note-label-hover-delete,
.note-label-manager-row:focus-within .note-label-hover-delete {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none) {
  .note-label-tag-icon {
    display: none;
  }

  .note-label-hover-delete {
    opacity: 1;
    pointer-events: auto;
  }
}

.note-label-manager-empty {
  color: var(--muted);
}

.notes-workspace {
  min-width: 0;
  width: 100%;
  max-width: 1180px;
  display: grid;
  gap: 1rem;
}

.notes-search,
.note-composer,
.note-composer-compact {
  width: 100%;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.note-composer-compact {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  background: white;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: left;
}

.note-composer-compact span:last-child {
  color: var(--text);
  font-size: 1.2rem;
}

.notes-trash-banner {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 0.6rem 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: italic;
}

.notes-trash-banner button {
  min-height: 34px;
  background: transparent;
  color: var(--blue);
}

.notes-search {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  padding: 0 0.75rem;
}

.notes-search span {
  color: var(--muted);
  font-size: 1.25rem;
}

.notes-search input {
  min-height: 48px;
  border: 0;
  outline: 0;
}

.note-composer {
  display: grid;
  gap: 0;
  padding: 0.65rem;
}

.note-composer > input,
.note-composer > textarea {
  min-height: 42px;
  padding: 0.55rem;
  border: 0;
  border-radius: 0;
  outline: 0;
  resize: vertical;
}

.note-composer > input {
  font-weight: 900;
}

.note-composer-checklist {
  display: grid;
  gap: 0.4rem;
  padding: 0.45rem 0.55rem 0.65rem;
}

.note-composer-check-row,
.note-composer-add-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 34px;
  gap: 0.55rem;
  align-items: center;
}

.note-composer-check-row > input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.note-composer-check-row > input[data-composer-check-text] {
  min-height: 36px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.note-composer-add-item {
  grid-template-columns: minmax(0, 1fr);
  padding-left: 30px;
}

.note-composer-add-item input {
  min-height: 38px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.note-composer-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr)) auto auto;
  gap: 0.5rem;
  align-items: end;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}

.note-composer-row > label,
.note-label-picker-field,
.note-card-label-editor {
  min-width: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.note-composer-row select,
.note-composer-row input[type="date"] {
  width: 100%;
  margin-top: 0.25rem;
}

.note-composer-row .note-pin-toggle {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
}

.note-composer-row .note-pin-toggle.active {
  background: #fff1b9;
  color: var(--text);
}

.note-label-picker {
  position: relative;
  margin-top: 0.25rem;
  color: var(--text);
  font-size: 0.82rem;
  text-transform: none;
}

.note-label-picker summary {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  cursor: pointer;
  list-style: none;
}

.note-label-picker summary::-webkit-details-marker {
  display: none;
}

.note-label-picker summary::after {
  content: "▾";
  color: var(--muted);
}

.note-label-picker[open] summary::after {
  content: "▴";
}

.note-label-picker-options {
  position: absolute;
  z-index: 25;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  display: grid;
  overflow-y: auto;
  max-height: 220px;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  box-shadow: 0 8px 20px rgba(25, 38, 61, 0.16);
}

.note-label-picker-options label {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.45rem;
  border-radius: 5px;
  color: var(--text);
  cursor: pointer;
}

.note-label-picker-options label:hover {
  background: var(--soft-blue);
}

.note-label-picker-options input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.note-label-picker-options small {
  padding: 0.5rem;
  color: var(--muted);
}

.notes-result-section {
  min-width: 0;
}

.notes-section-label {
  margin: 0 0 0.55rem 0.2rem;
}

.notes-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
  align-items: start;
}

.note-card {
  position: relative;
  display: grid;
  width: 100%;
  gap: 0.75rem;
  margin: 0;
  padding: 0.95rem 1rem;
  border: 1px solid #d8dee9;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(25, 38, 61, 0.06);
}

.note-card-toolbar {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 34px);
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  margin-top: 0.15rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(107, 117, 134, 0.18);
  opacity: 0.65;
  transition: opacity 120ms ease;
}

.note-card:hover .note-card-toolbar,
.note-card:focus-within .note-card-toolbar {
  opacity: 1;
}

.note-card-toolbar > button,
.note-card-toolbar summary,
.note-color-control {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  font-family: Arial, sans-serif;
  font-size: 1rem;
  line-height: 1;
}

.note-card-toolbar > details,
.note-card-toolbar > .note-toolbar-labels {
  display: grid;
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  place-items: center;
}

.note-card-toolbar .note-more-menu {
  margin-left: 0;
}

.meal-slot-open {
  width: 100%;
  min-height: 76px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 0.2rem;
  color: var(--text);
  text-align: left;
}

.meal-slot-open:hover,
.meal-slot-open:focus-visible,
.meal-slot-planned:hover,
.meal-slot-planned:focus-visible {
  border-color: var(--green);
  background: var(--green-soft);
}

.meal-slot-planned {
  cursor: pointer;
}

.meal-feedback {
  min-height: 1.25rem;
  margin: 0.2rem 0 0.5rem;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
}

.note-card-toolbar summary::-webkit-details-marker {
  display: none;
}

.note-card-toolbar > button:hover,
.note-card-toolbar summary:hover,
.note-color-control:hover {
  background: rgba(25, 38, 61, 0.08);
  color: var(--text);
}

.note-color-control {
  position: relative;
  overflow: hidden;
}

.note-color-control select {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}

.note-toolbar-popover,
.note-more-menu,
.note-toolbar-labels {
  position: relative;
}

.note-toolbar-popover-panel,
.note-more-menu-panel {
  position: absolute;
  z-index: 35;
  bottom: calc(100% + 6px);
  left: 0;
  min-width: 210px;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  box-shadow: 0 10px 28px rgba(25, 38, 61, 0.18);
}

.note-toolbar-popover-panel label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.note-more-menu {
  margin-left: auto;
}

.note-more-menu-panel {
  right: 0;
  left: auto;
  display: grid;
  padding: 0.3rem;
}

.note-more-menu-panel button {
  width: 100%;
  min-height: 38px;
  justify-content: flex-start;
  border: 0;
  background: white;
  color: var(--text);
  text-align: left;
}

.note-more-menu-panel button:hover {
  background: var(--soft-blue);
}

.note-toolbar-labels .note-label-picker {
  margin: 0;
}

.note-label-picker-compact summary {
  justify-content: normal;
}

.note-label-picker-compact summary::after {
  display: none;
}

.note-toolbar-labels .note-label-picker-options {
  top: auto;
  right: 0;
  bottom: calc(100% + 6px);
  left: auto;
  width: 220px;
}

@media (hover: none) {
  .note-card-toolbar {
    opacity: 1;
  }
}

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

.note-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 0.5rem;
  align-items: start;
}

.note-card-head strong,
.note-title-input {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
}

.note-card p,
.note-body-input {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.note-title-input,
.note-body-input,
.note-check-text,
.note-add-item-form input {
  min-width: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

.note-title-input {
  min-height: 34px;
  padding: 0;
  font-weight: 900;
}

.note-body-input {
  min-height: 32px;
  padding: 0;
  resize: vertical;
}

.note-title-input:focus,
.note-body-input:focus,
.note-check-text:focus,
.note-add-item-form input:focus {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
  outline: 0;
}

.note-icon-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.note-icon-button.active {
  color: var(--gold);
  background: #fff1b9;
}

.note-reminder {
  width: fit-content;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  background: rgba(19, 147, 109, 0.1);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 900;
}

.note-check-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 0.55rem;
  align-items: center;
  min-height: 34px;
}

.note-check-item input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.note-check-item span {
  overflow-wrap: anywhere;
}

.note-check-item.done span {
  color: var(--muted);
  text-decoration: line-through;
}

.note-check-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 30px 30px;
  gap: 0.55rem;
  align-items: center;
  min-height: 34px;
}

.note-check-row.child-item {
  margin-left: 1.75rem;
  padding-left: 0.65rem;
  border-left: 2px solid var(--border);
}

.note-check-level {
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.note-check-combobox {
  position: relative;
  min-width: 0;
}

.note-check-combobox .note-check-text {
  width: 100%;
}

.note-check-row > input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.note-check-row.done .note-check-text {
  color: var(--muted);
  text-decoration: line-through;
}

.note-check-delete {
  min-height: 30px;
  padding: 0;
  border: 0;
  background: rgba(239, 80, 80, 0.1);
  color: var(--coral);
}

.note-add-item-form {
  display: block;
}

.note-item-combobox {
  position: relative;
  min-width: 0;
}

.note-add-item-form input {
  min-height: 34px;
  padding: 0.25rem 0.35rem;
}

.note-item-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  box-shadow: 0 8px 20px rgba(25, 38, 61, 0.16);
}

.note-item-suggestions[hidden] {
  display: none;
}

.note-item-suggestions button {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: white;
  color: var(--text);
  text-align: left;
}

.note-item-suggestions button:last-child {
  border-bottom: 0;
}

.note-item-suggestions button:hover,
.note-item-suggestions button:focus-visible {
  background: var(--soft-blue);
}

.note-item-suggestions small {
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

.note-completed {
  margin-top: 0.1rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(107, 117, 134, 0.25);
}

.note-completed summary {
  list-style-position: outside;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
}

.note-labels,
.note-card-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.note-labels:empty {
  display: none;
}

.note-card-label-editor {
  max-width: 220px;
}

.note-labels {
  align-items: center;
}

.note-labels span {
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #e2f6ee;
  color: #087453;
  font-size: 0.75rem;
  font-weight: 900;
}

.note-card-actions {
  align-items: center;
  justify-content: flex-start;
  margin-top: 0.1rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(107, 117, 134, 0.18);
}

.note-card-actions button {
  min-height: 30px;
  padding: 0.3rem 0.65rem;
  background: transparent;
  color: var(--muted);
}

.note-card-actions .danger-button {
  color: var(--coral);
}

.notes-empty {
  padding: 3rem 1rem;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.admin-layout {
  display: grid;
  gap: 1rem;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
}

.admin-stat-grid article {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, white, var(--soft));
  padding: 0.8rem;
}

.admin-stat-grid span,
.admin-table-head {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-stat-grid strong {
  font-size: 1.55rem;
}

.admin-table {
  display: grid;
  gap: 0.5rem;
}

.admin-table-head,
.admin-user-row,
.admin-month-head,
.admin-month-row {
  display: grid;
  gap: 0.7rem;
  align-items: center;
}

.admin-table-head,
.admin-user-row {
  grid-template-columns: minmax(220px, 1.3fr) 110px 90px 160px minmax(300px, 1.2fr);
}

.admin-table-head {
  padding: 0 0.65rem;
  font-size: 0.7rem;
}

.admin-user-row,
.admin-month-row {
  border-radius: 8px;
  background: var(--soft-blue);
  padding: 0.65rem;
}

.admin-user-row small {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.admin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.admin-actions button {
  min-height: 32px;
  white-space: nowrap;
}

.admin-month-table {
  display: grid;
  gap: 0.45rem;
}

.admin-month-head,
.admin-month-row {
  grid-template-columns: minmax(180px, 1fr) repeat(4, minmax(110px, 0.5fr));
}

.admin-month-head {
  padding: 0 0.65rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-month-row span {
  font-weight: 800;
}

@media (max-width: 1120px) {
  .work-grid,
  .transactions-grid,
  .wealth-layout,
  .calendar-layout,
  .notes-layout {
    grid-template-columns: 1fr;
  }

  .notes-filter-panel {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .notes-filter-label,
  .notes-edit-labels {
    grid-column: 1 / -1;
  }

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

  .admin-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-table-head,
  .admin-month-head {
    display: none;
  }

  .admin-user-row,
  .admin-month-row {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-shell {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .sidebar {
    min-height: auto;
    min-width: 0;
    padding: 1rem;
  }

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

  .nav-button {
    min-width: 0;
    padding-inline: 0.55rem;
  }

  main {
    min-width: 0;
    width: 100%;
    padding: 1rem 0.75rem;
  }

  .view,
  .workspace,
  .main-stack,
  .side-stack,
  .card,
  .budget-table {
    min-width: 0;
    max-width: 100%;
  }

  .topbar,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .month-control,
  .week-control,
  .user-chip,
  .topbar-actions button {
    width: 100%;
  }

  .metrics-grid,
  .paycheck-grid,
  .auth-panel,
  .help-grid,
  .help-columns,
  .mini-form,
  .paycheck-builder,
  .meal-toolbar,
  .recipe-builder,
  .invite-form,
  .calendar-quick-add,
  .transaction-subcategory-adder,
  .payment-row,
  .category-adder,
  .budget-ledger-head,
  .budget-money-row,
  .assign-row,
  .ledger-assign-row,
  .report-row {
    grid-template-columns: 1fr;
  }

  .help-journey,
  .help-visual-feature,
  .goal-edit-grid {
    grid-template-columns: 1fr;
  }

  .help-journey article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .help-journey article:last-child {
    border-bottom: 0;
  }

  .help-visual-feature img {
    height: 220px;
  }

  .goal-edit-grid .icon-button {
    width: 100%;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .section-head > button,
  .section-head > label {
    width: 100%;
  }

  .category-row {
    padding: 0.65rem;
  }

  .category-title {
    grid-template-columns: 7px minmax(0, 1fr) 36px;
    grid-template-areas:
      "color name delete"
      "color spent delete"
      "color planned delete"
      "add add add";
    align-items: center;
    row-gap: 0.3rem;
  }

  .category-title i {
    grid-area: color;
    align-self: stretch;
    height: auto;
    min-height: 44px;
  }

  .category-name {
    grid-area: name;
    min-width: 0;
  }

  .category-name strong {
    overflow-wrap: anywhere;
  }

  .category-spent {
    grid-area: spent;
    margin: 0;
  }

  .category-planned {
    grid-area: planned;
    min-width: 0;
    text-align: left;
  }

  .category-add-line {
    grid-area: add;
    width: 100%;
    min-height: 38px;
    margin-top: 0.25rem;
  }

  .category-title .icon-button {
    grid-area: delete;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
  }

  .budget-line {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 38px;
    grid-template-areas:
      "title title title delete"
      "planned spent remaining delete";
    gap: 0.65rem;
    padding: 0.85rem 0.4rem;
  }

  .line-title-stack {
    grid-area: title;
    min-width: 0;
  }

  .line-name-input {
    min-width: 0;
    width: 100%;
    font-size: 1rem;
  }

  .due-day-field {
    width: 100%;
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .due-day-field input {
    min-width: 0;
    width: 100%;
  }

  .budget-line-planned {
    grid-area: planned;
  }

  .budget-line-spent {
    grid-area: spent;
  }

  .budget-line-remaining {
    grid-area: remaining;
  }

  .budget-line-value {
    display: grid;
    align-content: start;
    gap: 0.2rem;
    text-align: left;
  }

  .budget-line-value > small {
    display: block;
    margin: 0;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .budget-line-value .money-input {
    min-width: 0;
    width: 100%;
    min-height: 38px;
    padding-inline: 0.35rem;
    border-color: var(--line);
    background: white;
    text-align: left;
  }

  .budget-line-value span,
  .budget-line-value b {
    line-height: 1.25;
  }

  .budget-line-delete {
    grid-area: delete;
    align-self: stretch;
    width: 38px;
    min-width: 38px;
    height: 100%;
    min-height: 76px;
  }

  .help-topic,
  .help-topic:nth-child(2n),
  .help-topic:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .help-topic:last-child {
    border-bottom: 0;
  }

  .help-footer {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .meal-grid {
    grid-template-columns: 1fr;
    overflow-x: visible;
  }

  .meal-day {
    min-width: 0;
  }

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

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

  .admin-stat-grid {
    grid-template-columns: 1fr;
  }

  .notes-filter-panel,
  .note-composer-row {
    grid-template-columns: 1fr;
  }

  .notes-board {
    grid-template-columns: 1fr;
  }

  .net-worth-item {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 38px;
    grid-template-areas:
      "name name delete"
      "type amount delete";
    align-items: end;
  }

  .net-worth-name {
    grid-area: name;
  }

  .net-worth-item label:nth-of-type(2) {
    grid-area: type;
  }

  .net-worth-item label:nth-of-type(3) {
    grid-area: amount;
  }

  .net-worth-item .icon-button {
    grid-area: delete;
    align-self: stretch;
    width: 38px;
    min-width: 38px;
  }

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

  .debt-name-field {
    grid-column: 1 / -1;
  }

  .debt-payoff-summary,
  .payment-history > div {
    grid-template-columns: 1fr;
  }

  .debt-payoff-summary button {
    width: 100%;
  }

  .net-worth-item,
  .net-worth-item:not(.liability):not(.stock),
  .net-worth-item.stock {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: none;
  }

  .net-worth-item > *,
  .net-worth-name,
  .net-worth-item label:nth-of-type(2),
  .net-worth-item label:nth-of-type(3),
  .net-worth-item .icon-button {
    grid-area: auto;
  }

  .net-worth-name,
  .stock-market-value {
    grid-column: 1 / -1;
  }

  .net-worth-item .icon-button {
    grid-column: 2;
    width: 100%;
  }
}

.private-note {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.journal-layout,
.plan-layout {
  display: grid;
  gap: 0.85rem;
  max-width: 760px;
}

.journal-composer,
.plan-task-form {
  display: grid;
  gap: 0.6rem;
}

.plan-task-form {
  grid-template-columns: minmax(180px, 1fr) 160px auto;
  align-items: end;
}

.journal-composer label,
.journal-entry-row label {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.journal-composer textarea {
  grid-column: 1 / -1;
}

.journal-photo-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.journal-photo-picker input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.journal-entries {
  display: grid;
  gap: 0.75rem;
}

.journal-entry {
  display: grid;
  gap: 0.6rem;
}

.journal-entry-head {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 34px;
  gap: 0.5rem;
  align-items: center;
}

.journal-entry-row {
  display: grid;
  grid-template-columns: minmax(140px, 200px) minmax(0, 1fr);
  gap: 0.6rem;
  align-items: end;
}

.journal-title-input {
  font-size: 1.05rem;
  font-weight: 800;
}

.journal-body-input {
  white-space: pre-wrap;
}

.journal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.journal-tags span {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 800;
}

.journal-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.journal-photo {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 7px;
  overflow: hidden;
}

.journal-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.journal-photo button {
  position: absolute;
  top: 4px;
  right: 4px;
}

.plan-bucket-tabs {
  display: flex;
  gap: 0.4rem;
}

.plan-bucket-tabs button {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
}

.plan-bucket-tabs button.active {
  border-color: var(--navy);
  background: var(--soft-blue);
  color: var(--text);
}

.plan-task-list {
  display: grid;
  gap: 0.5rem;
}

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

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

.plan-task-copy {
  display: grid;
  gap: 0.1rem;
}

.plan-task-copy small {
  color: var(--muted);
}

.plan-task-title {
  border: 0;
  font-weight: 700;
  color: var(--text);
}

.plan-day-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
}

.plan-day-nav .ghost {
  margin-left: auto;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}

.plan-task-form-daily {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
}

.plan-task-form-daily > input[name="title"] {
  flex: 1 1 200px;
}

.plan-task-form-daily label {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  flex: 0 0 auto;
}

.plan-task-form-daily label input[type="time"] {
  width: 130px;
}

.plan-task-form-daily label input[type="number"] {
  width: 90px;
}

.plan-task-form-daily label select {
  width: 160px;
}

.plan-unscheduled {
  display: grid;
  gap: 0.5rem;
}

.plan-unscheduled h4 {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.plan-timeline {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.plan-timeline-hours {
  border-right: 1px solid var(--line);
}

.plan-timeline-hour {
  padding: 0.2rem 0.4rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  box-sizing: border-box;
}

.plan-timeline-body {
  position: relative;
}

.plan-timeline-block {
  position: absolute;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 28px;
  align-items: start;
  gap: 0.4rem;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  border-left: 3px solid var(--green);
  background: var(--green-soft);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.plan-timeline-block.done {
  opacity: 0.6;
}

.plan-timeline-block.done .plan-task-title {
  text-decoration: line-through;
  color: var(--muted);
}

.plan-timeline-block.editing {
  border-left-color: var(--coral);
  box-shadow: 0 0 0 2px var(--coral) inset;
}

.plan-timeline-block.compact {
  padding: 3px 6px;
  align-items: center;
  gap: 0.4rem;
}

.plan-timeline-block.compact input[type="checkbox"] {
  width: 15px;
  height: 15px;
  min-width: 0;
  min-height: 0;
}

.plan-timeline-block.compact .plan-block-copy {
  gap: 0;
}

.plan-timeline-block.compact .plan-task-title {
  min-height: 0;
  height: 19px;
  padding: 0 2px;
  font-size: 0.82rem;
  line-height: 19px;
}

.plan-timeline-block.compact .plan-block-copy small {
  font-size: 0.62rem;
  line-height: 1.1;
  padding-left: 2px;
}

.plan-timeline-block.compact .plan-block-resize-handle {
  height: 4px;
}

.plan-timeline-block .icon-button.danger-button {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  font-size: 0.75rem;
}

.plan-block-copy {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}

.plan-block-copy small {
  color: var(--muted);
  font-size: 0.66rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-block-resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8px;
  cursor: ns-resize;
  touch-action: none;
}

.plan-subtasks {
  display: grid;
  gap: 0.3rem;
  margin: -0.25rem 0.75rem 0.4rem 2.2rem;
}

.plan-subtask-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.plan-subtask-row.done span {
  color: var(--muted);
  text-decoration: line-through;
}

.plan-subtask-row span {
  flex: 1;
}

.plan-add-subtask-form input {
  width: 100%;
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  background: transparent;
}

.plan-timeline-details {
  display: grid;
  gap: 0.6rem;
}

.plan-timeline-detail {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.plan-timeline-detail h4 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
}

.plan-timeline-detail .plan-subtasks {
  margin: 0;
}

.documents-layout {
  display: grid;
  gap: 0.85rem;
  max-width: 900px;
}

.documents-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.documents-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.documents-breadcrumb button {
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 700;
}

.documents-breadcrumb button.active {
  color: var(--text);
  background: var(--soft-blue);
}

.documents-breadcrumb span {
  color: var(--muted);
}

.documents-actions {
  display: flex;
  gap: 0.5rem;
}

.documents-actions button {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-weight: 800;
  font-size: 0.8rem;
}

.documents-upload-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.documents-upload-button.disabled {
  opacity: 0.6;
  cursor: default;
}

.documents-upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.documents-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
}

.documents-folder-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.documents-folder-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.documents-folder-open {
  flex: 1;
  text-align: left;
  font-weight: 700;
}

/* A shared square size for every icon-only action next to a folder or file
   (download, delete, and the note/wealth link picker toggles) so they line
   up cleanly in a row instead of each sizing itself differently — plain
   buttons shrink to their glyph, .icon-button is 48px (sized for other parts
   of the app), and <details> summaries default to ~42px with a stray
   dropdown caret. */
.documents-icon-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  flex-shrink: 0;
}

.documents-icon-btn.danger-button {
  color: var(--coral);
}

.document-note-link-picker summary,
.document-wealth-link-picker summary {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  justify-content: center;
}

.document-note-link-picker summary::after,
.document-wealth-link-picker summary::after {
  display: none;
}

.documents-file-list {
  display: grid;
  gap: 0.6rem;
}

.documents-file-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.documents-file-info {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.documents-file-info small {
  color: var(--muted);
}

.documents-linked-note {
  color: var(--blue);
}

.documents-file-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.documents-move-select {
  max-width: 160px;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.78rem;
}

/* .note-label-picker-options is normally stretched edge-to-edge of its
   anchor (left:0;right:0), which works fine inside a wide note card. Here
   the anchor is just a small icon button, so without this override the
   dropdown collapses to the icon's own width and clips every option's text. */
.document-note-link-picker {
  flex: none;
}

.document-note-link-picker .note-label-picker-options {
  left: auto;
  min-width: 240px;
}

.document-wealth-link-picker {
  flex: none;
}

.document-wealth-link-picker .note-label-picker-options {
  left: auto;
  min-width: 240px;
}

.wealth-doc-chip {
  grid-column: 1 / -1;
  justify-self: start;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
}

.wealth-doc-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.35rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}

.wealth-doc-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.documents-folder-card[draggable="true"],
.documents-file-row[draggable="true"] {
  cursor: grab;
}

.documents-folder-card.dragging,
.documents-file-row.dragging {
  opacity: 0.5;
}

.documents-breadcrumb button[data-documents-drop-target],
.documents-folder-card[data-documents-drop-target] {
  transition: background 0.1s ease, outline 0.1s ease;
}

.documents-drop-target-active {
  background: var(--soft-blue) !important;
  outline: 2px dashed var(--blue);
  outline-offset: -2px;
}
