:root {
  color-scheme: light;
  --brand-sky: #b4e1f8;
  --brand-sand: #c9bc9c;
  --brand-white: #ffffff;
  --brand-ink: #11110f;
  --ui-cream: #f6f4ee;
  --ui-cream-deep: #eee9dc;
  --ui-ink: #3a3b36;
  --ui-action: #748171;
  --ui-action-dark: #626d60;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --ink: var(--ui-ink);
  --muted: #747870;
  --line: rgba(58, 59, 54, 0.14);
  --green: var(--ui-action);
  --green-dark: var(--ui-action-dark);
  --coral: #a45a4d;
  --yellow: var(--brand-sand);
  --blue: var(--brand-sky);
  --shadow: 0 8px 18px rgba(58, 59, 54, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  background: var(--bg);
  color: var(--ink);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button {
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--brand-sky);
  opacity: 1;
  visibility: visible;
  transition:
    opacity 320ms ease,
    visibility 320ms ease;
}

.splash-screen.is-hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.splash-mark {
  display: grid;
  place-items: center;
  transform-origin: center;
  animation: splash-mark-in 980ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.splash-mark img {
  display: block;
  width: clamp(132px, 34vw, 176px);
  height: auto;
}

.splash-lines {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-rows: 42px 22px;
  transform: translateY(100%);
  animation: splash-lines-in 900ms cubic-bezier(0.2, 0.8, 0.2, 1) 140ms both;
}

.splash-line {
  display: block;
}

.splash-line.sand {
  background: var(--brand-sand);
}

.splash-line.white {
  background: var(--brand-white);
}

@keyframes splash-mark-in {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.92);
  }

  58% {
    opacity: 1;
    transform: translateY(0) scale(1.035);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes splash-lines-in {
  0% {
    transform: translateY(100%);
  }

  100% {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash-mark,
  .splash-lines {
    animation: none;
  }

  .splash-screen {
    transition-duration: 80ms;
  }
}

.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  min-width: 0;
  padding: 18px 16px 96px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100vw;
  margin: -18px calc(50% - 50vw) 18px;
  padding: 18px max(16px, calc((100vw - 1120px) / 2 + 16px)) 14px;
  border-bottom: 1px solid rgba(58, 59, 54, 0.12);
  background: var(--ui-cream);
}

.brand-heading {
  display: grid;
  gap: 3px;
  align-items: start;
  width: min(300px, 58vw);
  min-width: 0;
}

.brand-picture {
  display: block;
  width: 100%;
}

.brand-logo {
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.app-name-title {
  width: 82%;
  margin: 0 auto;
  color: var(--ink);
  font-size: clamp(1rem, 3vw, 1.28rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0;
  text-align: center;
  overflow-wrap: anywhere;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 7vw, 3.2rem);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.3rem, 5vw, 2.1rem);
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.account {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 138px;
}

.sync-state {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(58, 59, 54, 0.12);
  border-radius: 999px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0 -4px 16px;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(58, 59, 54, 0.08);
  background: #fff;
}

.tab {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.auth-gate {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  border: 1px solid rgba(201, 188, 156, 0.7);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.auth-gate.show {
  display: flex;
}

.auth-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
  width: min(420px, 100%);
}

.auth-gate h2 {
  font-size: clamp(1.15rem, 4vw, 1.55rem);
}

#authGateText {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.loading-progress {
  width: min(320px, 100%);
  margin-top: 14px;
}

.loading-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.loading-progress-head strong {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.loading-progress-track {
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(58, 59, 54, 0.12);
  border-radius: 999px;
  background: #f4f2ec;
}

.loading-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 180ms ease;
}

.consent-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: right;
}

.consent-note a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.store-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  align-items: end;
  width: 100%;
}

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.5;
}

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

.date-note {
  margin: 0;
  text-align: right;
}

.date-input,
.year-input {
  display: block;
  flex: 0 0 auto;
  width: 176px;
  height: 46px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 800;
  line-height: 46px;
  vertical-align: middle;
}

.date-input {
  appearance: auto;
  -webkit-appearance: auto;
  color-scheme: light;
  line-height: normal;
}

.year-input {
  width: 106px;
}

.date-input::-webkit-date-and-time-value {
  min-height: 0;
  text-align: left;
}

.date-input::-webkit-calendar-picker-indicator {
  margin: 0 0 0 auto;
  padding: 4px;
  cursor: pointer;
}

.date-shift-button {
  min-height: 38px;
  border: 1px solid rgba(58, 59, 54, 0.14);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--brand-sand);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.entry-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.field-note {
  margin-top: -1px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.45;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  outline: none;
}

input {
  min-height: 52px;
  padding: 0 12px;
  font-size: 1.1rem;
  font-weight: 800;
}

textarea {
  resize: vertical;
  min-height: 90px;
  padding: 12px;
}

input:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(116, 129, 113, 0.16);
}

