/*
  Calendo Beauty portal
  Shared Organosi tokens (paper, ink, Inter, 16/12/999 radii).
  Beauty accent is the website rose. Mist is a light rose wash and stays
  off the page canvas. Layout (topbar, sidebar, bottom nav) is unchanged.
  Inter is self-hosted (SIL OFL, portal/app/static/fonts/OFL.txt).
*/

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-greek.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin.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 {
  --paper: #fbfcfa;
  --ink: #17211d;
  --mist: #fdeef3;
  --rose: #be3d64;
  --rose-dark: #993754;
  --bg: var(--paper);
  --text: var(--ink);
  --muted: rgba(23, 33, 29, 0.66);
  --line: rgba(23, 33, 29, 0.12);
  --brand: var(--rose);
  --focus: rgba(190, 61, 100, 0.45);
  --ok: #16a34a;
  --radius-card: 16px;
  --radius-control: 12px;
  --radius-chip: 999px;
  --shadow: 0 20px 70px rgba(23, 33, 29, 0.12);
  --shadow-sm: 0 10px 30px rgba(23, 33, 29, 0.08);
  --control-height: 44px;
}

html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
}
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

a { color: var(--brand); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; }

.wrap { max-width: 640px; margin: 0 auto; padding: 46px 18px; }
.wrap-legal { max-width: 760px; }
.legal p, .legal li { font-size: 14px; line-height: 1.55; }
.legal ul { margin: 0 0 16px; padding-left: 1.2em; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 18px; align-items: center; }
.card-head-sticky {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #fff;
  margin-top: -22px;
  padding-top: 22px;
  padding-bottom: 12px;
}
.brand-lockup { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: var(--radius-control);
  background: var(--brand);
  box-shadow: 0 10px 24px rgba(190, 61, 100, 0.22);
  flex: 0 0 auto;
}
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
a.brand-name { color: inherit; text-decoration: none; }
a.brand-name:hover { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) {
  .sidebar, .backdrop { transition: none; }
}
.brand-tag { margin-top: 2px; font-size: 12px; color: var(--muted); }
.lang-switch { display: flex; gap: 6px; }
.lang-switch a {
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  color: var(--text);
  min-height: var(--control-height);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
  text-decoration: none;
}
.lang-switch a.active { background: var(--brand); border-color: var(--brand); color: #fff; }

h1, h2 { margin: 0 0 8px; line-height: 1.15; font-weight: 700; }
h1 { font-size: 28px; }
h2 { font-size: 20px; margin-top: 22px; }
.lead { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.hint { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.muted { color: var(--muted); font-size: 13px; }
.empty {
  padding: 18px;
  border-radius: var(--radius-card);
  background: var(--mist);
  border: 1px dashed var(--line);
  color: var(--muted);
}

.day-field { position: relative; display: block; }
.day-field::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 13px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--rose);
  border-radius: 3px;
  pointer-events: none;
}
.day-field input[type="text"] { padding-right: 44px; }
label { display: block; margin-top: 12px; font-size: 13px; font-weight: 700; }
input:not([type="hidden"]):not([type="radio"]):not([type="checkbox"]),
select,
textarea {
  width: 100%;
  min-height: var(--control-height);
  padding: 10px 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  margin-top: 6px;
  box-sizing: border-box;
}
textarea { min-height: 88px; resize: vertical; }
.day-field input.day-picker:not([type="hidden"]) {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 46px;
  height: var(--control-height);
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 0;
  cursor: pointer;
}
::placeholder { color: var(--muted); }
.password-field { position: relative; margin-top: 6px; }
.password-field input:not([type="hidden"]):not([type="radio"]):not([type="checkbox"]) {
  width: 100%;
  margin-top: 0;
  padding-right: 48px;
}
button.password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: var(--control-height);
  height: var(--control-height);
  min-height: var(--control-height);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
button.password-toggle:hover,
button.password-toggle:focus-visible {
  background: var(--mist);
  color: var(--rose-dark);
}
button.password-toggle svg { width: 22px; height: 22px; display: block; }
button.password-toggle svg[hidden] { display: none; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--brand);
}
button, .btn {
  font-weight: 700;
  min-height: var(--control-height);
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-control);
  border: none;
  background: var(--brand);
  color: #fff;
  width: 100%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}
