:root {
  --coral: #ef7f62;
  --coral-dark: #ce654d;
  --mint: #bfe6db;
  --mint-strong: #73bfb2;
  --sun: #f7c957;
  --sky: #9bc7de;
  --rose: #f5bdd0;
  --ink: #263238;
  --muted: #66787c;
  --line: #e5eceb;
  --paper: #fffdfb;
  --panel: #ffffff;
  --soft: #f6fbfa;
  --danger: #d95d5d;
  --shadow: 0 16px 40px rgba(49, 71, 77, 0.12);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 14px 16px, rgba(239, 127, 98, 0.35) 0 2px, transparent 2.4px),
    radial-gradient(circle at 44px 42px, rgba(247, 201, 87, 0.45) 0 2px, transparent 2.4px),
    radial-gradient(circle at 86px 22px, rgba(115, 191, 178, 0.34) 0 2px, transparent 2.4px),
    radial-gradient(circle at 118px 64px, rgba(155, 199, 222, 0.35) 0 2px, transparent 2.4px),
    linear-gradient(180deg, #fff8f4 0%, #f6fbfa 48%, #fffdfb 100%);
  background-size: 144px 144px, 144px 144px, 144px 144px, 144px 144px, auto;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input,
select {
  min-height: 40px;
  padding: 9px 11px;
}

textarea {
  resize: vertical;
  min-height: 70px;
  padding: 10px 11px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--mint-strong);
  box-shadow: 0 0 0 3px rgba(115, 191, 178, 0.18);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 20px 26px, rgba(239, 127, 98, 0.28) 0 2px, transparent 2.4px),
    radial-gradient(circle at 74px 44px, rgba(247, 201, 87, 0.36) 0 2px, transparent 2.4px),
    linear-gradient(180deg, #fff8f4 0%, #f6fbfa 100%);
  background-size: 124px 124px, 124px 124px, auto;
}