input:disabled {
  color: var(--muted);
  background: var(--ui-cream);
}

.full,
.form-actions {
  grid-column: 1 / -1;
}

.settings-subhead {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 900;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 46px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 800;
}

.primary-button {
  border: 0;
  background: var(--green);
  color: #fff;
  box-shadow: none;
}

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

.ghost-button {
  min-height: 34px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  font-size: 0.82rem;
}

.install-button {
  white-space: nowrap;
}

.setup-guide {
  margin-bottom: 16px;
  border: 1px solid rgba(58, 59, 54, 0.14);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.setup-guide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.setup-guide-head h2 {
  font-size: clamp(1.12rem, 4vw, 1.45rem);
}

.setup-guide-head p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.65;
}

.setup-guide-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.setup-guide-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--ui-cream);
}

.setup-guide-check {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(58, 59, 54, 0.18);
  border-radius: 50%;
  color: #fff;
  background: #fff;
  font-weight: 900;
}

.setup-guide-item.is-done .setup-guide-check {
  border-color: var(--green);
  background: var(--green);
}

.setup-guide-item h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
}

.setup-guide-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
}

.setup-guide-item .secondary-button {
  min-width: 94px;
  white-space: nowrap;
}

.setup-guide-open {
  min-height: 38px;
  padding: 0 14px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.main-metric,
.metric,
.break-even,
.setup-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.main-metric {
  min-height: 150px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.main-metric.accent {
  border-color: rgba(58, 59, 54, 0.18);
  background: var(--surface-strong);
  box-shadow: none;
}

.main-metric span,
.metric span,
.break-even span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.main-metric strong {
  display: block;
  margin: 8px 0;
  font-size: 2.25rem;
  line-height: 1;
  overflow-wrap: anywhere;
}

.main-metric small,
.metric-note,
.note {
  color: var(--muted);
  font-size: 0.86rem;
}

.metric-note {
  display: block;
  margin-top: 8px;
  line-height: 1.45;
}

.break-even {
  padding: 16px;
  margin-bottom: 12px;
}

.break-even-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.break-even-head strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(1.35rem, 5vw, 2.4rem);
}

.progress-track {
  overflow: hidden;
  height: 16px;
  border-radius: 999px;
  background: var(--ui-cream-deep);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 180ms ease;
}

.note {
  margin: 10px 0 0;
}

.break-even-targets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.break-even-target {
  min-width: 0;
}

.break-even-target + .break-even-target {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.break-even-target span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.break-even-target strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: clamp(1.35rem, 5vw, 2.2rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.break-even-target small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.45;
}

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

.metric {
  min-height: 100px;
  padding: 14px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.25rem, 4vw, 2rem);
  line-height: 1.08;
}

.metric.expense-details {
  overflow: hidden;
  padding: 0;
}

.expense-details summary {
  display: grid;
  grid-template-areas:
    "label icon"
    "value icon";
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  min-height: 100px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

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

.expense-details summary::after {
  grid-area: icon;
  content: "+";
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green-dark);
  font-weight: 900;
}

.expense-details[open] summary::after {
  content: "-";
}

.expense-details summary span {
  grid-area: label;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.expense-details summary strong {
  grid-area: value;
  display: block;
  margin-top: 8px;
  margin-left: 0;
  color: var(--ink);
  font-size: clamp(1.25rem, 4vw, 2rem);
  line-height: 1.08;
}

.expense-breakdown-rows {
  display: grid;
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.expense-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: var(--surface-strong);
}

.expense-breakdown-row span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.expense-breakdown-row strong {
  color: var(--ink);
  font-size: 1rem;
  white-space: nowrap;
}

.expense-breakdown-row.is-total {
  background: var(--ui-cream);
}

.expense-breakdown-row.is-total span,
.expense-breakdown-row.is-total strong {
  color: var(--green-dark);
  font-weight: 900;
}

.expense-breakdown-row.is-child {
  padding-left: 28px;
}

.expense-breakdown-note {
  margin: 0;
  padding: 12px 16px 14px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.55;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.setup-box {
  padding: 16px;
  color: var(--muted);
}

.setup-box p {
  margin-bottom: 0;
  line-height: 1.7;
}

.invite-box {
  margin-top: 12px;
}

.invite-form {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  align-items: end;
}

.invite-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 800;
}

.invite-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.invite-row button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: transparent;
  color: var(--coral);
  font-weight: 900;
}

.invite-row button[data-copy-invite] {
  color: var(--green);
}

.invite-share-box {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-strong);
}

.invite-share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.invite-share-head h4 {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
}

.invite-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.invite-share-actions button {
  min-height: 34px;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 900;
}

#copyInviteMessageButton {
  border: 0;
  background: var(--green);
  color: #fff;
}

#closeInviteMessageButton {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.invite-message {
  min-height: 156px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.6;
}