button:hover, .btn:hover { background: var(--rose-dark); text-decoration: none; }
button:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
button:disabled { opacity: 0.55; cursor: not-allowed; }
.ghost, .ghost-btn {
  background: transparent;
  color: var(--text);
}
.ghost-btn { border: 1px solid var(--line); }
.ghost {
  border: none;
  width: auto;
  margin: 0;
  min-width: var(--control-height);
  padding: 8px;
}
.ghost:hover, .ghost-btn:hover, .btn.ghost-btn:hover {
  background: var(--mist);
  color: var(--text);
}

.trial-banner {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  background: #fff8eb;
  border: 1px solid rgba(180, 120, 20, 0.35);
  font-size: 14px;
  line-height: 1.45;
}
.wrapp-banner,
.connect-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  background: #f4f7f6;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}
.connect-banner {
  background: #fff8eb;
  border-color: rgba(180, 120, 20, 0.35);
  align-items: flex-start;
}
.wrapp-info {
  background: #f4f7f6;
  box-shadow: none;
}
.wrapp-banner p,
.connect-banner p { margin: 0; flex: 1 1 16rem; }
.connect-banner p.connect-hint { flex: 1 1 100%; color: var(--muted); font-size: 14px; }
.connect-banner .connect-hint a { color: var(--rose); font-weight: 700; }
.wrapp-banner form { margin: 0; }
.wrapp-banner .btn-inline,
.wrapp-banner button,
.connect-banner .btn-inline,
.connect-banner button { width: auto; margin-top: 0; }
#wrapp-setup-step { scroll-margin-top: 12px; }
#salon-wrapp,
#salon-viva { scroll-margin-top: 12px; }
.fiscal-doc {
  display: grid;
  gap: 6px;
  min-width: 0;
  max-width: 280px;
  margin: 0 0 10px;
}
.fiscal-doc p { margin: 0; overflow-wrap: anywhere; }
.fiscal-mark, .fiscal-uid { font-weight: 700; }
.fiscal-reason { color: #7c2d12; }
.fiscal-qr {
  width: 112px;
  height: 112px;
  background: #fff;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-sizing: border-box;
}
.fiscal-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.fiscal-actions form { margin: 0; min-width: 0; }
.fiscal-actions button,
.fiscal-actions .ghost-btn { width: auto; margin-top: 0; }
.fiscal-actions label { margin-top: 0; min-width: 7rem; }
@media (max-width: 720px) {
  .wrapp-banner .btn-inline,
  .wrapp-banner button,
  .connect-banner .btn-inline,
  .connect-banner button,
  .fiscal-actions button,
  .fiscal-actions .ghost-btn,
  #wrapp-setup-step .btn-inline {
    width: 100%;
  }
  .fiscal-doc { max-width: none; }
  .appt-card { flex-wrap: wrap; align-items: flex-start; }
  .appt-card .row-actions { flex: 1 1 100%; }
  .catalog-stack, .catalog-stack > * { min-width: 0; max-width: 100%; }
  .card { box-sizing: border-box; }
  #public-booking, #public-booking a { overflow-wrap: anywhere; }
}
.msg { margin: 10px 0; padding: 10px 12px; border-radius: var(--radius-control); }
.msg-error { background: #fff1ec; border: 1px solid rgba(196, 120, 74, 0.35); color: #7c2d12; }
.msg-warn { background: #fff8eb; border: 1px solid rgba(180, 120, 20, 0.35); color: #7a4b00; }
.msg-ok { background: #ecfdf3; border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); color: #14532d; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 8px; }
.page-head .lead { margin-bottom: 0; }
.day-label { margin: 0 0 6px; font-weight: 700; }
.btn-inline { width: auto; margin-top: 0; padding: 10px 16px; white-space: nowrap; }
a.btn-inline { text-decoration: none; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-actions form { margin: 0; }
.row-actions .btn,
.row-actions button,
.inline-form button { width: auto; margin-top: 0; }
.inline-form { margin-top: 12px; }
#availability-status .empty,
#availability-status .msg,
#availability-status .hint { margin-top: 12px; }
.roster { list-style: none; padding: 0; margin: 8px 0 0; }
.roster li { margin: 6px 0; }
.review-list { display: grid; grid-template-columns: minmax(8rem, auto) 1fr; gap: 4px 12px; margin: 8px 0 12px; }
.review-list dt { color: var(--muted); }
.choice-list { border: 0; padding: 0; margin: 8px 0 12px; display: grid; gap: 8px; }
.choice-list label { display: flex; gap: 8px; align-items: center; font-weight: 700; }
.choice-list input { width: auto; margin: 0; }
.slot-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px; margin: 8px 0 12px;
}
.slot-grid label { margin: 0; }
.slot-grid input { position: absolute; opacity: 0; pointer-events: none; }
.slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height);
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  text-align: center;
  background: #fff;
  font-weight: 700;
  font-size: 13px;
}
.slot-grid input:focus + .slot,
.slot-grid input:focus-visible + .slot {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.slot-grid input:checked + .slot { background: var(--brand); color: #fff; border-color: var(--brand); }

.readable-name {
  display: block;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}
.public-book h1,
.public-book h2,
.public-book h3,
.public-book .lead,
.public-book .hint,
.public-book .review-list dd,
.public-book .choice-card,
.public-book .salon-pick {
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}
.public-book .card-head { align-items: flex-start; min-width: 0; }
.public-book .brand-lockup { min-width: 0; flex: 1; }
.public-book .lang-switch { flex: 0 0 auto; }
.public-book .brand-name,
.public-book .brand-tag { overflow-wrap: anywhere; }
.wizard-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.wizard-progress li {
  flex: 1 1 5.5rem;
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.wizard-progress li.is-current { color: var(--brand); }
.wizard-progress li.is-done { color: var(--text); }
html.wizard-on .public-book [data-step] { display: none; }
html.wizard-on .public-book [data-step].is-current { display: block; }
.wizard-nav { display: flex; gap: 8px; align-items: stretch; }
.wizard-nav button,
.wizard-nav .btn { width: auto; flex: 1; margin-top: 8px; }
.public-book .choice-list { display: grid; gap: 8px; }
.public-book label.choice { display: block; margin-top: 0; font-weight: 400; }
.public-book label.choice[hidden] { display: none !important; }
#invoice-buyer[hidden] { display: none !important; }
.choice { position: relative; display: block; margin-top: 8px; font-weight: 400; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 12px;
  min-height: var(--control-height);
  line-height: 1.35;
}
.choice input:focus-visible + .choice-card,
.choice input:focus + .choice-card {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.choice input:checked + .choice-card {
  background: var(--mist);
  border-color: var(--brand);
}
.salon-pick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-weight: 400;
  line-height: 1.35;
}
.salon-pick:hover { background: var(--mist); text-decoration: none; }
.slot-group { margin: 12px 0 4px; }
.slot-group h3 { margin: 0 0 8px; font-size: 15px; }
.state-title { display: block; margin-bottom: 4px; }
.msg-closed {
  background: var(--mist);
  border: 1px solid var(--line);
  color: var(--text);
}
.msg-off {
  background: rgba(23, 33, 29, 0.04);
  border: 1px dashed var(--line);
  color: var(--text);
}
@media (max-width: 430px) {
  .public-book.wrap { padding: 16px 12px; }
  .public-book .card { padding: 16px 14px; }
  .public-book .card-head-sticky { margin-top: -16px; padding-top: 16px; }
  .public-book h1 { font-size: 24px; }
  .public-book .review-list { grid-template-columns: 1fr; gap: 2px 0; }
  .public-book .review-list dd { margin: 0 0 10px; }
  .slot-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
}
.salon-code {
  margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-control); background: var(--mist); display: grid; gap: 2px;
}
.salon-code__label { font-size: 12px; font-weight: 700; color: var(--muted); }
.salon-code__value { font-size: 18px; font-weight: 700; color: var(--rose); }

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  background: rgba(251, 252, 250, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40;
  /* Include padding and the border so the outer box stays 260px, matching the desktop grid track. */
  box-sizing: border-box;
  background: #fff; border-right: 1px solid var(--line);
  padding: 88px 16px 24px; transform: translateX(-110%);
  transition: transform 0.2s ease;
}
.sidebar.open, body.sidebar-open .sidebar { transform: none; }
.sidebar-kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sidebar-link {
  display: flex;
  align-items: center;
  min-height: var(--control-height);
  padding: 10px 12px;
  border-radius: var(--radius-control);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}
.sidebar-link:hover { background: var(--mist); text-decoration: none; }
.sidebar-link.is-active { background: var(--mist); color: var(--brand); }
.backdrop { display: none; position: fixed; inset: 0; background: rgba(23, 33, 29, 0.28); z-index: 30; }
.backdrop.open { display: block; }
.content { padding: 18px 18px calc(156px + env(safe-area-inset-bottom)); max-width: 880px; margin: 0 auto; min-width: 0; }
.content-wide { max-width: 1100px; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 4px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--line);
}
.bottom-nav .item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height);
  font-size: 11px;
  text-align: center;
  padding: 8px 4px;
  border-radius: var(--radius-control);
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}
.bottom-nav .item.is-active { color: var(--brand); background: var(--mist); }