.auth-card {
  display: grid;
  width: min(430px, 100%);
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.auth-logo {
  width: 82px;
  height: 82px;
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 10px 22px rgba(38, 50, 56, 0.12);
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.auth-message.is-error {
  color: var(--danger);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(229, 236, 235, 0.92);
  background: rgba(255, 253, 251, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  width: 58px;
  height: 58px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(38, 50, 56, 0.12);
  object-fit: cover;
}

.brand span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.brand strong {
  overflow: hidden;
  color: var(--coral-dark);
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.topbar-actions,
.app-nav,
.form-actions,
.modal-form-header,
.service-form-header,
.calendar-toolbar,
.month-controls,
.mini-nav {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 10px;
}

.active-user {
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-nav {
  justify-content: center;
  min-width: 0;
  padding: 3px;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(247, 251, 250, 0.86);
}

.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  min-width: 0;
  padding: 8px 12px;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.nav-button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 12px rgba(38, 50, 56, 0.1);
}

.nav-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-main {
  display: grid;
  grid-template-columns: minmax(286px, 330px) minmax(540px, 1fr) minmax(286px, 340px);
  gap: 18px;
  width: min(1720px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.side-panel,
.calendar-panel {
  border: 1px solid rgba(229, 236, 235, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.side-panel {
  align-self: start;
  overflow: hidden;
}

.calendar-panel {
  min-width: 0;
  padding: 16px;
}

.panel-heading,
.calendar-toolbar,
.modal-form-header,
.service-form-header {
  justify-content: space-between;
  gap: 14px;
}

.panel-heading {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(191, 230, 219, 0.35), rgba(255, 255, 255, 0.9) 62%, rgba(247, 201, 87, 0.24));
}

.report-heading {
  background: linear-gradient(90deg, rgba(155, 199, 222, 0.24), rgba(255, 255, 255, 0.95) 55%, rgba(245, 189, 208, 0.24));
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--mint-strong);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  margin-bottom: 0;
  line-height: 1.15;
}

h1 {
  font-size: 22px;
}

h2 {
  font-size: 21px;
}

h3 {
  font-size: 15px;
}

.segmented {
  display: inline-flex;
  max-width: 100%;
  padding: 3px;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7fbfa;
}

.segmented.compact {
  flex: 0 0 auto;
}

.segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 36px;
  padding: 8px 10px;
  gap: 7px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 850;
}

.segment.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 12px rgba(38, 50, 56, 0.1);
}

.segment svg,
button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 850;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 40px;
  padding: 9px 12px;
  gap: 8px;
}

.primary-button span,
.secondary-button span,
.danger-button span,
.segment span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-button {
  color: #fff;
  background: var(--coral);
  box-shadow: 0 10px 22px rgba(239, 127, 98, 0.25);
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--coral-dark);
  transform: translateY(-1px);
}

.secondary-button {
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}

.secondary-button:hover,
.secondary-button:focus-visible,
.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--mint-strong);
  background: #f3fbf8;
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

.icon-button {
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}

.profile-list {
  display: grid;
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  gap: 8px;
}

.profile-card {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 10px;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.profile-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.profile-dot {
  width: 12px;
  height: 36px;
  border-radius: 999px;
  background: var(--accent);
}

.profile-card strong,
.profile-card span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-card small {
  color: var(--muted);
  font-weight: 750;
}

.profile-rate {
  color: var(--coral-dark);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.profile-new-button {
  width: 100%;
}

.compact-edit-button {
  min-height: 34px;
  padding: 7px 10px;
  gap: 6px;
  font-size: 12px;
}

.stacked-form,
.service-form {
  display: none;
  gap: 12px;
  padding: 16px;
}

.service-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.modal-form-header,
.service-form-header {
  align-items: flex-start;
  padding-bottom: 4px;
}

body.form-modal-open {
  overflow: hidden;
}

body.form-modal-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(38, 50, 56, 0.34);
  backdrop-filter: blur(8px);
}

.stacked-form.is-modal-open,
.service-form.is-modal-open {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 60;
  display: grid;
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(38, 50, 56, 0.24);
}

.service-form.is-modal-open {
  width: min(880px, calc(100vw - 32px));
  background: rgba(246, 251, 250, 0.98);
}

.form-row,
.baby-fields,
.sitter-fields {
  display: grid;
  gap: 12px;
}

.two-columns,
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.narrow {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 520px;
}

.form-actions {
  justify-content: space-between;
  gap: 8px;
}

.form-actions.align-right {
  justify-content: flex-end;
}

.calendar-toolbar {
  margin-bottom: 14px;
}

.month-controls {
  min-width: 0;
  gap: 12px;
}

.month-controls h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
  gap: 8px;
  margin-bottom: 8px;
}

.weekday-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.calendar-grid {
  gap: 8px;
}

.day-cell {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 126px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.day-cell.is-expanded {
  min-height: 260px;
  box-shadow: 0 14px 30px rgba(38, 50, 56, 0.13);
}

.day-cell:hover {
  border-color: var(--sky);
  box-shadow: 0 10px 22px rgba(38, 50, 56, 0.1);
  transform: translateY(-1px);
}

.day-cell.is-muted {
  background: rgba(246, 251, 250, 0.65);
}

.day-cell.is-today {
  border-color: var(--coral);
  box-shadow: inset 0 0 0 2px rgba(239, 127, 98, 0.22);
}

.day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.day-number {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--ink);
  font-weight: 900;
}

.is-today .day-number {
  color: #fff;
  background: var(--coral);
}

.occupancy-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(247, 201, 87, 0.5);
  font-size: 12px;
  font-weight: 900;
}

.event-stack {
  display: grid;
  align-content: start;
  gap: 6px;
  margin-top: 8px;
  min-width: 0;
  min-height: 0;
}

.event-stack.is-scrollable {
  max-height: 104px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: rgba(115, 191, 178, 0.75) transparent;
}

.event-stack.is-expanded {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.event-chip {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 5px 7px;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 64%, #ffffff);
  border-left-width: 5px;
  border-radius: 7px;
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 16%, #ffffff);
  text-align: left;
}

.event-chip.service-pending,
.selected-service-row.service-pending {
  filter: grayscale(1);
  opacity: 0.68;
  background: #eeeeee;
}

.event-chip time,
.event-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-chip time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.event-chip span {
  font-size: 12px;
  font-weight: 850;
}

.day-expand-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 28px;
  margin-top: 6px;
  padding: 5px 7px;
  gap: 5px;
  border: 1px solid rgba(115, 191, 178, 0.42);
  border-radius: 7px;
  color: var(--mint-strong);
  background: rgba(191, 230, 219, 0.22);
  font-size: 12px;
  font-weight: 900;
}