code {
  border-radius: 6px;
  padding: 2px 6px;
  background: var(--ui-cream);
  color: var(--ink);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 20;
  transform: translate(-50%, 120%);
  max-width: min(420px, calc(100% - 28px));
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--green-dark);
  color: #fff;
  font-weight: 800;
  opacity: 0;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 33, 31, 0.34);
}

.dialog {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dialog h2 {
  font-size: 1.45rem;
}

.install-steps {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding-left: 22px;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.55;
}

.app-footer {
  display: grid;
  gap: 12px;
  width: 100vw;
  margin: 28px calc(50% - 50vw) 0;
  border-top: 1px solid rgba(58, 59, 54, 0.1);
  padding: 14px max(16px, calc((100vw - 1120px) / 2 + 16px));
  background: var(--ui-cream);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
}

.app-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
}

.footer-links a {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-decoration: none;
}

.footer-copyright {
  display: block;
  color: inherit;
  font-size: inherit;
  font-weight: 600;
  line-height: 1.45;
  white-space: nowrap;
}

.doc-body {
  background: #fff;
}

.doc {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 28px 18px 18px;
  line-height: 1.75;
}

.doc h1 {
  margin-bottom: 18px;
  font-size: clamp(1.9rem, 6vw, 2.8rem);
  line-height: 1.15;
}

.doc h2 {
  margin: 34px 0 12px;
  font-size: clamp(1.25rem, 4vw, 1.6rem);
  line-height: 1.35;
}

.doc h3 {
  margin: 24px 0 8px;
  font-size: 1.05rem;
}

.doc p,
.doc li {
  color: var(--ink);
}

.doc a {
  color: var(--green-dark);
  text-underline-offset: 3px;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 20px;
  font-size: 0.92rem;
}

.doc th,
.doc td {
  border: 1px solid var(--line);
  padding: 10px;
  vertical-align: top;
}

.doc th {
  background: var(--ui-cream);
  text-align: left;
}

.doc-back,
.doc-date,
.doc-note,
.doc-provider {
  color: var(--muted);
}

.doc-provider,
.doc-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--ui-cream);
}

.doc-copyright {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 0 18px 24px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.45;
  white-space: nowrap;
}

@media (hover: hover) {
  .tab:hover,
  .date-shift-button:hover,
  .secondary-button:hover,
  .ghost-button:hover,
  .invite-row button:hover,
  .invite-share-actions button:hover {
    border-color: rgba(58, 59, 54, 0.24);
    background: var(--ui-cream);
    color: var(--ink);
  }

  .primary-button:hover,
  .tab.active:hover,
  #copyInviteMessageButton:hover {
    background: var(--green-dark);
    color: #fff;
    transform: translateY(-1px);
  }
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .app-shell {
    padding: 14px 12px calc(92px + env(safe-area-inset-bottom));
  }

  .topbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: -14px -12px 18px;
    padding: 14px 12px 12px;
  }

  .brand-heading {
    width: min(248px, 72vw);
    margin: 0 auto;
  }

  .account {
    align-self: stretch;
    justify-content: flex-start;
  }

  .account .ghost-button {
    flex: 1 1 132px;
  }

  .sync-state {
    flex: 1 1 100%;
    justify-content: center;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .date-field {
    justify-items: stretch;
    width: 100%;
  }

  .date-note {
    text-align: left;
  }

  .date-input,
  .year-input {
    width: 100%;
    max-width: 100%;
  }

  .entry-form,
  .hero-metrics,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .main-metric strong {
    font-size: 2rem;
  }

  .break-even-targets {
    grid-template-columns: 1fr;
  }

  .break-even-target + .break-even-target {
    margin-top: 12px;
    padding-top: 12px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .auth-gate {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-actions {
    justify-items: stretch;
    width: 100%;
  }

  .store-create-form {
    grid-template-columns: 1fr;
  }

  .setup-guide-head {
    flex-direction: column;
  }

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

  .setup-guide-item {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .setup-guide-check {
    width: 28px;
    height: 28px;
  }

  .setup-guide-item .secondary-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .consent-note {
    text-align: left;
  }

  .invite-form {
    grid-template-columns: 1fr;
  }

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

  .invite-row-actions {
    width: 100%;
    justify-content: stretch;
  }

  .invite-row-actions button,
  .invite-share-actions button {
    flex: 1;
  }

  .tabs {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    top: auto;
    width: 100%;
    max-width: 100vw;
    margin: 0;
    padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transform: translateZ(0);
    backface-visibility: hidden;
  }

  .tab {
    min-height: 48px;
    font-size: 0.9rem;
  }

  .form-actions {
    grid-template-columns: 1fr;
  }

  .app-footer {
    margin: 22px -12px 0;
    padding: 13px 12px calc(13px + env(safe-area-inset-bottom));
  }

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

  .footer-links {
    justify-content: flex-start;
  }

  .footer-copyright {
    justify-self: center;
    text-align: center;
  }
}
