/* ===================== Pups — styles ===================== */
:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef1f4;
  --border: #e2e6ea;
  --border-strong: #cfd5dc;
  --text: #18212b;
  --muted: #667080;
  --faint: #9aa3ae;
  /* Colour theme: each theme sets a light (-l) and dark (-d) brand colour */
  --brand-l: #0e7c72; --brand-d: #2bb3a3;
  --brand: var(--brand-l);
  --brand-strong: color-mix(in srgb, var(--brand) 78%, var(--text));
  --brand-soft: color-mix(in srgb, var(--brand) 12%, var(--surface));
  --on-brand: #ffffff;
  --font-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --accent: #ff7a59;
  --danger: #d64545;
  --danger-soft: #fdeaea;
  --s0: #0e7c72; --s1: #2f6fe4; --s2: #7c4ddb; --s3: #d6337f; --s4: #c26a0a; --s5: #55657a;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
  --shadow: 0 16px 40px rgba(16,24,40,.16), 0 2px 6px rgba(16,24,40,.06);
  --radius: 14px;
  --radius-sm: 10px;
  --topbar: 62px;
  --hour: 64px;
  color-scheme: light;
}
/* Dark mode: follows the device / Claude theme on "Auto", or the Appearance setting (data-mode) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-mode="light"]) {
    --bg: #0e1318; --surface: #161c23; --surface-2: #1b222a; --surface-3: #232b35;
    --border: #2a333e; --border-strong: #3a4552;
    --text: #e7ecf1; --muted: #9aa5b2; --faint: #6c7783;
    --brand: var(--brand-d); --brand-strong: color-mix(in srgb, var(--brand) 70%, #fff); --brand-soft: color-mix(in srgb, var(--brand) 18%, var(--surface)); --on-brand: #06181a;
    --danger: #ef6b6b; --danger-soft: #3a1d1f;
    --s0: #2bb3a3; --s1: #6a9cff; --s2: #a685f5; --s3: #f06aa6; --s4: #f0a040; --s5: #94a3b8;
    --shadow: 0 16px 40px rgba(0,0,0,.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"]:not([data-mode="light"]), :root[data-mode="dark"] {
  --bg: #0e1318; --surface: #161c23; --surface-2: #1b222a; --surface-3: #232b35;
  --border: #2a333e; --border-strong: #3a4552;
  --text: #e7ecf1; --muted: #9aa5b2; --faint: #6c7783;
  --brand: var(--brand-d); --brand-strong: color-mix(in srgb, var(--brand) 70%, #fff); --brand-soft: color-mix(in srgb, var(--brand) 18%, var(--surface)); --on-brand: #06181a;
  --danger: #ef6b6b; --danger-soft: #3a1d1f;
  --s0: #2bb3a3; --s1: #6a9cff; --s2: #a685f5; --s3: #f06aa6; --s4: #f0a040; --s5: #94a3b8;
  --shadow: 0 16px 40px rgba(0,0,0,.55);
  color-scheme: dark;
}
:root[data-mode="light"] { color-scheme: light; }

/* Colour themes */
:root[data-accent="ocean"]    { --brand-l: #1f62d6; --brand-d: #6f9fff; }
:root[data-accent="lavender"] { --brand-l: #7046d6; --brand-d: #a98bf7; }
:root[data-accent="berry"]    { --brand-l: #c02c6f; --brand-d: #f27aad; }
:root[data-accent="sunset"]   { --brand-l: #c9520f; --brand-d: #f59a52; }
:root[data-accent="forest"]   { --brand-l: #2f7a35; --brand-d: #6cc172; }
:root[data-accent="slate"]    { --brand-l: #334155; --brand-d: #a5b4c8; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
a { color: var(--brand); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.spacer { flex: 1; }

.ic { width: 18px; height: 18px; flex: none; display: block; }
[data-icon] { display: inline-flex; }

/* ---------- App shell ---------- */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.topbar {
  height: var(--topbar);
  flex: none;
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { width: 40px; height: 40px; display: block; flex: none; filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--brand) 35%, transparent)); }
.brand-mark svg, .logo svg { width: 100%; height: 100%; display: block; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 25px; letter-spacing: .01em; color: var(--brand-strong); }
.logo-big { display: flex; align-items: center; gap: 16px; }
.logo-big .logo { width: 72px; height: 72px; }
.logo-big .brand-name { font-size: 40px; line-height: 1; }
.logo-big .tagline { font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-top: 4px; }

/* Sync status pill */
.sync-pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2);
  font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap;
}
.sync-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.sync-pill[data-state="synced"] i { background: #22a06b; }
.sync-pill[data-state="syncing"] i, .sync-pill[data-state="connecting"] i { background: #e0a100; animation: blink 1s infinite; }
.sync-pill[data-state="offline"] i, .sync-pill[data-state="error"] i { background: var(--danger); }
@keyframes blink { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .sync-pill i { animation: none !important; } }
.sync-detail { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.sync-detail .sync-pill { flex: none; }

/* Theme picker */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.swatch {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface);
  font-size: 13px; font-weight: 700;
}
.swatch span { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 3px var(--surface), 0 0 0 1px var(--border); }
.swatch.on { border-color: var(--brand); background: var(--brand-soft); }
.seg.full { display: flex; }
.seg.full button { flex: 1; }
.topnav { display: flex; gap: 4px; margin-left: 12px; }
.topnav button {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 0; padding: 9px 14px; border-radius: 10px;
  color: var(--muted); font-weight: 700;
}
.topnav button:hover { background: var(--surface-3); color: var(--text); }
.topnav button.active { background: var(--brand-soft); color: var(--brand-strong); }
.topbar .sync-pill { margin-left: auto; }
.page-head h1, .cal-title, .modal-head h2, .panel h2, .confirm h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: 0; }

.main { flex: 1; min-height: 0; overflow: auto; padding: 18px 20px 20px; }
.view { max-width: 1440px; margin: 0 auto; }
#view-calendar { height: 100%; display: flex; flex-direction: column; }

.bottomnav, .fab { display: none; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px;
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--text);
  font-weight: 700; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 28%, transparent); }
.btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-outline { color: var(--danger); border-color: var(--danger); }
.btn.danger-outline:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost.danger { color: var(--danger); background: transparent; }
.btn.ghost.danger:hover { background: var(--danger-soft); }
.btn.small { height: 34px; padding: 0 12px; font-size: 14px; }
.btn .ic { width: 17px; height: 17px; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface);
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn.plain { border-color: transparent; background: transparent; }

input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 70px; }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23889' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.btn:focus-visible, .icon-btn:focus-visible, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.sub { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; color: var(--muted); }
.sub > input, .sub > select, .sub > textarea { font-weight: 400; font-size: 15px; color: var(--text); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.search-box { position: relative; }
.search-box > [data-icon], .search-box > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-box input { padding-left: 38px !important; }
.search-box.big input { height: 48px; border-radius: 12px; font-size: 16px; }

.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
  background: var(--brand-soft); color: var(--brand-strong);
}
.avatar.sm { width: 34px; height: 34px; font-size: 13px; }

/* ---------- Calendar ---------- */
.cal-card {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.cal-toolbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-title { font-size: 19px; font-weight: 800; flex: 1; letter-spacing: -.01em; }
.seg { display: inline-flex; background: var(--surface-3); padding: 3px; border-radius: 11px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font-weight: 700; color: var(--muted); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.calendar { flex: 1; min-height: 0; overflow: auto; position: relative; overscroll-behavior: contain; }

/* time grid (day / week) */
.tg { min-width: 100%; }
.tg-head, .tg-body { display: grid; grid-template-columns: 58px repeat(var(--cols), minmax(0, 1fr)); }
.tg.week { min-width: 760px; }
.tg-head { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--border); }
.tg-dayhead {
  border: 0; background: transparent; padding: 8px 4px 9px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border-left: 1px solid var(--border);
}
.tg-dayhead span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tg-dayhead b { font-size: 20px; font-weight: 800; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.tg-dayhead:hover b { background: var(--surface-3); }
.tg-dayhead.today span { color: var(--brand); }
.tg-dayhead.today b { background: var(--brand); color: var(--on-brand); }
.tg-dayhead .cnt { font-size: 11px; color: var(--faint); font-weight: 700; text-transform: none; letter-spacing: 0; }
.tg-body { position: relative; }
.tg-times { position: relative; }
.tg-time { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; font-weight: 700; color: var(--faint); white-space: nowrap; }
.tg-time:first-child { transform: none; top: 2px !important; }
.tg-col { position: relative; border-left: 1px solid var(--border); }
.tg-col.today { background: color-mix(in srgb, var(--brand) 4%, transparent); }
.tg-slot { height: calc(var(--hour) / 2); border-bottom: 1px dashed color-mix(in srgb, var(--border) 70%, transparent); cursor: pointer; position: relative; }
.tg-slot.hr { border-bottom: 1px solid var(--border); }
.tg-slot:hover { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.tg-slot:hover::after {
  content: "+ " attr(data-label); position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  font-size: 12px; font-weight: 700; color: var(--brand);
}
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--accent); z-index: 3; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

.appt {
  --c: var(--s0);
  position: absolute; z-index: 2;
  border: 0; border-left: 4px solid var(--c);
  background: color-mix(in srgb, var(--c) 15%, var(--surface));
  color: var(--text);
  border-radius: 8px; padding: 4px 7px;
  text-align: left; overflow: hidden;
  font-size: 12px; line-height: 1.3;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  transition: box-shadow .15s, transform .1s;
}
.appt:hover { box-shadow: 0 4px 14px rgba(0,0,0,.15); z-index: 4; }
.appt.sel { outline: 2px solid var(--c); outline-offset: 1px; z-index: 4; }
.appt .a-time { font-weight: 700; color: color-mix(in srgb, var(--c) 75%, var(--text)); font-size: 11px; }
.appt .a-dog { font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .a-sub { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt.compact { display: flex; gap: 6px; align-items: center; padding-top: 1px; padding-bottom: 1px; white-space: nowrap; }
.svc-0 { --c: var(--s0); } .svc-1 { --c: var(--s1); } .svc-2 { --c: var(--s2); }
.svc-3 { --c: var(--s3); } .svc-4 { --c: var(--s4); } .svc-5 { --c: var(--s5); }

/* day strip (day view) */
.day-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; z-index: 6; }
.day-strip button { border: 0; background: transparent; border-radius: 10px; padding: 5px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.day-strip button span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.day-strip button b { font-size: 16px; font-weight: 800; }
.day-strip button i { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.day-strip button i.has { background: var(--brand); }
.day-strip button.today b { color: var(--brand); }
.day-strip button.on { background: var(--brand); }
.day-strip button.on span, .day-strip button.on b { color: var(--on-brand); }
.day-strip button.on i.has { background: var(--on-brand); }
.day-view .tg-head { top: 63px; }

.empty-day { position: absolute; left: 50%; top: 140px; transform: translateX(-50%); text-align: center; color: var(--muted); pointer-events: none; z-index: 1; width: 80%; }
.empty-day .ic { width: 34px; height: 34px; margin: 0 auto 8px; color: var(--faint); }

/* month */
.month { display: flex; flex-direction: column; min-height: 100%; }
.m-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.m-dow div { padding: 8px 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.m-grid { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(112px, 1fr); }
.m-cell { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.m-cell:nth-child(7n) { border-right: 0; }
.m-cell:hover { background: var(--surface-2); }
.m-cell.other { background: var(--surface-2); }
.m-cell.other .m-num { color: var(--faint); }
.m-num { align-self: flex-start; border: 0; background: transparent; font-weight: 800; font-size: 13px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.m-num:hover { background: var(--surface-3); }
.m-cell.today .m-num { background: var(--brand); color: var(--on-brand); }
.m-chip {
  --c: var(--s0);
  border: 0; text-align: left; width: 100%;
  font-size: 12px; padding: 3px 6px; border-radius: 6px;
  background: color-mix(in srgb, var(--c) 15%, var(--surface));
  border-left: 3px solid var(--c);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m-chip b { font-weight: 800; }
.m-chip:hover { filter: brightness(.96); }
.m-more { border: 0; background: none; font-size: 12px; font-weight: 700; color: var(--muted); text-align: left; padding: 1px 6px; }
.m-more:hover { color: var(--brand); }
.m-dots { display: none; }

/* ---------- Appointment tile ---------- */
.tile {
  position: fixed; z-index: 60;
  width: 330px; max-width: calc(100vw - 24px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: pop .14s ease-out;
}
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(4px); } to { opacity: 1; transform: none; } }
.tile-head {
  --c: var(--s0);
  padding: 14px 14px 12px 16px;
  background: color-mix(in srgb, var(--c) 14%, var(--surface));
  border-bottom: 1px solid var(--border);
  display: flex; gap: 10px; align-items: flex-start;
  border-top: 4px solid var(--c);
}
.tile-head .t-svc { font-weight: 800; font-size: 13px; color: color-mix(in srgb, var(--c) 80%, var(--text)); text-transform: uppercase; letter-spacing: .05em; }
.tile-head .t-when { font-weight: 700; font-size: 14px; margin-top: 2px; }
.tile-head .icon-btn { margin-left: auto; width: 32px; height: 32px; border: 0; background: transparent; }
.tile-head .icon-btn:hover { background: color-mix(in srgb, var(--c) 18%, transparent); }
.tile-body { padding: 4px 16px 6px; max-height: 55vh; overflow: auto; }
.t-sec { padding: 11px 0; border-bottom: 1px solid var(--border); }
.t-sec:last-child { border-bottom: 0; }
.t-lbl { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin-bottom: 4px; }
.t-big { font-size: 17px; font-weight: 800; }
.t-line { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 14px; color: var(--text); text-decoration: none; word-break: break-word; }
.t-line .ic { width: 15px; height: 15px; color: var(--muted); }
a.t-line:hover { color: var(--brand); }
.t-dog { display: flex; gap: 10px; align-items: center; }
.t-dog .paw { width: 38px; height: 38px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.t-notes { margin: 0; white-space: pre-wrap; font-size: 14px; }
.t-dognote { margin-top: 8px; font-size: 13px; padding: 7px 10px; background: var(--surface-2); border-radius: 8px; color: var(--muted); white-space: pre-wrap; }
.tile-actions { display: flex; gap: 6px; padding: 10px 12px 12px; border-top: 1px solid var(--border); background: var(--surface-2); }
.tile-actions .btn { flex: 1; height: 36px; padding: 0 8px; font-size: 13px; }
.tile-actions .btn.ghost.danger { flex: 0 0 auto; }
.tile-backdrop { display: none; }

/* ---------- Modals ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(12,18,24,.45); opacity: 0; transition: opacity .18s; }
.modal-wrap.open .modal-backdrop { opacity: 1; }
.modal {
  position: relative; width: 100%; max-width: 620px; max-height: calc(100dvh - 40px);
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateY(10px) scale(.98); opacity: 0; transition: transform .18s ease-out, opacity .18s;
}
.modal-wrap.open .modal { transform: none; opacity: 1; }
.modal.small { max-width: 460px; }
.modal-form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 14px 22px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 20px; font-weight: 800; flex: 1; letter-spacing: -.01em; }
.modal-head .icon-btn { border: 0; }
.modal-body { padding: 8px 22px 18px; overflow: auto; flex: 1; min-height: 0; }
.modal-foot { display: flex; gap: 10px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }

.field { padding: 14px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.field:last-of-type { border-bottom: 0; }
.label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.label-row { display: flex; align-items: center; justify-content: space-between; }
.form-error { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-weight: 700; font-size: 14px; }
.placeholder { padding: 14px; border: 1px dashed var(--border-strong); border-radius: 12px; text-align: center; }

.picked { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1.5px solid var(--brand); background: var(--brand-soft); border-radius: 12px; }
.picked-main { flex: 1; min-width: 0; }
.picked-name { font-weight: 800; font-size: 16px; }
.pick-list { margin-top: 8px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; max-height: 280px; overflow-y: auto; }
.pick-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--border); background: var(--surface); text-align: left; }
.pick-item:last-child { border-bottom: 0; }
.pick-item:hover, .pick-item.hl { background: var(--surface-3); }
.pick-main { min-width: 0; }
.pick-name { font-weight: 800; }
.pick-main .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-item.add { color: var(--brand); font-weight: 800; }
.pad { padding: 12px; }

.inline-card { border: 1px solid var(--border-strong); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.inline-title { font-weight: 800; }
.inline-actions { display: flex; justify-content: flex-end; gap: 8px; }

.dog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.dog-opt {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--border-strong); background: var(--surface);
  min-width: 0;
}
.dog-opt:hover { border-color: var(--brand); }
.dog-opt span:last-child { display: flex; flex-direction: column; min-width: 0; }
.dog-opt b { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dog-opt small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dog-opt .dog-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); flex: none; }
.dog-opt.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.dog-opt.on .dog-ic { background: var(--brand); color: var(--on-brand); }
.dog-opt.add { border-style: dashed; color: var(--brand); }
.dog-opt.add > .ic { width: 32px; height: 32px; padding: 7px; }

/* dogs list in customer modal */
.dog-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.dog-row + .dog-row { margin-top: 8px; }
.dog-row .paw { width: 38px; height: 38px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.dog-row .info { flex: 1; min-width: 0; }
.dog-row .name { font-weight: 800; font-size: 16px; }
.dog-row .note { font-size: 13px; color: var(--muted); margin-top: 3px; white-space: pre-wrap; }
.dog-row .acts { display: flex; gap: 4px; }
.dog-row .acts .icon-btn { width: 34px; height: 34px; }
.hist { display: flex; flex-direction: column; }
.hist button { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; border: 0; background: none; text-align: left; padding: 9px 4px; border-bottom: 1px solid var(--border); }
.hist button:last-child { border-bottom: 0; }
.hist button:hover { background: var(--surface-2); }
.hist .past { color: var(--muted); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--muted); }
.tag.up { background: var(--brand-soft); color: var(--brand-strong); }

.confirm { padding: 22px; }
.confirm h3 { font-size: 19px; font-weight: 800; }
.confirm p { color: var(--muted); margin: 8px 0 18px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Customers page ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; }
.cust-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 16px; }
.cust-card {
  display: flex; flex-direction: column; gap: 10px; text-align: left;
  padding: 16px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.cust-card:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(16,24,40,.08); }
.cust-top { display: flex; gap: 12px; align-items: center; }
.cust-name { font-weight: 800; font-size: 17px; }
.cust-contact { font-size: 13px; color: var(--muted); word-break: break-word; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 7px; border-radius: 999px; background: var(--surface-3); font-size: 13px; font-weight: 700; }
.chip .ic { width: 14px; height: 14px; color: var(--brand); }
.chip small { font-weight: 600; color: var(--muted); }
.cust-next { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.cust-next .ic { width: 14px; height: 14px; }
.cust-next.has { color: var(--brand-strong); font-weight: 700; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); grid-column: 1 / -1; }
.empty .big-ic { width: 64px; height: 64px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 14px; }
.empty .big-ic .ic { width: 32px; height: 32px; }
.empty h3 { color: var(--text); font-size: 18px; margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { font-size: 17px; font-weight: 800; }
.panel p { margin: 0; }

/* ---------- Login ---------- */
.login {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at 30% 20%, var(--brand-soft), var(--bg) 60%);
}
body.locked .app { visibility: hidden; }
.login-card {
  width: 100%; max-width: 360px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  box-shadow: var(--shadow); padding: 28px 24px 24px;
  display: flex; flex-direction: column; gap: 14px; text-align: center;
}
.login-card .logo { width: 76px; height: 76px; margin: 0 auto; }
.login-card h1.brand-name { font-size: 34px; margin-top: -4px; }
.login-card p { margin: -6px 0 4px; }
.login-card .sub { text-align: left; }
.login-card .btn { height: 46px; font-size: 16px; }
.login-card .form-error { margin: 0; text-align: left; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: #1b242e; color: #fff; padding: 11px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow); animation: pop .18s ease-out; }
.toast.warn { background: #8a4b06; }
.toast.error { background: #a32a2a; }

/* ===================== Tablet ===================== */
@media (max-width: 980px) {
  .topnav button { padding: 9px 10px; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .row3 > :first-child { grid-column: 1 / -1; }
}

/* ===================== Mobile ===================== */
@media (max-width: 720px) {
  :root { --topbar: 56px; --hour: 60px; }
  body { font-size: 16px; }
  .topbar { padding: 0 16px; padding-top: env(safe-area-inset-top); height: calc(var(--topbar) + env(safe-area-inset-top)); }
  .topnav, .new-booking { display: none; }
  .brand-name { font-size: 23px; }
  .brand-mark { width: 36px; height: 36px; }
  .sync-pill { margin-left: auto; height: 30px; padding: 0 10px; font-size: 12px; }
  .main { padding: 10px 10px 12px; }
  .main:has(#view-customers:not([hidden])), .main:has(#view-settings:not([hidden])) { padding: 16px 16px 96px; }

  .bottomnav {
    display: grid; grid-template-columns: repeat(3, 1fr);
    flex: none; background: var(--surface); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottomnav button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
  .bottomnav button .ic { width: 22px; height: 22px; }
  .bottomnav button.active { color: var(--brand); }
  .fab {
    display: grid; place-items: center;
    position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 30;
    width: 58px; height: 58px; border-radius: 18px; border: 0;
    background: var(--brand); color: var(--on-brand);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--brand) 45%, transparent);
  }
  .fab .ic { width: 26px; height: 26px; }

  .cal-toolbar { flex-wrap: wrap; gap: 8px; padding: 10px; }
  .cal-title { order: -1; flex-basis: 100%; font-size: 17px; }
  .cal-nav { flex: 1; }
  .seg button { padding: 6px 11px; }
  .tg-head, .tg-body { grid-template-columns: 46px repeat(var(--cols), minmax(0, 1fr)); }
  .tg.week { min-width: 640px; }
  .tg-time { right: 5px; font-size: 10px; }
  .tg-slot:hover::after { display: none; }
  .tg-slot:hover { background: transparent; }
  .tg-slot:active { background: color-mix(in srgb, var(--brand) 10%, transparent); }

  .m-grid { grid-auto-rows: minmax(64px, 1fr); }
  .m-cell { padding: 4px 2px; align-items: center; }
  .m-num { align-self: center; width: 30px; height: 30px; font-size: 14px; }
  .m-chip, .m-more { display: none; }
  .m-dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; max-width: 100%; }
  .m-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--brand)); }
  .m-dots em { font-style: normal; font-size: 10px; font-weight: 800; color: var(--muted); line-height: 6px; }
  .m-dow div { padding: 8px 0; text-align: center; font-size: 11px; }

  /* tile becomes bottom sheet */
  .tile { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; max-width: none; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: sheet .2s ease-out; }
  .tile-body { max-height: 52vh; }
  .tile-backdrop { display: block; position: fixed; inset: 0; z-index: 59; background: rgba(12,18,24,.4); }
  @keyframes sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

  /* modal becomes full sheet */
  .modal-wrap { padding: 0; place-items: end stretch; }
  .modal, .modal.small { max-width: none; max-height: calc(100dvh - 24px); border-radius: 20px 20px 0 0; transform: translateY(30px); }
  .modal-body { padding: 4px 16px 16px; }
  .modal-head { padding: 14px 12px 12px 16px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .modal-foot .btn.primary { flex: 1; }
  input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { font-size: 16px; height: 46px; }
  textarea { height: auto; }
  .row2 { grid-template-columns: 1fr; gap: 10px; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .dog-grid { grid-template-columns: 1fr 1fr; }
  .hist button { grid-template-columns: 1fr auto; }
  .hist button .h-dog { grid-column: 1; grid-row: 2; font-size: 13px; color: var(--muted); }

  .page-head h1 { font-size: 23px; }
  .page-head .btn { height: 40px; padding: 0 12px; }
  .cust-list { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .toasts { bottom: calc(90px + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .dog-grid { grid-template-columns: 1fr; }
  .seg button { padding: 6px 8px; font-size: 14px; }
}