.day-expand-button:hover,
.day-expand-button:focus-visible {
  border-color: var(--mint-strong);
  background: rgba(191, 230, 219, 0.42);
}

.day-expand-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-expand-button svg {
  width: 14px;
  height: 14px;
}

.more-chip {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.selected-day-panel {
  display: grid;
  margin-top: 16px;
  padding: 14px;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(246, 251, 250, 0.9);
}

.selected-day-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.selected-day-header h2 {
  margin: 0;
  font-size: 18px;
}

.selected-day-list {
  display: grid;
  gap: 8px;
}

.selected-service-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.selected-service-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.selected-service-main strong,
.selected-service-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-service-main span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.selected-day-add {
  justify-self: end;
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--coral);
}

.recurrence-fields {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px dashed rgba(115, 191, 178, 0.72);
  border-radius: var(--radius);
  background: #fff;
}

.weekday-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weekday-pill {
  min-width: 52px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  font-weight: 900;
}

.weekday-pill.active {
  color: #fff;
  border-color: var(--mint-strong);
  background: var(--mint-strong);
}

.full-width-label {
  display: grid;
}

.report-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 14px;
  background: #fff;
}

.report-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.report-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.report-summary strong {
  color: var(--coral-dark);
  font-size: 18px;
}

.transactions-page {
  display: grid;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 18px;
  gap: 18px;
}