.stack { display: grid; gap: 10px; padding: 0; list-style: none; }
.appt-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}
.when { font-weight: 700; color: var(--brand); min-width: 92px; }
.chip {
  font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: var(--radius-chip);
  background: var(--mist); color: var(--rose);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
.defs { display: grid; gap: 10px; }
.defs div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 12px 14px;
}
.defs dt { font-size: 12px; color: var(--muted); font-weight: 700; }
.defs dd { margin: 4px 0 0; font-weight: 700; }
.form-grid { display: grid; gap: 4px; }
.table-cards-view { display: none; }
@media (max-width: 720px) {
  .page-head { flex-direction: column; }
  .btn-inline { width: 100%; }
  table.js-responsive-table { display: none; }
  .table-cards-view { display: grid; gap: 10px; }
  .tcard {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    padding: 12px;
  }
  .tcard .row { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; }
  .tcard .k { color: var(--muted); font-size: 12px; }
  .sidebar { display: none; }
  .sidebar.open { display: block; }
}
@media (min-width: 900px) {
  .sidebar { transform: none; position: sticky; top: 64px; height: calc(100vh - 64px); }
  .app-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
  .topbar { grid-column: 1 / -1; }
  .bottom-nav { display: none; }
  .content { padding-bottom: 40px; }
}

