/* biome-ignore-all lint/style/noDescendingSpecificity: start-journey selectors are intentionally scoped above shared legacy rules. */
@font-face {
  font-family: "Anuphan";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("/assets/fonts/anuphan-thai-variable.woff2") format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

.overview-focus-row.is-start {
  border-color: color-mix(in srgb, var(--primary, #168a5b) 24%, transparent);
  background: color-mix(in srgb, var(--primary-soft, #e8f5ef) 72%, white);
}

.start-journey-card .unified-item-kind {
  color: var(--primary, #168a5b);
}

.start-journey-detail {
  display: grid;
  gap: 1rem;
}

.start-journey-facts {
  display: grid;
  gap: 0.65rem;
}

.seven-day-goal-entry {
  width: 100%;
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid var(--mint-border, #b9d9d0);
  border-radius: 20px;
  background: var(--mint-soft, #edf8f4);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
}

.seven-day-goal-entry span,
.seven-day-goal-entry strong,
.seven-day-goal-entry small {
  display: block;
}

.seven-day-goal-entry strong {
  font-size: var(--text-body);
}
.seven-day-goal-entry small {
  margin-top: 3px;
  color: var(--muted);
}
.seven-day-goal-entry b {
  font-size: 24px;
}

.seven-day-goal-badge {
  display: inline-flex;
  margin-bottom: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--mint-soft, #edf8f4);
  color: var(--ink);
  font-size: var(--text-meta);
  font-weight: 700;
}

.habit-card-approved-copy small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.seven-day-setup-group {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft, #fafafa);
}

.seven-day-plan-hint {
  margin: -4px 0 4px;
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: 1.55;
}

.seven-day-goal-progress {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.seven-day-task-list {
  display: grid;
  gap: 8px;
}

.seven-day-task-row {
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 10px;
}

.seven-day-task-row div,
.seven-day-task-row strong,
.seven-day-task-row small {
  display: block;
}
.seven-day-task-row small {
  margin-top: 2px;
  color: var(--muted);
}
.seven-day-task-row.is-completed {
  background: var(--mint-soft, #edf8f4);
}
.seven-day-task-row.is-skipped {
  opacity: 0.6;
}

.start-timeline {
  display: grid;
  gap: 0.5rem;
}

.start-timeline-day {
  display: grid;
  grid-template-columns: minmax(4.5rem, auto) 1fr;
  gap: 0.25rem 0.75rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line, #dce7e1);
  border-radius: 0.75rem;
  background: var(--surface, #fff);
}

.start-timeline-day.is-current {
  border-color: var(--primary, #168a5b);
  background: var(--primary-soft, #e8f5ef);
}

.start-timeline-day small {
  grid-column: 2;
  color: var(--muted, #607069);
}

.start-review-record {
  display: grid;
  gap: 0.3rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line, #dce7e1);
}

.start-summary-section {
  display: grid;
  gap: 0.75rem;
}

@font-face {
  font-family: "Anuphan";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("/assets/fonts/anuphan-latin-variable.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

:root {
  --ink: #27346a;
  --ink-soft: #626988;
  --paper: #fffdf9;
  --surface: #fff;
  --mint-pale: #eef8f5;
  --mint: #ddf3ec;
  --mint-strong: #8bd4bc;
  --coral-soft: #fff0ef;
  --coral: #ff7b76;
  --pending-ink: #8a4744;
  --lime-soft: #f2fad9;
  --lime: #c8f06a;
  --line: #d7e2dd;
  --danger: #c64b4b;
  --shadow: 0 18px 50px rgb(39 52 106 / 10%);
  --text-meta: 0.875rem;
  --text-label: 0.9375rem;
  --text-body: 1rem;
  color: var(--ink);
  background: var(--paper);
  font-family: "Anuphan", "Noto Sans Thai", "Leelawadee UI", "Thonburi", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  font-size: var(--text-body);
  line-height: 1.55;
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

button:not(:disabled) {
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    opacity 120ms ease;
}

button:not(:disabled):active {
  transform: translateY(1px) scale(0.99);
}

button.is-pending {
  cursor: wait;
  opacity: 0.68;
}

[data-go],
[data-view],
[data-action] {
  cursor: pointer;
}

[hidden][hidden] {
  display: none;
}

.brand-wordmark {
  position: relative;
  display: inline-block;
  padding-right: 0.32em;
  color: var(--ink);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
  white-space: nowrap;
}

.brand-wordmark::after {
  position: absolute;
  top: 0.02em;
  right: 0;
  width: 0.18em;
  height: 0.18em;
  border-radius: 50%;
  background: var(--coral);
  content: "";
}

.brand-wordmark-large {
  font-size: 2.8rem;
}

.brand-mark {
  display: block;
  height: auto;
  overflow: visible;
}

.loading-brand {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.loading-screen,
.state-screen {
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 48px 28px calc(48px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.loading-screen p,
.state-screen p {
  color: var(--ink-soft);
}

.loading-screen .loading-brand {
  animation: breathe 1.8s ease-in-out infinite;
}

.loading-screen p {
  margin: 12px 0 0;
}

.state-screen h1 {
  margin: 28px 0 8px;
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.state-screen > p {
  max-width: 340px;
  margin: 0 0 28px;
  line-height: 1.7;
}

.state-art {
  position: relative;
  width: 230px;
  height: 110px;
  margin-top: 44px;
  border: 8px solid var(--ink);
  border-top-color: transparent;
  border-right-color: transparent;
  border-radius: 0 0 0 70px;
  transform: rotate(-8deg);
}

.state-art span {
  position: absolute;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--coral);
}

.state-art span:nth-child(1) {
  left: -10px;
  bottom: -11px;
}

.state-art span:nth-child(2) {
  left: 95px;
  bottom: -11px;
  background: var(--mint-strong);
}

.state-art span:nth-child(3) {
  right: -4px;
  top: -5px;
  background: var(--lime);
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  padding: 0 20px;
  font-weight: 700;
}

.primary-button {
  border: 0;
  background: var(--coral);
  box-shadow: 0 12px 26px rgb(255 123 118 / 22%);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
}

.state-screen .primary-button {
  max-width: 360px;
}

.quiet-link {
  margin-top: 20px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 600;
}

.app-shell {
  width: min(100%, 840px);
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: calc(102px + env(safe-area-inset-bottom));
  background: var(--paper);
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  height: calc(64px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 42px 0;
  border-bottom: 1px solid rgb(215 226 221 / 70%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgb(255 253 249 / 92%);
  backdrop-filter: blur(18px);
}

.app-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.goals-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.goals-header-more {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--surface);
  font-size: 1.65rem;
  line-height: 1;
}

.goals-header-menu {
  position: relative;
}

.goals-header-menu summary {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  list-style: none;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.65rem;
  line-height: 1;
}

.goals-header-menu summary::-webkit-details-marker {
  display: none;
}

.goals-header-menu[open] summary {
  border-color: var(--mint-strong);
  box-shadow: 0 0 0 3px rgb(140 220 197 / 22%);
}

.goals-header-menu-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 14px 32px rgb(39 52 106 / 14%);
}

.goals-header-menu-popover button,
.goals-reorder-done {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 0 13px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-meta);
  font-weight: 700;
  white-space: nowrap;
}

.goals-header-menu-popover button {
  width: 100%;
  text-align: left;
}

.goals-header-menu-popover button:hover,
.goals-header-menu-popover button:focus-visible {
  background: var(--mint-pale);
}

.goals-reorder-done {
  background: var(--mint);
}

.goals-header-add {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: var(--ink);
  color: var(--surface);
  font-size: var(--text-label);
  font-weight: 700;
  box-shadow: 0 10px 24px rgb(39 52 106 / 16%);
}

.preview-notice {
  margin: 12px 20px -8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--mint);
  color: var(--ink-soft);
  font-size: var(--text-meta);
  text-align: center;
}

.brand-home {
  border: 0;
  padding: 4px 0;
  background: transparent;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
}

.icon-button span {
  margin-top: -3px;
  font-size: 1.5rem;
}

.app-content {
  padding: 26px 42px 0;
}

.welcome-row,
.page-heading {
  margin-bottom: 22px;
  display: flex;
  gap: 20px;
  align-items: flex-end;
  justify-content: space-between;
}

.welcome-row h1,
.page-heading h1 {
  margin: 3px 0 0;
  font-size: clamp(1.75rem, 7vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.overline {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.avatar {
  width: 50px;
  height: 50px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  background: var(--mint-strong);
  box-shadow: 0 6px 18px rgb(39 52 106 / 12%);
  font-weight: 700;
  overflow: hidden;
}

.profile-trigger {
  min-height: 54px;
  padding: 4px 10px 4px 4px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  box-shadow: 0 6px 18px rgb(39 52 106 / 10%);
}

.profile-trigger .avatar {
  width: 44px;
  height: 44px;
  border-width: 2px;
}

.profile-trigger-label {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.profile-trigger-arrow {
  color: var(--ink-soft);
  font-size: 1.1rem;
  line-height: 1;
}

.profile-trigger:hover {
  border-color: var(--ink-soft);
}

.profile-trigger:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
}

.avatar img,
.profile-picture img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.summary-grid {
  margin: 12px 0 24px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.summary-card {
  min-height: 116px;
  padding: 18px;
  border: 1px solid rgb(39 52 106 / 7%);
  border-radius: 21px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
}

.summary-card:nth-child(1) {
  background: var(--mint);
}

.summary-card:nth-child(2) {
  background: var(--coral-soft);
}

.summary-card span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 600;
}

.summary-card strong {
  display: block;
  margin-top: 14px;
  font-size: 1.65rem;
}

.summary-card small {
  margin-left: 4px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 500;
}

.summary-page {
  margin: 0 0 28px;
}

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

.overview-focus-row {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 15px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  background: var(--surface);
}

.overview-focus-row.is-habit {
  background: var(--mint-pale);
}

.overview-focus-copy,
.overview-focus-copy > span,
.overview-focus-copy strong,
.overview-focus-copy small {
  min-width: 0;
  display: block;
}

.overview-focus-copy > span {
  color: var(--ink-soft);
  font-size: var(--text-meta);
  font-weight: 600;
}

.overview-focus-copy strong {
  margin-top: 2px;
  font-size: var(--text-label);
  line-height: 1.4;
  text-wrap: balance;
}

.overview-focus-row.is-habit .overview-focus-copy strong {
  margin-top: 0;
}

.overview-focus-copy small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: var(--text-meta);
  line-height: 1.45;
  text-wrap: pretty;
}

.overview-focus-progress {
  margin-top: 9px;
}

.overview-focus-action,
.overview-focus-link {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: var(--ink);
  color: var(--surface);
  font: inherit;
  font-size: var(--text-label);
  font-weight: 700;
  white-space: nowrap;
}

.overview-focus-link {
  padding: 0 2px;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
}

.overview-focus-link span {
  margin-left: 4px;
  font-size: 1.1rem;
}

.overview-focus-card,
.overview-empty {
  width: 100%;
  min-height: 116px;
  border: 1px solid rgb(39 52 106 / 7%);
  border-radius: 21px;
  padding: 18px;
  position: relative;
  display: block;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
}

.overview-focus-card:nth-child(1) {
  background: var(--mint);
}

.overview-focus-card:nth-child(2) {
  background: var(--coral-soft);
}

.overview-focus-card:only-child {
  grid-column: 1 / -1;
}

.overview-focus-card > span,
.overview-focus-card strong,
.overview-focus-card small,
.overview-empty > span,
.overview-empty strong,
.overview-empty small {
  display: block;
}

.overview-focus-card > span,
.overview-empty > span {
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 600;
}

.overview-focus-card strong,
.overview-empty strong {
  margin-top: 12px;
  padding-right: 22px;
  font-size: 1.08rem;
  line-height: 1.3;
}

.overview-focus-card small,
.overview-empty small {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: var(--text-meta);
  line-height: 1.45;
}

.overview-focus-card b {
  position: absolute;
  right: 18px;
  bottom: 16px;
  font-size: 1.2rem;
}

.overview-empty {
  grid-column: 1 / -1;
}

.chat-examples {
  margin-top: 28px;
}

.chat-examples-intro {
  margin: -3px 0 12px;
  color: var(--ink-soft);
  font-size: var(--text-meta);
  line-height: 1.55;
}

.chat-example-list {
  display: grid;
  gap: 9px;
}

.chat-example-card {
  width: 100%;
  min-height: 80px;
  border: 1px solid rgb(39 52 106 / 9%);
  border-radius: 17px;
  padding: 13px 16px;
  display: block;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
}

.chat-example-card span,
.chat-example-card strong,
.chat-example-card small {
  display: block;
}

.chat-example-card span {
  color: var(--ink-soft);
  font-size: var(--text-meta);
  font-weight: 600;
}

.chat-example-card strong {
  margin-top: 2px;
  font-size: var(--text-label);
  line-height: 1.45;
}

.chat-example-card small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: var(--text-meta);
}

.chat-example-status {
  min-height: 22px;
  margin: 8px 2px 0;
  color: var(--ink-soft);
  font-size: var(--text-meta);
  line-height: 1.5;
}

.chat-example-status:empty {
  display: none;
}

.chat-example-chat-link {
  min-height: 44px;
  margin-top: 2px;
  border: 0;
  padding: 0 2px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-label);
  font-weight: 700;
}

.chat-example-chat-link span {
  margin-left: 4px;
  font-size: 1.1rem;
}

.overview-loading strong,
.overview-loading small {
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgb(39 52 106 / 7%) 25%,
    rgb(255 255 255 / 72%) 50%,
    rgb(39 52 106 / 7%) 75%
  );
  background-size: 200% 100%;
  animation: loading-sheen 1.4s ease-in-out infinite;
}

.overview-loading strong {
  width: min(72%, 260px);
  height: 22px;
  padding: 0;
}

.overview-loading small {
  width: min(48%, 180px);
  height: 14px;
}

.overview-actions {
  margin-top: 14px;
  display: grid;
  gap: 4px;
}

.overview-actions .primary-button {
  min-height: 52px;
  font-size: var(--text-label);
}

.overview-primary-action {
  background: var(--ink);
  box-shadow: 0 10px 24px rgb(39 52 106 / 16%);
  color: var(--surface);
}

.overview-browse-link {
  width: fit-content;
  min-height: 44px;
  border: 0;
  padding: 0 4px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-label);
  font-weight: 700;
  text-align: left;
}

.overview-browse-link span {
  margin-left: 4px;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.summary-insight-heading {
  margin-top: 28px;
}

.plan-summary-card {
  padding: 18px;
}

.plan-summary-card .client-main > div {
  min-width: 0;
}

.plan-summary-card .client-main small {
  display: block;
  margin-top: 5px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.plan-primary-button {
  width: 100%;
  margin-top: 14px;
  border: 0;
  border-radius: 16px;
  padding: 13px 16px;
  display: grid;
  gap: 2px;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.plan-primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.plan-reassurance,
.billing-note {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: var(--text-meta);
  line-height: 1.55;
  text-align: center;
}

.plan-text-button {
  width: auto;
  min-height: 44px;
  margin: 6px 0 0;
  border: 0;
  padding: 7px 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-label);
  font-weight: 700;
  text-align: left;
}

.plan-summary-card .plan-text-button {
  margin-top: 8px;
}

.billing-page-heading {
  align-items: flex-start;
}

.billing-options {
  margin-top: 22px;
  display: grid;
  gap: 10px;
}

.billing-option {
  width: 100%;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
}

.billing-option.is-selected {
  border-color: var(--mint-strong);
  box-shadow: 0 8px 22px rgb(39 52 106 / 7%);
}

.billing-option-radio {
  width: 25px;
  height: 25px;
  border: 2px solid var(--ink-soft);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.billing-option.is-selected .billing-option-radio {
  border-color: var(--mint-strong);
  background: var(--mint);
}

.billing-option-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.billing-option-copy strong,
.billing-option-copy b,
.billing-option-copy small {
  display: block;
}

.billing-option-copy strong {
  font-size: var(--text-label);
}

.billing-option-copy b {
  font-size: var(--text-body);
}

.billing-option-copy small {
  color: var(--ink-soft);
  font-size: var(--text-meta);
  font-weight: 500;
  line-height: 1.55;
}

.billing-option em {
  align-self: start;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--mint);
  color: var(--ink);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.billing-continue {
  margin-top: 18px;
}

.billing-return-state {
  max-width: 430px;
  margin: 32px auto 0;
  display: grid;
  justify-items: center;
  text-align: center;
}

.billing-return-state h1 {
  margin: 7px 0 0;
  font-size: 1.8rem;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.billing-return-state > p:not(.overline) {
  max-width: 330px;
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: var(--text-body);
  line-height: 1.6;
}

.billing-return-state .plan-primary-button {
  margin-top: 24px;
}

.billing-success-mark,
.billing-processing-mark {
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--mint);
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 700;
}

.billing-processing-mark {
  font-size: 1.1rem;
  letter-spacing: 0.14em;
}

.billing-status-card {
  width: 100%;
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  display: grid;
  gap: 6px;
  background: var(--surface);
  text-align: left;
}

.billing-status-card strong {
  font-size: var(--text-label);
}

.billing-status-card span,
.billing-status-card small {
  color: var(--ink-soft);
  font-size: var(--text-meta);
  line-height: 1.55;
}

.promotion-section {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  background: var(--lime-soft);
}

.promotion-copy h2 {
  margin: 0 0 5px;
  font-size: 1.2rem;
  line-height: 1.4;
}

.promotion-copy > p:last-child,
.promotion-status {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.promotion-form {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.promotion-form .primary-button {
  width: auto;
  min-width: 112px;
  min-height: 50px;
  margin: 0;
}

.promotion-code-active .promotion-form {
  display: none;
}

.promotion-status {
  margin-top: 12px;
  font-size: var(--text-label);
}

.promotion-status:empty {
  display: none;
}

@media (max-width: 420px) {
  .promotion-form {
    grid-template-columns: 1fr;
  }

  .promotion-form .primary-button {
    width: 100%;
  }
}

.unified-section + .unified-section {
  margin-top: 28px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.client-list > .unified-section {
  display: grid;
  gap: 12px;
}

.invite-card {
  margin: 28px 0 8px;
  border: 1px solid rgb(39 52 106 / 9%);
  border-radius: 20px;
  padding: 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
  background: var(--surface);
}

.invite-card-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.8rem;
}

.invite-card-copy {
  min-width: 0;
}

.invite-card .overline {
  margin-bottom: 2px;
}

.invite-card h2 {
  margin: 0 0 3px;
  font-size: 1.05rem;
  line-height: 1.35;
}

.invite-card p:not(.overline),
.invite-card small {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-meta);
  line-height: 1.5;
}

.invite-actions {
  display: grid;
  gap: 2px;
  justify-items: center;
}

.invite-share-button {
  width: auto;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding-inline: 18px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-label);
  font-weight: 700;
  white-space: nowrap;
}

.invite-copy-action {
  min-height: 44px;
  border: 0;
  padding: 0 4px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-label);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.invite-card > small {
  grid-column: 1 / -1;
}

.invite-card > small:empty {
  display: none;
}

.section-title {
  margin: 36px 0 16px;
}

.section-title h2 {
  margin: 3px 0 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.section-title-mobile {
  display: none;
}

.unified-section .section-title {
  margin: 18px 0 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

h1[tabindex="-1"]:focus {
  outline: none;
}

.module-grid {
  display: grid;
  gap: 10px;
}

.module-card {
  width: 100%;
  min-height: 112px;
  border: 1px solid rgb(39 52 106 / 7%);
  border-radius: 23px;
  padding: 18px;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 16px;
  align-items: center;
  text-align: left;
}

.module-package {
  background: var(--mint);
}

.module-time {
  background: var(--coral-soft);
}

.module-habit {
  background: var(--lime-soft);
}

.module-tracking {
  background: #eef0ff;
}

.tracking-art::before {
  position: absolute;
  inset: 8px;
  border: 6px solid var(--ink);
  border-radius: 50%;
  content: "";
}

.tracking-art::after {
  position: absolute;
  top: 24px;
  left: 24px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--coral);
  content: "";
}

.module-card strong,
.module-card small {
  display: block;
}

.module-card strong {
  font-size: 1.03rem;
}

.module-card small {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 0.74rem;
}

.module-card > b {
  font-size: 1.25rem;
}

.module-art {
  position: relative;
  width: 62px;
  height: 62px;
  border: 4px solid var(--ink);
  border-radius: 17px;
  display: block;
  background: var(--surface);
}

.package-art::before,
.package-art::after {
  position: absolute;
  left: 20px;
  width: 27px;
  height: 4px;
  border-radius: 4px;
  background: var(--ink);
  content: "";
}

.package-art::before {
  top: 18px;
}

.package-art::after {
  top: 34px;
}

.package-art i {
  position: absolute;
  top: 15px;
  left: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
}

.time-art {
  border-radius: 50%;
}

.time-art::before,
.time-art::after {
  position: absolute;
  left: 27px;
  width: 4px;
  border-radius: 4px;
  background: var(--ink);
  content: "";
  transform-origin: 50% 100%;
}

.time-art::before {
  top: 11px;
  height: 22px;
}

.time-art::after {
  top: 24px;
  height: 18px;
  transform: rotate(125deg);
}

.habit-art {
  border: 0;
  background: transparent;
}

.habit-art::before {
  position: absolute;
  inset: 8px 3px;
  border: 6px solid var(--ink);
  border-top-color: transparent;
  border-right-color: transparent;
  border-radius: 0 0 0 34px;
  content: "";
  transform: rotate(-15deg);
}

.record-list,
.client-list,
.habit-list,
.tracking-list,
.open-service-list {
  display: grid;
  gap: 10px;
}

.record-item,
.client-card,
.habit-card,
.tracking-card,
.timer-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
}

.record-item {
  padding: 15px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 12px;
  align-items: center;
}

.record-icon {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--mint);
  font-size: 0.9rem;
  font-weight: 700;
}

.record-icon.service {
  background: var(--coral-soft);
}

.record-icon.habit {
  background: var(--lime-soft);
}

.record-item strong,
.record-item small {
  display: block;
}

.record-item strong {
  font-size: 0.88rem;
}

.record-item small,
.record-time {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.record-end {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.record-action {
  border: 0;
  padding: 2px 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.68rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.empty-state {
  padding: 36px 24px;
  border: 1px dashed var(--line);
  border-radius: 22px;
  background: rgb(255 255 255 / 55%);
  text-align: center;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state span {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.6;
}

.small-add-button {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: var(--coral);
  font-size: 0.78rem;
  font-weight: 700;
}

.page-heading .small-add-button {
  min-height: 44px;
  background: var(--ink);
  box-shadow: 0 10px 24px rgb(39 52 106 / 16%);
  color: var(--surface);
}

.empty-state .small-add-button {
  margin-top: 18px;
}

.search-field {
  height: 48px;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 15px;
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--surface);
}

.search-field span {
  font-size: 1.2rem;
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.client-list-toolbar {
  margin: 0 0 16px;
  display: grid;
  gap: 10px;
}

.client-list-summary {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-meta);
  display: none;
}

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

.client-filter-list {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: var(--surface);
}

.client-filter-list::-webkit-scrollbar {
  display: none;
}

.client-filter-button {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  padding: 0 8px;
  flex: 0 0 auto;
  background: var(--surface);
  color: var(--ink-soft);
  font: inherit;
  font-size: var(--text-meta);
  font-weight: 600;
  white-space: nowrap;
}

.filter-icon {
  margin-right: 8px;
  font-size: 1.05em;
  line-height: 1;
}

.client-filter-button.is-active {
  border-color: transparent;
  background: var(--mint);
  color: var(--ink);
}

.client-list-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.client-sort {
  min-height: 40px;
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink-soft);
  font-size: var(--text-meta);
}

.client-sort select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-meta);
}

.client-list {
  display: block;
}

.unified-section-items {
  display: grid;
  gap: 10px;
}

.section-heading-with-icon {
  display: flex;
  gap: 10px;
  align-items: center;
}

.section-heading-with-icon h2 {
  display: flex;
  gap: 8px;
  align-items: center;
}

.section-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--lime-soft);
  color: var(--ink);
  font-size: 1.15rem;
}

.section-icon.other {
  background: #eeeafb;
}

.section-count {
  min-width: 24px;
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  padding: 0 6px;
  background: #f0f0f6;
  color: var(--ink-soft);
  font-size: var(--text-meta);
  font-weight: 700;
}

.section-view-all {
  min-height: 44px;
  border: 0;
  padding: 0 2px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-label);
  font-weight: 700;
}

.client-card {
  padding: 18px;
}

.client-card-compact {
  padding: 18px;
}

/* Every item uses the same scan: identity/status, then one clear action and a
   chevron for management. Type-specific details stay in the text hierarchy. */
.unified-item-row {
  height: 84px;
  min-height: 84px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 144px;
  gap: 12px;
  align-items: center;
  border-radius: 18px;
  box-sizing: border-box;
}

.unified-item-row.has-feedback {
  height: auto;
}

.unified-item-row.is-actionable {
  cursor: pointer;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.unified-item-row.is-actionable:hover {
  border-color: var(--mint-strong);
  box-shadow: 0 8px 20px rgb(36 51 111 / 8%);
  transform: translateY(-1px);
}

.unified-item-row.is-actionable:focus-visible {
  outline: 3px solid var(--mint-strong);
  outline-offset: 3px;
}

.unified-item-main {
  min-width: 0;
  overflow: hidden;
}

.unified-item-kind {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: var(--text-meta);
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unified-item-main h3 {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--ink);
  font-size: var(--text-label);
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unified-item-meta {
  min-width: 0;
  margin: 3px 0 0;
  display: flex;
  gap: 6px;
  align-items: baseline;
  flex-wrap: nowrap;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: var(--text-meta);
  line-height: 1.3;
  white-space: nowrap;
}

.unified-item-value {
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
  flex: 0 0 auto;
  color: var(--ink);
}

.unified-item-value strong {
  font-size: var(--text-body);
  font-variant-numeric: tabular-nums;
}

.unified-item-value span {
  color: var(--ink-soft);
  font-size: var(--text-meta);
}

.unified-item-context {
  min-width: 0;
  overflow: hidden;
  flex: 1 1 auto;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unified-item-actions {
  width: 144px;
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: 104px 32px;
  align-items: center;
  gap: 8px;
}

.unified-item-detail {
  width: 32px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--ink);
  font: inherit;
  line-height: 1;
}

.unified-item-chevron {
  width: 9px;
  height: 9px;
  border: solid currentColor;
  border-width: 2px 2px 0 0;
  display: block;
  transform: rotate(45deg);
}

.client-main {
  min-width: 0;
}

.client-card-copy {
  min-width: 0;
  flex: 1;
}

.client-main h3,
.habit-card h3 {
  margin: 0;
  font-size: 1rem;
}

.balance-row {
  margin-top: 7px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.balance-chip {
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--mint);
  color: var(--ink-soft);
  font-size: 0.69rem;
  font-weight: 600;
}

.balance-chip.payment-paid {
  background: var(--mint);
  color: var(--ink);
}

.balance-chip.payment-pending {
  background: var(--coral-soft);
  color: var(--pending-ink);
}

.unified-item-meta .balance-chip {
  border-radius: 999px;
  padding: 1px 6px;
  font-size: var(--text-meta);
  line-height: 1.3;
}

.load-more-button {
  min-height: 44px;
  margin: 16px auto 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 18px;
  display: block;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-label);
  font-weight: 700;
}

.action-chip {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  flex: 0 0 auto;
  background: var(--surface);
  font-size: 0.72rem;
  font-weight: 600;
}

.action-chip.primary {
  border-color: transparent;
  background: var(--ink);
  color: var(--surface);
}

.unified-item-primary-action {
  width: 104px;
  min-width: 104px;
  max-width: 104px;
  height: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding-inline: 12px;
  background: var(--ink);
  color: var(--surface);
  box-shadow: none;
  font-size: var(--text-label);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.habit-add-button {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1;
}

.habit-add-button:hover,
.habit-add-button:focus-visible {
  background: var(--mint);
  color: var(--ink);
}

.habit-add-button:focus-visible {
  outline: 3px solid var(--mint-strong);
  outline-offset: 2px;
}

.habit-paused-mark {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: var(--text-meta);
  font-weight: 600;
}

.habit-add-button span {
  transform: translateY(-1px);
}

.action-chip.danger {
  margin-left: auto;
  border-color: rgb(198 75 75 / 28%);
  color: var(--danger);
}

.action-chip:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.detail-loading,
.detail-empty {
  color: var(--ink-soft);
  font-size: var(--text-meta);
  line-height: 1.55;
}

.detail-history {
  display: grid;
  gap: 8px;
}

.detail-primary-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.detail-primary-action,
.detail-timer-action {
  min-height: 50px;
}

.detail-timer-action {
  padding-right: 18px;
  padding-left: 18px;
}

.detail-history {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.client-detail-layout {
  display: grid;
  gap: 0;
}

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

.client-detail-overview > span {
  min-width: 0;
  border-radius: 17px;
  padding: 14px 15px;
  display: grid;
  gap: 3px;
  background: var(--mint-pale);
}

.client-detail-overview strong,
.client-detail-overview small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-detail-overview strong {
  color: var(--ink);
  font-size: var(--text-body);
  font-variant-numeric: tabular-nums;
}

.client-detail-overview small {
  color: var(--ink-soft);
  font-size: var(--text-meta);
}

.client-detail-primary-actions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.client-detail-primary-actions .primary-button,
.client-detail-primary-actions .secondary-button {
  min-width: 0;
  min-height: 52px;
  padding-inline: 12px;
  box-shadow: none;
  font-size: var(--text-label);
}

.client-detail-section {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: grid;
  gap: 10px;
}

.client-detail-section-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.client-detail-section-heading > strong {
  font-size: var(--text-body);
  line-height: 1.5;
}

.client-detail-section-heading > span {
  color: var(--ink-soft);
  font-size: var(--text-meta);
}

.client-detail-info-row,
.client-detail-status-row {
  min-width: 0;
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: var(--mint-pale);
}

.client-detail-info-row > span,
.client-detail-info-row small,
.client-detail-info-row strong {
  min-width: 0;
  display: block;
}

.client-detail-info-row small {
  color: var(--ink-soft);
  font-size: var(--text-meta);
}

.client-detail-info-row strong {
  margin-top: 2px;
  color: var(--ink);
  font-size: var(--text-label);
  line-height: 1.5;
}

.client-detail-status-row .balance-chip {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-detail-empty {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-meta);
  line-height: 1.6;
}

.detail-inline-action,
.detail-context-action,
.detail-more-action {
  min-height: 44px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-label);
  font-weight: 700;
}

.detail-inline-action,
.detail-context-action {
  padding-right: 2px;
  padding-left: 12px;
}

.contact-grid {
  display: grid;
  gap: 8px;
}

.contact-grid > span {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) 1fr;
  gap: 10px;
  color: var(--ink-soft);
}

.contact-grid > span > strong {
  color: var(--ink);
}

.client-note {
  margin-top: 8px;
  border-radius: 15px;
  padding: 13px 14px;
  background: var(--coral-soft);
}

.client-note p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  line-height: 1.65;
  white-space: pre-wrap;
}

.detail-history {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.detail-payment-list {
  display: grid;
  gap: 8px;
}

.history-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 4px;
}

.history-item span {
  font-size: var(--text-meta);
  line-height: 1.55;
}

.history-item time {
  color: var(--ink-soft);
  font-size: var(--text-meta);
  line-height: 1.55;
}

.detail-management {
  padding-top: 2px;
}

.detail-more {
  text-align: center;
}

.detail-more summary,
.optional-fields summary {
  min-height: 44px;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  font-weight: 600;
  list-style: none;
}

.detail-more summary::-webkit-details-marker,
.optional-fields summary::-webkit-details-marker,
.card-menu summary::-webkit-details-marker {
  display: none;
}

.detail-more-actions {
  display: grid;
  justify-items: center;
}

.detail-more-action {
  color: var(--ink-soft);
  font-weight: 600;
}

.danger-link {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--danger);
  font: inherit;
  font-size: var(--text-meta);
  font-weight: 700;
}

.timer-card {
  margin: 22px 0 8px;
  padding: 18px;
  border-color: rgb(255 123 118 / 35%);
  background: var(--coral-soft);
}

.timer-row {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.timer-card strong,
.timer-card small {
  display: block;
}

.timer-card small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.timer-value {
  font-variant-numeric: tabular-nums;
  font-size: 1.1rem;
  font-weight: 700;
}

.timer-card .action-chip {
  margin-top: 14px;
  border-color: transparent;
  background: var(--ink);
  color: var(--surface);
}

.habit-card {
  position: relative;
  padding: 18px;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.habit-card.is-actionable {
  cursor: pointer;
}

.habit-card.is-actionable:hover {
  border-color: var(--mint-strong);
  box-shadow: 0 8px 20px rgb(36 51 111 / 8%);
  transform: translateY(-1px);
}

.habit-card.is-actionable:focus-visible {
  outline: 3px solid var(--mint-strong);
  outline-offset: 3px;
}

.habit-manage-form {
  display: grid;
  gap: 18px;
}

.habit-management-actions {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.habit-target-group,
.habit-period-group {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.habit-edit-note {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-meta);
  line-height: 1.55;
}

.field-readonly {
  width: 100%;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  background: #f7fbf9;
  color: var(--ink);
  font-size: var(--text-body);
  font-weight: 600;
}

.habit-manage-form .habit-setup-preview {
  border: 0;
  padding: 14px 16px;
  gap: 3px;
  background: var(--lime-soft);
}

.habit-manage-form .habit-setup-preview strong {
  color: var(--ink);
  font-size: var(--text-body);
  line-height: 1.5;
}

.client-detail-management {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.habit-secondary-actions summary,
.client-secondary-actions summary {
  min-height: 58px;
  cursor: pointer;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  list-style: none;
}

.habit-secondary-actions summary::-webkit-details-marker,
.client-secondary-actions summary::-webkit-details-marker {
  display: none;
}

.habit-secondary-actions summary span,
.habit-secondary-actions summary strong,
.habit-secondary-actions summary small,
.client-secondary-actions summary span,
.client-secondary-actions summary strong,
.client-secondary-actions summary small {
  display: block;
}

.habit-secondary-actions summary strong,
.client-secondary-actions summary strong {
  font-size: var(--text-label);
  line-height: 1.45;
}

.habit-secondary-actions summary small,
.client-secondary-actions summary small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: var(--text-meta);
  font-weight: 500;
  line-height: 1.5;
}

.habit-secondary-actions summary b,
.client-secondary-actions summary b {
  width: 28px;
  height: 28px;
  position: relative;
  flex: 0 0 28px;
}

.habit-secondary-actions summary b::before,
.habit-secondary-actions summary b::after,
.client-secondary-actions summary b::before,
.client-secondary-actions summary b::after {
  width: 12px;
  height: 2px;
  position: absolute;
  top: 13px;
  left: 8px;
  border-radius: 999px;
  background: var(--ink-soft);
  content: "";
  transition: transform 180ms ease;
}

.habit-secondary-actions summary b::after,
.client-secondary-actions summary b::after {
  transform: rotate(90deg);
}

.habit-secondary-actions[open] summary b::after,
.client-secondary-actions[open] summary b::after {
  transform: rotate(0);
}

.habit-secondary-action-list,
.client-secondary-action-list {
  padding: 4px 0 6px;
  display: grid;
}

.habit-secondary-action-list button,
.client-secondary-action-list button {
  min-height: 48px;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 0 2px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: var(--text-label);
  font-weight: 600;
  text-align: left;
}

.habit-secondary-action-list button.is-danger,
.client-secondary-action-list button.is-danger {
  color: var(--danger);
}

.page-intro {
  margin: -4px 0 22px;
  color: var(--ink-soft);
  font-size: var(--text-meta);
}

.goals-page {
  padding-bottom: 18px;
}

.goals-hero {
  margin: 16px 0 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.goals-hero h1 {
  margin: 8px 0 6px;
  color: var(--ink);
  font-size: clamp(1.8rem, 4.8vw, 2.35rem);
  line-height: 1.25;
  letter-spacing: -0.045em;
}

.goals-hero > p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-body);
  line-height: 1.55;
}

.goals-page .habit-list {
  margin-top: 0;
  gap: 14px;
}

.habit-card-approved {
  padding: 14px 20px;
  border-radius: 25px;
}

.habit-card-approved-top {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.habit-card-approved-copy {
  min-width: 0;
}

.habit-card-approved-copy h3 {
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.habit-card-approved-value {
  color: var(--ink);
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  white-space: nowrap;
}

.habit-card-approved .habit-add-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  align-self: center;
  justify-self: end;
  background: var(--mint);
  color: var(--ink);
  font-size: 2rem;
}

.habit-card-approved .habit-add-button:hover,
.habit-card-approved .habit-add-button:focus-visible {
  background: var(--mint-strong);
  color: var(--ink);
}

.habit-card-approved :where(.progress-track) {
  min-width: 0;
  height: 9px;
  margin: 0;
}

.habit-card-approved :where(.habit-progress-context) {
  margin-top: 9px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 44px;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: var(--text-meta);
}

.habit-card-approved :where(.habit-progress-context) span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.habit-card-approved :where(.habit-progress-context) strong {
  color: var(--ink-soft);
  font-size: inherit;
  font-weight: 400;
}

.habit-card-approved .habit-progress-context .habit-add-button {
  grid-column: 4;
  grid-row: 1;
}

.habit-card-approved .habit-progress-context .habit-paused-mark {
  grid-column: 4;
  grid-row: 1;
  justify-self: end;
}

.habit-reorder-handle {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  justify-self: end;
  padding: 0;
  background: var(--mint-pale);
  color: var(--ink);
  cursor: grab;
  font: inherit;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  touch-action: none;
}

.habit-reorder-handle:active {
  cursor: grabbing;
}

.habit-reorder-handle:focus-visible {
  outline: 3px solid var(--mint-strong);
  outline-offset: 2px;
}

.habit-card.is-reordering {
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    opacity 150ms ease;
}

.habit-card.is-reordering.is-dragging {
  opacity: 0.52;
}

.habit-card.is-reordering.is-drop-target {
  border-color: var(--mint-strong);
  box-shadow: inset 0 4px 0 var(--mint-strong);
}

.habit-card.is-reordering.is-drop-target.is-drop-after {
  box-shadow: inset 0 -4px 0 var(--mint-strong);
}

.is-habit-reordering,
.is-habit-reordering body {
  user-select: none;
  -webkit-user-select: none;
}

.billing-page-heading .page-intro {
  margin-bottom: 0;
}

.tracking-card {
  position: relative;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.tracking-card-main {
  min-width: 0;
}

.tracking-card.is-highlighted {
  border-color: var(--mint-strong);
  box-shadow: 0 0 0 4px rgb(139 212 188 / 18%);
}

.tracking-topline {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
}

.tracking-topline h3 {
  margin: 3px 0 0;
  font-size: 1rem;
}

.tracking-topline small,
.tracking-latest {
  color: var(--ink-soft);
  font-size: var(--text-meta);
  line-height: 1.55;
}

.tracking-topline > strong {
  white-space: nowrap;
  font-size: 1.08rem;
}

.tracking-topline > strong small {
  font-weight: 600;
}

.tracking-latest {
  margin: 13px 0 0;
}

.tracking-project-plan {
  margin-top: 14px;
  display: grid;
  gap: 7px;
}

.tracking-project-plan-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: var(--text-meta);
}

.tracking-project-plan small,
.tracking-project-plan-label {
  color: var(--ink-soft);
  font-size: var(--text-meta);
  line-height: 1.55;
}

.tracking-project-plan-label {
  margin: 13px 0 0;
}

.tracking-manage-form {
  display: grid;
  gap: 13px;
}

.tracking-manage-status {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.tracking-manage-primary-actions.is-single {
  grid-template-columns: 1fr;
}

.tracking-statuses {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.provider-service-history {
  display: grid;
  gap: 10px;
}

.provider-service-history-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.provider-service-history-item > div:first-child {
  display: grid;
  gap: 4px;
}

.provider-service-history-item strong {
  color: var(--ink);
  font-size: var(--text-body);
}

.provider-service-history-item small {
  color: var(--ink-soft);
  font-size: var(--text-meta);
  line-height: 1.55;
}

.provider-service-history-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tracking-feedback {
  margin-top: 12px;
  border-radius: 14px;
  padding: 9px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  background: var(--mint);
  color: var(--ink-soft);
  font-size: var(--text-meta);
  line-height: 1.45;
}

.tracking-feedback button {
  min-height: 44px;
  border: 0;
  padding: 0 4px;
  flex: 0 0 auto;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Tracking items reuse the same row grammar as client items. */
.tracking-row.unified-item-row {
  grid-template-columns: minmax(0, 1fr) 144px;
  gap: 12px;
  height: 84px;
  min-height: 84px;
  padding: 8px 12px;
}

.tracking-row.unified-item-row.has-feedback {
  height: auto;
}

.tracking-row .tracking-latest {
  margin: 3px 0 0;
}

.tracking-row .tracking-feedback {
  grid-column: 1 / -1;
}

.habit-list {
  margin-top: 24px;
}

.habit-topline {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.habit-topline small {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.habit-value {
  text-align: right;
  font-size: 0.84rem;
  font-weight: 700;
}

.progress-track {
  display: block;
  width: 100%;
  height: 9px;
  margin-top: 16px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
  background: #e5e7eb;
  color: var(--lime);
}

.tracking-project-plan .progress-track {
  margin-top: 0;
}

.progress-track::-webkit-progress-bar {
  border-radius: 999px;
  background: #e5e7eb;
}

.progress-track::-webkit-progress-value {
  border-radius: 999px;
  background: var(--lime);
}

.progress-track::-moz-progress-bar {
  border-radius: 999px;
  background: var(--lime);
}

.habit-card.is-paused {
  opacity: 0.68;
}

.card-menu {
  position: absolute;
  z-index: 4;
  top: 9px;
  right: 9px;
}

.card-menu summary {
  width: 44px;
  height: 44px;
  cursor: pointer;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  list-style: none;
}

.card-menu[open] summary {
  background: #f4f5f2;
}

.card-menu-popover {
  position: absolute;
  top: 42px;
  right: 0;
  width: max-content;
  min-width: 210px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 6px;
  display: grid;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card-menu-popover button {
  min-height: 44px;
  border: 0;
  border-radius: 11px;
  padding: 0 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
}

.card-menu-popover button.danger {
  border-top: 1px solid var(--line);
  border-radius: 0 0 11px 11px;
  color: var(--danger);
}

.form-section {
  display: grid;
  gap: 13px;
}

.form-section + .form-section {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.form-section > strong {
  font-size: 1rem;
}

.form-section > strong small {
  margin-left: 5px;
  color: var(--ink-soft);
  font-weight: 500;
}

.optional-fields {
  border-radius: 15px;
  background: #f7f8f6;
}

.optional-fields[open] {
  padding: 0 12px 12px;
}

.back-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 600;
}

.profile-identity {
  margin-top: 24px;
  border: 1px solid rgb(39 52 106 / 7%);
  border-radius: 24px;
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--mint);
}

.profile-picture {
  width: 68px;
  height: 68px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  background: var(--mint-strong);
  box-shadow: 0 8px 22px rgb(39 52 106 / 12%);
  font-size: 1.3rem;
  font-weight: 700;
}

.profile-identity strong,
.profile-identity span,
.profile-identity small {
  display: block;
}

.profile-identity strong {
  font-size: 1.05rem;
}

.profile-identity span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.profile-identity small {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.profile-form {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  display: grid;
  gap: 15px;
  background: var(--surface);
}

.profile-form-title {
  margin: 0 0 4px;
}

.profile-optional {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #f7f8f6;
}

.profile-optional summary {
  min-height: 58px;
  padding: 11px 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
}

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

.profile-optional summary strong,
.profile-optional summary small {
  display: block;
}

.profile-optional summary strong {
  font-size: var(--text-label);
}

.profile-optional summary small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: var(--text-meta);
  font-weight: 400;
}

.profile-optional summary b {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 180ms ease;
}

.profile-optional[open] summary b {
  transform: rotate(45deg);
}

.profile-optional-fields {
  border-top: 1px solid var(--line);
  padding: 14px;
  display: grid;
  gap: 15px;
  background: var(--surface);
}

.profile-form #profile-submit:disabled {
  box-shadow: none;
}

.profile-status {
  min-height: 1.4em;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.74rem;
  line-height: 1.5;
}

.resource-section {
  margin-bottom: 20px;
}

.resource-links {
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface);
}

.account-danger-zone {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.account-danger-zone > .overline {
  margin-bottom: 9px;
}

.account-danger-button {
  width: 100%;
  min-height: 62px;
  border: 1px solid rgb(198 75 75 / 22%);
  border-radius: 18px;
  padding: 13px 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  background: rgb(198 75 75 / 4%);
  color: var(--danger);
  font: inherit;
  text-align: left;
}

.account-danger-button strong,
.account-danger-button small {
  display: block;
}

.account-danger-button strong {
  font-size: var(--text-label);
}

.account-danger-button small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: var(--text-meta);
  line-height: 1.45;
}

.account-danger-button b {
  flex: 0 0 auto;
  font-size: 1rem;
}

.resource-link {
  width: 100%;
  min-height: 62px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
}

.resource-link:last-child {
  border-bottom: 0;
}

.resource-link strong,
.resource-link small {
  display: block;
}

.resource-link strong {
  font-size: 0.84rem;
}

.resource-link small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.resource-link b {
  color: var(--coral);
  font-size: 1rem;
}

.resource-link-danger strong,
.resource-link-danger b {
  color: var(--danger);
}

.bottom-nav {
  position: fixed;
  z-index: 21;
  right: 0;
  bottom: 0;
  left: 0;
  width: min(calc(100% - 32px), 808px);
  height: calc(74px + env(safe-area-inset-bottom));
  margin: 0 auto 12px;
  padding: 8px 14px env(safe-area-inset-bottom);
  border: 1px solid var(--line);
  border-radius: 42px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(18px);
}

.bottom-nav.has-tracking {
  grid-template-columns: repeat(5, 1fr);
}

.nav-item {
  border: 0;
  display: flex;
  gap: 2px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  background: transparent;
  color: var(--ink-soft);
}

.nav-item span {
  font-size: 1.2rem;
  line-height: 1;
}

.nav-item small {
  font-size: 0.65rem;
  font-weight: 600;
}

.nav-item.is-active {
  color: var(--ink);
}

.nav-item.is-active span {
  width: 38px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--mint);
}

.command-dialog {
  width: min(calc(100vw - 24px), 720px);
  max-width: calc(100vw - 24px);
  max-height: min(88dvh, 760px);
  margin: auto auto 0;
  border: 0;
  border-radius: 26px 26px 0 0;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
}

.command-dialog::backdrop {
  background: rgb(31 40 84 / 44%);
  backdrop-filter: blur(3px);
}

.command-dialog form {
  width: 100%;
  max-width: 100%;
  max-height: min(88dvh, 760px);
  padding: 10px 22px calc(44px + env(safe-area-inset-bottom));
  overflow-x: clip;
  overflow-y: auto;
  overscroll-behavior-x: none;
}

.confirm-dialog form {
  padding-bottom: calc(22px + env(safe-area-inset-bottom));
}

.confirm-description {
  margin: 24px 0 0;
  color: var(--ink-soft);
  font-size: var(--text-meta);
  line-height: 1.75;
}

.confirm-description strong {
  color: var(--ink);
}

.confirm-actions {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.danger-button {
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  padding: 0 18px;
  background: var(--danger);
  color: var(--surface);
  font-weight: 700;
}

.danger-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.dialog-handle {
  width: 42px;
  height: 5px;
  margin: 0 auto 22px;
  border-radius: 999px;
  background: var(--line);
}

.dialog-heading {
  position: sticky;
  z-index: 3;
  top: -10px;
  margin-right: -22px;
  margin-left: -22px;
  padding: 12px 22px 14px;
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
  background: rgb(255 255 255 / 98%);
}

.dialog-heading h2 {
  margin: 4px 0 0;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.dialog-close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  outline: 0;
  background: var(--surface);
  font-size: 1.25rem;
}

.dialog-close:focus-visible {
  border-color: var(--mint-strong);
  box-shadow: 0 0 0 3px rgb(139 212 188 / 24%);
}

.dialog-fields {
  margin: 24px 0 12px;
  display: grid;
  gap: 15px;
  min-width: 0;
}

.dialog-footer {
  min-width: 0;
}

.command-dialog form[data-mode="habit-manage"] {
  padding-bottom: 0;
  scroll-padding-bottom: 150px;
}

:where(#command-form[data-mode="habit-manage"]) .dialog-fields {
  margin-bottom: 0;
}

:where(#command-form[data-mode="habit-manage"]) .dialog-footer {
  position: sticky;
  z-index: 4;
  bottom: 0;
  margin: 22px -22px 0;
  border-top: 1px solid var(--line);
  padding: 11px 22px calc(14px + env(safe-area-inset-bottom));
  background: rgb(255 255 255 / 98%);
  box-shadow: 0 -10px 24px rgb(39 52 106 / 5%);
}

:where(#command-form[data-mode="habit-manage"]) .primary-button {
  min-height: 54px;
  box-shadow: none;
}

.command-dialog form[data-mode="tracking-manage"] {
  padding-bottom: 0;
  scroll-padding-bottom: 150px;
}

:where(#command-form[data-mode="tracking-manage"]) .dialog-fields {
  margin-bottom: 0;
}

:where(#command-form[data-mode="tracking-manage"]) .dialog-footer {
  position: sticky;
  z-index: 4;
  bottom: 0;
  margin: 22px -22px 0;
  border-top: 1px solid var(--line);
  padding: 11px 22px calc(14px + env(safe-area-inset-bottom));
  background: rgb(255 255 255 / 98%);
  box-shadow: 0 -10px 24px rgb(39 52 106 / 5%);
}

:where(#command-form[data-mode="tracking-manage"]) .primary-button {
  min-height: 54px;
  box-shadow: none;
}

:where(#command-form[data-mode="client-detail"]) .dialog-fields {
  margin-bottom: 0;
}

:where(#command-form[data-mode="client-detail"]) .dialog-footer {
  display: none;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field > span {
  font-size: var(--text-label);
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 0 14px;
  outline: 0;
  background: var(--surface);
}

.field input,
.field select {
  height: 50px;
}

.field textarea {
  min-height: 96px;
  padding-top: 13px;
  padding-bottom: 13px;
  resize: vertical;
  line-height: 1.6;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--mint-strong);
  box-shadow: 0 0 0 3px rgb(139 212 188 / 18%);
}

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

.habit-unit-picker {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.field-hint {
  color: var(--ink-soft);
  font-size: var(--text-meta);
  font-weight: 500;
  line-height: 1.5;
}

.habit-setup-preview[hidden] {
  display: none;
}

.reference-field {
  min-width: 0;
  min-height: 50px;
  border-radius: 15px;
  padding: 10px 14px;
  display: grid;
  gap: 1px;
  align-content: center;
  background: #f7fbf9;
}

.reference-field span,
.quantity-preview span {
  color: var(--ink-soft);
  font-size: var(--text-meta);
  font-weight: 600;
}

.reference-field strong {
  font-size: var(--text-body);
  line-height: 1.4;
}

.habit-log-summary {
  border-radius: 17px;
  padding: 14px 16px;
  display: grid;
  gap: 2px;
  background: var(--mint);
}

.habit-log-summary span,
.habit-progress-preview span {
  color: var(--ink-soft);
  font-size: var(--text-meta);
  font-weight: 600;
}

.habit-log-summary strong {
  font-size: 1.15rem;
  line-height: 1.45;
}

.habit-quantity-control {
  position: relative;
}

.habit-quantity-control input {
  padding-right: 76px;
  font-variant-numeric: tabular-nums;
}

.habit-quantity-unit {
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--ink-soft);
  font-weight: 600;
  pointer-events: none;
  transform: translateY(-50%);
}

.habit-progress-preview {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 12px 14px;
  display: grid;
  gap: 2px;
  background: #f7fbf9;
  line-height: 1.55;
}

.habit-progress-preview strong,
.quantity-preview strong {
  font-size: var(--text-label);
}

.quantity-preview {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 12px 14px;
  display: grid;
  gap: 2px;
  background: #f7fbf9;
  line-height: 1.55;
}

.check-field {
  min-height: 52px;
  border-radius: 15px;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--mint);
  font-size: 0.78rem;
  font-weight: 600;
}

.check-field input {
  width: 20px;
  height: 20px;
}

.package-summary {
  border-radius: 15px;
  padding: 12px 14px;
  background: var(--mint);
  color: var(--ink-soft);
  font-size: var(--text-meta);
  font-weight: 600;
  line-height: 1.55;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.template-choice-layout,
.template-choice-section {
  display: grid;
}

.template-choice-layout {
  gap: 22px;
}

.template-choice-section {
  gap: 10px;
}

.template-choice-more {
  border-top: 1px solid var(--line);
  padding-top: 2px;
}

.template-choice-more summary {
  min-height: 44px;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  cursor: pointer;
  font-size: var(--text-label);
  font-weight: 700;
  list-style: none;
}

.template-choice-more summary::-webkit-details-marker {
  display: none;
}

.template-choice-more summary::after {
  color: var(--ink-soft);
  content: "＋";
  font-size: 1.1rem;
  font-weight: 500;
}

.template-choice-more[open] summary::after {
  content: "−";
}

.template-choice-more summary span {
  margin-left: auto;
  margin-right: 10px;
  color: var(--ink-soft);
  font-size: var(--text-meta);
  font-weight: 500;
}

.template-choice-more .choice-grid {
  margin-top: 10px;
}

.template-choice-heading {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-meta);
  font-weight: 700;
}

.choice-button {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  background: var(--surface);
  font-size: var(--text-label);
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
}

.choice-button small {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: var(--text-meta);
  font-weight: 500;
  line-height: 1.55;
  text-align: left;
}

.template-chat-choice {
  width: 100%;
  min-height: 68px;
  padding-right: 16px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  background: #f7f8f6;
}

.template-chat-choice strong,
.template-chat-choice small {
  display: block;
}

.template-chat-choice b {
  margin-left: 14px;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.dialog-note {
  min-height: 20px;
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: var(--text-meta);
  line-height: 1.6;
}

.dialog-note.is-error,
#confirmation-description.is-error {
  color: var(--danger);
  font-weight: 600;
}

.command-status {
  position: fixed;
  z-index: 35;
  right: 16px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  left: 16px;
  width: min(calc(100% - 32px), 648px);
  margin: 0 auto;
  border: 1px solid rgb(39 52 106 / 12%);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 0.75rem;
  line-height: 1.5;
}

.command-status button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  flex: 0 0 auto;
  background: var(--coral-soft);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.action-progress {
  position: fixed;
  z-index: 34;
  right: 16px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  left: 16px;
  width: min(calc(100% - 32px), 648px);
  margin: 0 auto;
  border: 1px solid rgb(39 52 106 / 12%);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: var(--text-meta);
  line-height: 1.5;
}

.action-progress-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--coral);
  border-radius: 50%;
  flex: 0 0 auto;
  animation: spin 800ms linear infinite;
}

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

@keyframes loading-sheen {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.toast {
  position: fixed;
  z-index: 50;
  right: 20px;
  bottom: calc(96px + env(safe-area-inset-bottom));
  left: 20px;
  width: min(calc(100% - 40px), 520px);
  margin: 0 auto;
  border-radius: 17px;
  padding: 15px 18px;
  background: var(--ink);
  box-shadow: var(--shadow);
  color: #fff;
  font-size: var(--text-meta);
  line-height: 1.55;
  white-space: pre-line;
}

.share-view {
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
}

.share-header {
  margin-bottom: 28px;
}

.share-card {
  min-height: 310px;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 28px;
  background: var(--mint);
}

.share-card h1 {
  margin: 9px 0 24px;
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.share-card #share-text {
  margin: 0;
  color: var(--ink);
  line-height: 1.8;
  white-space: pre-line;
}

.share-status {
  min-height: 22px;
  margin: 20px 4px 12px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  text-align: center;
}

.share-view .secondary-button {
  margin-top: 9px;
}

/* Readability contract: supporting copy stays at 14px+, controls at 15px+. */
.quiet-link,
.overline,
.summary-card span,
.summary-card small,
.record-item small,
.record-time,
.empty-state span,
.balance-chip,
.detail-loading,
.detail-empty,
.contact-grid,
.client-note,
.history-item span,
.history-item time,
.danger-link,
.timer-card small,
.habit-topline small,
.habit-value,
.habit-progress-context,
.profile-identity span,
.profile-identity small,
.profile-status,
.resource-link strong,
.resource-link small,
.confirm-description,
.dialog-note,
.choice-button small,
.command-status,
.toast,
.share-status {
  font-size: var(--text-meta);
}

.record-item strong,
.record-action,
.small-add-button,
.action-chip,
.back-button,
.nav-item small,
.field > span,
.check-field,
.choice-button {
  font-size: var(--text-label);
}

:where(#command-form[data-mode="habit-manage"]) .dialog-note {
  min-height: 0;
  margin: 0 0 8px;
  text-align: center;
}

.record-action,
.small-add-button,
.action-chip,
.back-button,
.danger-link,
.command-status button {
  min-height: 44px;
}

.field input,
.field select,
.field textarea,
.search-field input {
  font-size: var(--text-body);
}

.field input::placeholder,
.field textarea::placeholder,
.search-field input::placeholder {
  color: #777e99;
  opacity: 1;
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.55;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

@media (min-width: 680px) {
  .module-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .module-card {
    min-height: 210px;
    grid-template-columns: 1fr auto;
    align-content: space-between;
  }

  .module-card .module-art {
    grid-column: 1 / -1;
  }

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

  .client-list {
    grid-template-columns: 1fr;
  }

  .unified-section-items.clients-items.is-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .unified-section-items.clients-items.is-list {
    grid-template-columns: 1fr;
  }

  .client-list-tools {
    grid-template-columns: 1fr;
  }

  .chat-example-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 679px) {
  .app-header {
    height: calc(52px + env(safe-area-inset-top));
    padding-inline: 20px;
  }

  .app-header-actions,
  .goals-header-actions {
    gap: 7px;
  }

  .goals-header-more {
    width: 36px;
    height: 36px;
    font-size: 1.45rem;
  }

  .goals-header-menu summary {
    width: 36px;
    height: 36px;
    font-size: 1.45rem;
  }

  .goals-reorder-done {
    min-height: 38px;
    padding-inline: 11px;
  }

  .goals-header-add {
    min-height: 38px;
    padding-inline: 14px;
    font-size: var(--text-meta);
  }

  .app-content {
    padding-top: 16px;
    padding-inline: 20px;
  }

  .brand-wordmark {
    font-size: 1.9rem;
  }

  .icon-button {
    width: 34px;
    height: 34px;
  }

  .icon-button span {
    font-size: 1.25rem;
  }

  .page-heading {
    margin-bottom: 14px;
    gap: 12px;
  }

  .page-heading h1 {
    font-size: clamp(1.75rem, 8vw, 2rem);
  }

  .page-heading .small-add-button {
    min-height: 36px;
    padding-inline: 15px;
    font-size: var(--text-label);
  }

  .goals-hero {
    margin: 4px 0 18px;
    padding-bottom: 16px;
  }

  .goals-hero h1 {
    margin: 6px 0 4px;
    font-size: clamp(1.7rem, 7.5vw, 2rem);
    line-height: 1.3;
  }

  .goals-hero > p:last-child {
    font-size: var(--text-meta);
    line-height: 1.55;
  }

  .habit-card-approved {
    padding: 14px 16px;
    border-radius: 22px;
  }

  .habit-card-approved-top {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .habit-card-approved-copy h3 {
    font-size: 1.08rem;
  }

  .habit-card-approved-value {
    font-size: 0.9rem;
  }

  .habit-card-approved .habit-add-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    font-size: 1.75rem;
  }

  .habit-card-approved .habit-progress-context {
    margin-top: 8px;
    grid-template-columns: auto minmax(44px, 1fr) auto 44px;
    gap: 7px;
    font-size: var(--text-meta);
  }

  .search-field {
    height: 36px;
    margin-bottom: 10px;
    border-radius: 18px;
    padding-inline: 12px;
  }

  .search-field span {
    font-size: 1.05rem;
  }

  .client-list-toolbar {
    margin-bottom: 14px;
    gap: 9px;
  }

  .client-filter-list {
    min-height: 32px;
    padding: 2px;
  }

  .client-filter-button {
    min-height: 27px;
    padding-inline: 5px;
    font-size: var(--text-meta);
  }

  .filter-icon {
    margin-right: 4px;
    font-size: 0.95em;
  }

  .client-list-controls {
    gap: 8px;
  }

  .client-sort,
  .client-sort select {
    min-height: 32px;
  }

  .client-sort {
    gap: 6px;
    font-size: var(--text-meta);
  }

  .client-sort select {
    border-radius: 999px;
    padding-inline: 10px;
    font-size: var(--text-meta);
  }

  .unified-section + .unified-section {
    margin-top: 18px;
    padding-top: 2px;
  }

  .unified-section .section-title {
    margin: 10px 0 8px;
  }

  .unified-section .section-title .overline {
    display: none;
  }

  .section-title-desktop {
    display: none;
  }

  .section-title-mobile {
    display: inline;
  }

  .section-title h2 {
    font-size: 1.3rem;
  }

  .section-heading-with-icon {
    gap: 8px;
  }

  .section-icon {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }

  .section-count {
    min-width: 22px;
    min-height: 22px;
    font-size: var(--text-meta);
  }

  .section-view-all {
    min-height: 32px;
    font-size: var(--text-meta);
  }

  .client-list-row,
  .tracking-row.unified-item-row {
    height: 84px;
    min-height: 84px;
    padding: 8px 12px;
    border-radius: 18px;
    gap: 12px;
  }

  .client-list-row .client-main {
    line-height: 1.2;
  }

  .unified-item-kind {
    font-size: var(--text-meta);
    line-height: 1.2;
  }

  .unified-item-main h3 {
    font-size: var(--text-label);
    line-height: 1.25;
  }

  .unified-item-meta {
    margin-top: 3px;
    gap: 6px;
    font-size: var(--text-meta);
    line-height: 1.25;
  }

  .unified-item-value strong {
    font-size: var(--text-label);
  }

  .unified-item-value span,
  .unified-item-context {
    font-size: var(--text-meta);
  }

  .client-list-row .client-main h3 {
    font-size: var(--text-label);
    line-height: 1.2;
  }

  .client-list-row .client-main small {
    font-size: var(--text-meta);
    line-height: 1.2;
  }

  .client-list-row .balance-row {
    margin-top: 3px;
  }

  .tracking-row .tracking-topline h3 {
    font-size: var(--text-label);
    line-height: 1.2;
  }

  .tracking-row .tracking-topline small,
  .tracking-row .tracking-latest {
    font-size: var(--text-meta);
    line-height: 1.2;
  }

  .tracking-row .tracking-latest {
    margin-top: 2px;
  }

  .invite-card {
    margin: 14px 0 8px;
    border-radius: 20px;
    padding: 14px;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 8px 10px;
    background: #eef8f5;
  }

  .invite-card-icon {
    width: 38px;
    height: 38px;
    font-size: 1.65rem;
  }

  .invite-card h2 {
    font-size: 1rem;
  }

  .invite-card p:not(.overline) {
    font-size: var(--text-meta);
  }

  .invite-share-button {
    min-height: 36px;
    padding-inline: 14px;
    border-radius: 12px;
    font-size: var(--text-meta);
  }

  .bottom-nav {
    width: calc(100% - 32px);
    height: calc(60px + env(safe-area-inset-bottom));
    margin-bottom: 8px;
    padding: 11px 8px max(0px, calc(env(safe-area-inset-bottom) - 6px));
    border-radius: 30px;
  }

  .nav-item small {
    font-size: 0.66rem;
  }

  .nav-item.is-active span {
    width: 76px;
    height: 32px;
  }

  .tracking-row .tracking-feedback {
    grid-column: 1 / -1;
  }
}

@media (max-width: 380px) {
  .field-row,
  .choice-grid {
    grid-template-columns: 1fr;
  }

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

  .overview-focus-action,
  .overview-focus-link {
    justify-self: start;
  }
}

@media (max-width: 480px) {
  .overview-focus-row.is-start {
    grid-template-columns: 1fr;
  }

  .overview-focus-row.is-start .overview-focus-action {
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body * {
    animation: none;
    scroll-behavior: auto;
  }
}

.summary-log {
  margin: 34px 0 28px;
}

.summary-log .section-title {
  margin-bottom: 12px;
}

.summary-log .record-list {
  gap: 0;
  border-top: 1px solid var(--line);
}

.summary-log .record-item {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 12px 0;
}