.transactions-hero,
.transaction-column,
.ledger-card {
  border: 1px solid rgba(229, 236, 235, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.transactions-hero {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(420px, 1.4fr);
  align-items: center;
  gap: 18px;
  padding: 18px;
  background: linear-gradient(90deg, rgba(191, 230, 219, 0.35), rgba(255, 255, 255, 0.95) 48%, rgba(245, 189, 208, 0.24));
}

.transactions-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.transactions-summary div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.transactions-summary span,
.ledger-meta,
.transaction-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.transactions-summary strong {
  color: var(--coral-dark);
  font-size: 18px;
}

.transactions-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.transaction-column {
  align-self: start;
  padding: 14px;
}

.ledger-list {
  display: grid;
  gap: 12px;
}

.ledger-card {
  overflow: hidden;
  box-shadow: none;
}

.ledger-card-header {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.ledger-card-header .profile-dot {
  height: 42px;
}

.ledger-title {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.ledger-title strong,
.ledger-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-balance {
  color: var(--coral-dark);
  font-weight: 950;
  white-space: nowrap;
}

.ledger-actions {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.transaction-list {
  display: grid;
}

.transaction-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.transaction-row:last-child {
  border-bottom: 0;
}

.transaction-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.transaction-main {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.transaction-main strong,
.transaction-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transaction-amount {
  font-weight: 950;
  white-space: nowrap;
}

.transaction-amount.charge {
  color: var(--coral-dark);
}

.transaction-amount.payment {
  color: var(--mint-strong);
}

.transaction-actions {
  grid-column: 2 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.report-block {
  padding: 14px;
  border-top: 1px solid var(--line);
}

.report-block-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--ink);
}

.report-block-title svg {
  width: 17px;
  height: 17px;
  color: var(--mint-strong);
}

.report-list {
  display: grid;
  gap: 8px;
}

.report-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.report-row .profile-dot {
  height: 42px;
}

.report-row strong,
.report-row span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.report-money {
  color: var(--coral-dark);
  font-weight: 950;
  white-space: nowrap;
}

.report-actions {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.payment-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 10px;
  gap: 6px;
  border: 1px solid rgba(115, 191, 178, 0.45);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(191, 230, 219, 0.38);
  font-size: 12px;
  font-weight: 900;
}

.payment-action:hover,
.payment-action:focus-visible {
  border-color: var(--mint-strong);
  background: rgba(191, 230, 219, 0.62);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(38, 50, 56, 0.38);
  backdrop-filter: blur(8px);
}

.payment-modal {
  display: grid;
  width: min(520px, 100%);
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 24px 60px rgba(38, 50, 56, 0.24);
}

.payment-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.payment-modal-header p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.security-panel {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.security-section {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.account-create-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px auto;
  gap: 10px;
  align-items: end;
}

.temporary-password {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #c69227;
  border-radius: 12px;
  background: #fff8df;
}

.temporary-password code { user-select: all; overflow-wrap: anywhere; }
.account-list, .security-events { display: grid; gap: 8px; }
.account-row, .security-event { padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.account-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.account-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.security-event { font-size: .86rem; }
.version-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

@media (max-width: 700px) {
  .account-create-form { grid-template-columns: 1fr; }
}

.choice-actions {
  display: grid;
  gap: 10px;
}

.choice-button {
  justify-content: flex-start;
  width: 100%;
  min-height: 48px;
}

.empty-state {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--soft);
  font-size: 13px;
  font-weight: 750;
  text-align: center;
}

@media (max-width: 1280px) {
  .app-main {
    grid-template-columns: minmax(280px, 340px) minmax(520px, 1fr);
  }

  .report-panel {
    grid-column: 1 / -1;
  }

  .report-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 940px) {
  .app-main {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .transactions-page {
    padding: 12px;
  }

  .transactions-hero,
  .transactions-layout {
    grid-template-columns: 1fr;
  }

  .profiles-panel {
    grid-row: 2;
  }

  .calendar-panel {
    grid-row: 1;
    padding: 12px;
  }

  .report-panel {
    grid-row: 3;
  }

  .calendar-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-list {
    max-height: none;
  }
}

@media (max-width: 660px) {
  body {
    font-size: 14px;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: flex-start;
    padding: 12px;
  }

  .app-nav {
    width: 100%;
  }

  .nav-button {
    flex: 1;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .brand strong {
    overflow: visible;
    font-size: 17px;
    text-overflow: clip;
    white-space: normal;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .primary-button,
  .secondary-button,
  .danger-button {
    min-height: 38px;
    padding: 8px 10px;
  }

  .panel-heading,
  .month-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
  }

  .segment {
    flex: 1;
  }

  .two-columns,
  .form-grid,
  .form-grid.narrow,
  .report-summary,
  .transactions-summary {
    grid-template-columns: 1fr;
  }

  .stacked-form.is-modal-open,
  .service-form.is-modal-open {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    padding: 14px;
  }

  .profile-card {
    grid-template-columns: 12px minmax(0, 1fr);
  }

  .profile-rate,
  .profile-card .compact-edit-button {
    grid-column: 2;
    justify-self: start;
  }

  .selected-service-row {
    grid-template-columns: 12px minmax(0, 1fr);
  }

  .selected-service-row .compact-edit-button {
    grid-column: 2;
    justify-self: start;
  }

  .selected-day-add {
    justify-self: stretch;
  }

  .weekday-row,
  .calendar-grid {
    gap: 5px;
  }

  .weekday-row span {
    font-size: 11px;
  }

  .day-cell {
    min-height: 102px;
    padding: 6px;
  }

  .day-cell.is-expanded {
    min-height: 214px;
  }

  .day-number {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .occupancy-badge {
    min-width: 21px;
    height: 20px;
    padding: 0 6px;
    font-size: 10px;
  }

  .event-chip {
    min-height: 27px;
    padding: 4px 5px;
  }

  .event-stack.is-scrollable {
    max-height: 96px;
  }

  .event-chip time {
    display: none;
  }

  .day-expand-button {
    min-height: 26px;
    padding: 4px 5px;
    font-size: 11px;
  }

  .report-row {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .report-actions {
    grid-column: 2;
    justify-items: start;
  }

  .ledger-card-header,
  .transaction-row {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .ledger-actions,
  .ledger-balance,
  .transaction-amount {
    grid-column: 2;
    justify-self: start;
  }

  .ledger-actions {
    justify-items: start;
  }

  .transaction-date {
    grid-column: 1 / -1;
  }
}