.content:has(.cal-board) { max-width: none; }
.content.ledger { max-width: 1180px; }
.ledger-filters { display: grid; gap: 12px; }
.ledger-filters .filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.ledger-filters label { margin: 0; min-width: 12rem; flex: 1; }
.ledger-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 12px; }
.ledger-actions button { width: auto; margin-top: 0; }
.ledger-scroll { overflow-x: auto; margin-top: 12px; }
.record-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 12px; align-items: end; }
.record-grid label { margin-top: 0; }
.record-grid .span-2 { grid-column: 1 / -1; }
#record-payment .btn-inline { margin-top: 12px; }
.content:has(.person-card) { max-width: 1100px; }
.page-head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.cal-switch { display: flex; gap: 6px; }
.cal-switch a {
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  min-height: var(--control-height);
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  color: var(--text);
  background: #fff;
  font-weight: 700;
  text-decoration: none;
}
.cal-switch a:hover { background: var(--mist); text-decoration: none; }
.cal-switch a.is-active { background: var(--mist); color: var(--brand); border-color: transparent; }
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 14px;
}
.cal-toolbar .day-label { margin: 0; text-align: center; flex: 1 1 220px; }
.cal-day {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 14px;
  margin-bottom: 14px;
}
.cal-day-title { margin: 0 0 10px; font-size: 18px; }
.cal-day-title a { color: var(--text); text-decoration: none; }
.cal-day-title a:hover { color: var(--brand); }
.cal-closed {
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  background: var(--mist);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
}
.cal-col-head .cal-closed { margin-top: 8px; }
.cal-note { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.cal-scroll { overflow-x: auto; min-width: 0; }
.cal-head-row, .cal-grid {
  display: grid;
  grid-template-columns: repeat(var(--staff), minmax(0, 1fr));
  column-gap: 8px;
  min-width: 0;
}
.cal-grid {
  grid-template-rows: repeat(var(--rows), 28px);
  background-image: linear-gradient(to bottom, transparent 27px, var(--line) 28px);
  background-size: 100% 28px;
}
.cal-col-head {
  border-top: 3px solid var(--line);
  padding: 8px 4px 10px;
  min-width: 0;
}
.cal-staff { margin: 0; font-size: 16px; }
.cal-col-head .muted { margin: 2px 0 0; }
.cal-time {
  grid-column: 1;
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  padding: 4px 6px 0 0;
  line-height: 1.2;
}
.cal-board[data-view="week"] {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  overflow: hidden;
  align-items: start;
  min-width: 0;
}
.cal-board[data-view="week"] .cal-day {
  width: auto;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
  margin-bottom: 0;
  padding: 8px;
}
.cal-board[data-view="week"] .cal-scroll { overflow: hidden; }
.cal-board[data-view="week"] .cal-day-title {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.cal-board[data-view="week"] .cal-staff,
.cal-board[data-view="week"] .cal-col-head .muted,
.cal-board[data-view="week"] .cal-slot,
.cal-board[data-view="week"] .cal-appt,
.cal-board[data-view="week"] .cal-appt strong,
.cal-board[data-view="week"] .cal-appt .muted,
.cal-board[data-view="week"] .cal-appt .when {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.cal-board[data-view="week"] .cal-closed { max-width: 100%; overflow-wrap: anywhere; }
.cal-board[data-view="week"] .cal-slot { padding: 0 2px; font-size: 11px; }
#cal-today { scroll-margin-top: 12px; }
.cal-off {
  background: rgba(23, 33, 29, 0.045);
}
.cal-slot, .cal-appt {
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  text-decoration: none;
}
.cal-slot {
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
}
.cal-slot:hover, .cal-slot:focus-visible {
  background: var(--mist);
  color: var(--brand);
  text-decoration: none;
}
.cal-slot.is-past {
  color: var(--muted);
  background: rgba(23, 33, 29, 0.06);
  cursor: default;
  pointer-events: none;
}
.cal-slot.is-past:hover, .cal-slot.is-past:focus-visible {
  background: rgba(23, 33, 29, 0.06);
  color: var(--muted);
}
.cal-appt {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  margin: 1px 0;
  padding: 4px 8px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--mist);
  border-left: 3px solid var(--staff-color, var(--rose));
  color: var(--text);
  font-weight: 500;
  font-size: 12px;
  line-height: 1.25;
  z-index: 1;
}
.cal-appt:hover, .cal-appt:focus-visible { text-decoration: none; filter: brightness(0.98); }
.cal-appt strong { font-size: 13px; }
.cal-appt .when { color: var(--brand); font-weight: 700; }
.cal-appt .chip { margin-top: 2px; font-size: 11px; padding: 2px 6px; }
.cal-cancelled { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.cal-cancelled a { font-size: 13px; font-weight: 600; }
.cal-visit-actions { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.cal-visit-actions li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.cal-visit-actions form { margin: 0; }
.cal-visit-actions .btn-inline { white-space: normal; padding: 4px 8px; min-height: 32px; font-size: 12px; }
@media (max-width: 720px) {
  .cal-toolbar .btn-inline { width: auto; }
}

.search-card { margin: 12px 0; }
.client-book { margin-top: 12px; }
.client-book a.appt-card { color: inherit; text-decoration: none; }
.client-book a.appt-card:hover { border-color: var(--brand); text-decoration: none; }
.client-book a.appt-card strong { flex: 1; }
.profile-section { margin-top: 22px; }
.notes-text { margin: 0 0 12px; white-space: pre-wrap; }
.visit-list { list-style: none; display: grid; gap: 10px; margin: 0; padding: 0; }
.visit-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}
.visit-card .when { min-width: 0; }
.visit-card p { margin: 0; }
.visit-payments { margin: 6px 0 0; padding-left: 1.1em; }
.money { font-weight: 700; color: var(--rose); }

.catalog-stack { display: grid; gap: 28px; margin-top: 16px; }
.category-block { display: grid; gap: 12px; }
.category-title { margin: 0; font-size: 26px; }
.service-card h2, .service-card h3, .person-card h2 { margin-top: 0; }
.service-card h3 { margin-bottom: 8px; font-size: 20px; }
.service-create { background: var(--mist); box-shadow: none; }
.service-fields { display: grid; gap: 0 12px; }
.service-group { margin: 14px 0 0; font-size: 18px; }
@media (min-width: 800px) {
  .service-fields { grid-template-columns: minmax(12rem, 1.5fr) repeat(4, minmax(6.5rem, 0.8fr)); }
}
.person-role { margin: 0 0 4px; font-weight: 700; color: var(--rose); }
.fact-line { margin: 0; }
.day-table { margin-top: 8px; }
.day-row {
  display: grid;
  grid-template-columns: minmax(9rem, 1.1fr) minmax(8.5rem, 0.9fr) minmax(13rem, 1.4fr) minmax(9rem, 0.9fr) minmax(13rem, 1.4fr);
  gap: 8px 12px;
  align-items: end;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.day-name { display: grid; gap: 2px; padding-bottom: 8px; font-weight: 700; }
.day-summary { font-weight: 500; color: var(--muted); font-size: 13px; }
.day-row label { margin-top: 0; }
.time-pair { display: flex; gap: 8px; align-items: end; }
.time-pair label { flex: 1; }
.time-pair input { margin-top: 6px; }
.time-off-title { margin: 18px 0 4px; font-size: 16px; }
.time-off-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.time-off-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.time-off-label { font-weight: 700; }
.check { display: flex; align-items: center; gap: 8px; margin: 0; }
.check input { width: auto; margin: 0; }
.catalog-actions { display: flex; justify-content: flex-end; }
.setup-grid { display: grid; gap: 0 16px; }
@media (min-width: 720px) {
  .setup-grid { grid-template-columns: 1fr 1fr; }
}
.fact-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 0; }
.fact-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-weight: 700;
}
.link-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.link-row .btn { width: auto; margin-top: 0; }
.report-facts { display: grid; gap: 12px; margin-top: 16px; }
.report-fact {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
}
.report-fact h2 { margin: 0 0 4px; font-size: 15px; }
.report-value {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.report-split { display: flex; flex-wrap: wrap; gap: 18px 32px; }
.report-split .report-value { font-size: 28px; }
.report-fact .hint { margin: 8px 0 0; }
.report-fact .muted { margin: 0 0 4px; }
@media (max-width: 900px) {
  .day-row { grid-template-columns: 1fr 1fr; }
  .day-name { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .day-row { grid-template-columns: 1fr; }
  .time-pair { flex-wrap: wrap; }
  .time-pair input { min-width: 0; width: 100%; }
  .ledger-filters .filter-row { flex-direction: column; align-items: stretch; }
  .ledger-filters label,
  .ledger-filters input,
  .ledger-filters .btn,
  .ledger-filters .btn-inline { min-width: 0; max-width: 100%; width: 100%; }
  .cal-switch { flex-wrap: wrap; }
  .record-grid { grid-template-columns: 1fr; }
  .tcard .row { flex-wrap: wrap; }
  .tcard .row > * { min-width: 0; max-width: 100%; }
  .content.ledger { max-width: 100%; }
}

/* Phone shell: one row of main sections, plus More. Desktop (min-width 900px) hides this bar. */
.bottom-nav button.item {
  width: auto;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: none;
}
.bottom-nav button.item:hover { background: var(--mist); color: var(--text); }
.bottom-nav button.item.is-active { color: var(--brand); background: var(--mist); }

.cal-phone-dayview,
.cal-phone-week { display: none; }

@media (max-width: 899px) {
  .bottom-nav { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .bottom-nav .item { min-width: 0; overflow-wrap: anywhere; }
  .content { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .sidebar.open,
  body.sidebar-open .sidebar {
    z-index: 46;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: calc(24px + 80px + env(safe-area-inset-bottom));
  }
  .topbar a.sign-out {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    box-sizing: border-box;
  }
  .login-secondary a {
    min-height: 44px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
  }
  fieldset.choice-list label {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    box-sizing: border-box;
  }
  .ledger-scroll a,
  .table-cards-view a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
  }
}

@media (max-width: 600px) {
  .cal-board[data-view="day"],
  .cal-board[data-view="week"] { display: none; }
  .cal-grid {
    grid-template-rows: repeat(var(--rows), 44px);
    background-image: linear-gradient(to bottom, transparent 43px, var(--line) 44px);
    background-size: 100% 44px;
  }
  .cal-slot { min-height: 44px; font-size: 14px; }
  .cal-grid.cal-grid-one {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    width: 100%;
  }
  .cal-phone-dayview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
    min-width: 0;
    max-width: 100%;
  }
  .cal-staff-block { display: contents; }
  .cal-pick {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }
  .cal-phone-dayview label {
    order: 0;
    flex: 1 1 5.5rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background: #fff;
    color: var(--text);
    font-weight: 700;
    text-align: center;
    box-sizing: border-box;
  }
  .cal-pick:checked + label {
    background: var(--mist);
    color: var(--brand);
    border-color: transparent;
  }
  .cal-pick:focus-visible + label {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
  }
  .cal-phone-dayview .cal-person { display: none; order: 1; flex: 1 1 100%; min-width: 0; }
  .cal-pick:checked + label + .cal-person { display: block; }
  .cal-phone-dayview:has(.cal-staff-block:only-of-type) label,
  .cal-phone-dayview:has(.cal-staff-block:only-of-type) .cal-pick { display: none; }
  .cal-phone-dayview:has(.cal-staff-block:only-of-type) .cal-person { display: block; }
  .cal-phone-note,
  .cal-phone-dayview .empty { flex: 1 1 100%; order: -1; }
  .cal-phone-week {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }
  .cal-phone-week .cal-day { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
  .cal-phone-week .cal-person { display: block; margin-top: 14px; min-width: 0; }
}
