@font-face {
  font-family: "Vallamand Playfair";
  src: url("/assets/fonts/PlayfairDisplay-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Vallamand Playfair";
  src: url("/assets/fonts/PlayfairDisplay-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
:root {
  color-scheme: light;
  --cream: #f7f5f1;
  --wine: #702b3d;
  --muted: #8b898b;
  --card: rgba(255, 255, 255, .88);
  --line: rgba(112, 43, 61, .10);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  background: var(--cream);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--cream); overscroll-behavior-y: contain; }
body { margin: 0; min-height: 100vh; background: var(--cream); color: #242124; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.app-shell { max-width: 1040px; min-height: 100vh; margin: 0 auto; padding: calc(12px + var(--safe-top)) 18px calc(34px + var(--safe-bottom)); }
.brand-header { display: flex; align-items: center; gap: 11px; margin: 5px 0 25px; }
.brand-mark { width: 42px; height: 42px; object-fit: cover; border-radius: 12px; }
.brand-header h1 { margin: 0; color: var(--wine); font: 600 19px/1.2 "Vallamand Playfair", Georgia, serif; }
.brand-header p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.card { border-radius: 22px; background: var(--card); box-shadow: 0 2px 18px rgba(56, 39, 44, .035); }
.hidden { display: none !important; }
.gate { max-width: 520px; margin: 12vh auto 0; padding: 26px 23px; text-align: center; }
.gate h2, .page-heading h2 { color: var(--wine); font: 600 32px/1.12 "Vallamand Playfair", Georgia, serif; margin: 0; }
.gate p, .page-heading p { margin: 8px 0 18px; color: var(--muted); line-height: 1.45; }
.gate h2 + p { margin-top: 17px; }
#apple-sign-in-button, #apple-sign-out-button { min-height: 42px; display: flex; justify-content: center; align-items: center; }
#apple-sign-in-button button, #apple-sign-out-button button { max-width: 100%; }
.secondary-button { margin-top: 13px; padding: 11px 17px; color: var(--wine); background: #f1e7e9; border: 0; border-radius: 13px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 17px; }
.page-heading p { margin: 6px 0 0; }
.icon-button { width: 44px; height: 44px; border: 0; border-radius: 15px; background: var(--wine); color: white; font-size: 30px; line-height: 1; display: grid; place-items: center; }
.icon-button:disabled { opacity: .68; }
.icon-button.spinning span { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.calendar-card { padding: 12px 11px 14px; overflow: hidden; touch-action: pan-y; }
.month-header { height: 43px; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; margin: 0 0 10px; color: var(--wine); }
.month-header h3 { margin: 0; text-align: center; font-size: 20px; font-weight: 650; }
.month-arrow { width: 42px; height: 42px; border: 0; background: transparent; color: var(--wine); font-size: 38px; line-height: .8; font-weight: 300; }
.weekday-row, .week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.weekday-row { margin: 0 2px 7px; color: var(--muted); font-size: 12px; font-weight: 650; text-align: center; }
.month-grid { display: grid; gap: 5px; }
.week-row { position: relative; height: 78px; }
.week-days { position: absolute; inset: 0; }
.day-cell { position: relative; display: flex; align-items: flex-start; justify-content: center; padding: 7px 2px 0; height: 78px; border: 1px solid rgba(65, 51, 55, .045); border-radius: 12px; background: var(--event-tint, rgba(255,255,255,.70)); font-size: 14px; z-index: 0; }
.day-cell.outside-month { color: #b1afb0; background: rgba(246, 244, 242, .62); }
.day-cell.today { border: 1.5px solid rgba(112, 43, 61, .52); }
.day-cell:focus-visible, button:focus-visible { outline: 2px solid #b8657e; outline-offset: 2px; }
.week-bars { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.event-bar { position: absolute; top: calc(30px + var(--lane) * 15px); left: calc((100% / 7) * var(--first-column) + 2px); width: calc((100% / 7) * var(--column-count) - 4px); height: 14px; padding: 0 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border: 1px solid color-mix(in srgb, var(--bar-color), #fff 14%); border-radius: 8px; color: #291c20; background: color-mix(in srgb, var(--bar-color), #fff 72%); box-shadow: 0 1px 2px rgba(45, 30, 35, .12); font-size: 9px; font-weight: 700; line-height: 12px; }
.calendar-tools { display: flex; align-items: center; gap: 8px; margin: 14px 3px 23px; }
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, auto)); gap: 9px 14px; color: var(--muted); font-size: 12px; }
.legend span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend i, .upcoming-card > i { width: 9px; height: 9px; flex: 0 0 auto; display: inline-block; border-radius: 50%; background: var(--legend-color, var(--event-dot)); }
.today-button { width: 52px; height: 52px; flex: 0 0 auto; margin-left: auto; border: 1.5px solid rgba(112,43,61,.22); border-radius: 50%; background: white; color: var(--wine); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 0; }
.today-button span { font-size: 10px; font-weight: 750; }
.today-button strong { font-size: 17px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 10px; }
.section-heading h3 { margin: 0; font: 600 24px/1.1 "Vallamand Playfair", Georgia, serif; color: #211b1e; }
.upcoming-list { display: grid; gap: 8px; }
.upcoming-card, .empty-card { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 13px; border-radius: 17px; background: var(--card); }
.upcoming-card > i { width: 10px; height: 10px; margin: 0 3px; }
.upcoming-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.upcoming-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.upcoming-main span { color: var(--muted); font-size: 13px; }
.upcoming-card time { max-width: 42%; color: var(--muted); text-align: right; font-size: 12px; line-height: 1.25; }
.empty-card { justify-content: center; color: var(--muted); }
.updated-at { margin: 20px 0 0; text-align: center; color: #9b999a; font-size: 12px; }
.sync-status { min-height: 16px; margin: 7px 0 0; text-align: center; color: #9b999a; font-size: 11px; }
.offline-banner { position: fixed; left: 15px; right: 15px; bottom: calc(12px + var(--safe-bottom)); z-index: 5; padding: 12px 15px; border-radius: 14px; color: white; background: #3e3337; box-shadow: 0 4px 20px rgba(0,0,0,.18); text-align: center; font-size: 13px; }
.refresh-indicator { position: fixed; z-index: 10; top: calc(7px + var(--safe-top)); left: 50%; opacity: 0; transform: translate(-50%, -14px); transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
.refresh-indicator.visible { opacity: 1; transform: translate(-50%, 0); }
.refresh-indicator span { display: block; width: 24px; height: 24px; border: 2px solid #d8c6cb; border-top-color: var(--wine); border-radius: 50%; animation: spin .7s linear infinite; }
.app-shell { padding-bottom: calc(112px + var(--safe-bottom)); }
.gate-brand { display:flex; justify-content:center; align-items:center; gap:12px; margin-bottom:25px; text-align:left; }
.gate-brand h1 { margin:0; color:var(--wine); font:600 22px/1.1 "Vallamand Playfair",Georgia,serif; }
.gate-brand p { margin:3px 0 0; font-size:14px; }
.brand-header { margin:3px 0 19px; }
.greeting-banner { margin-bottom:14px; padding:19px 18px; border-radius:20px; color:#fff; background:linear-gradient(125deg,#9d2348,#4c1027); box-shadow:0 7px 20px rgba(83,22,43,.12); }
.greeting-banner h2 { margin:0 0 7px; font:600 25px/1.15 "Vallamand Playfair",Georgia,serif; }
.greeting-banner p { margin:0; color:rgba(255,255,255,.92); font-size:15px; line-height:1.4; }
.weather-card { display:flex; align-items:center; gap:12px; padding:14px 16px; margin-bottom:13px; }
.weather-icon { color:var(--wine); font-size:27px; }
.weather-card div { display:flex; flex:1; min-width:0; flex-direction:column; gap:3px; }
.weather-card strong { font-size:14px; }
.weather-card span:not(.weather-icon) { color:var(--muted); font-size:12px; }
.weather-card b { color:var(--wine); font-size:23px; }
.metric-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:0 0 22px; }
.metric-card { min-width:0; min-height:98px; display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:7px; padding:14px; border:0; border-radius:18px; background:var(--card); box-shadow:0 2px 18px rgba(56,39,44,.035); text-align:left; }
.metric-card span { color:var(--muted); font-size:12px; }
.metric-card strong { color:var(--wine); font-size:21px; font-weight:750; overflow-wrap:anywhere; }
.metric-card small { color:var(--muted); font-size:11px; line-height:1.3; }
.metric-card.wide { margin-bottom:17px; }
.text-button { border:0; background:transparent; color:var(--wine); font-weight:650; }
.upcoming-card { width:100%; border:0; color:inherit; text-align:left; }
.app-nav { position:fixed; z-index:8; left:50%; bottom:calc(9px + var(--safe-bottom)); transform:translateX(-50%); width:min(680px,calc(100% - 28px)); min-height:70px; padding:7px 9px; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); align-items:center; gap:4px; border:1px solid rgba(255,255,255,.28); border-radius:28px; background:rgba(38,35,36,.72); box-shadow:0 12px 34px rgba(17,13,15,.20),inset 0 1px 0 rgba(255,255,255,.2); backdrop-filter:blur(26px) saturate(1.7); -webkit-backdrop-filter:blur(26px) saturate(1.7); }
.tab-button { min-width:0; height:54px; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:3px; border:0; border-radius:21px; color:rgba(255,255,255,.86); background:transparent; }
.tab-button > span { font-size:23px; font-weight:650; line-height:1; }
.tab-button small { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:9px; }
.tab-button.selected { background:rgba(255,255,255,.23); color:#fff; }
.tab-button.selected > span { color:#fff; }
.list-title { margin:8px 3px 10px; font-size:15px; }
.booking-list,.simple-list { display:grid; gap:10px; }
.booking-card { width:100%; display:flex; flex-direction:column; gap:10px; padding:15px; border:0; color:inherit; text-align:left; }
.booking-top,.booking-bottom { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.booking-top > div,.simple-card > span { display:flex; flex-direction:column; gap:4px; }
.booking-top strong,.contact-card strong,.simple-card strong { font-size:17px; }
.booking-top span:not(.status-pill),.booking-info,.dog-line,.simple-card small,.contact-card span,.contact-card small { color:var(--muted); font-size:13px; }
.booking-bottom { align-items:center; border-top:1px solid var(--line); padding-top:9px; }
.booking-bottom small { color:var(--muted); }
.booking-bottom b,.simple-card b { color:var(--wine); font-size:17px; }
.status-pill { flex:0 0 auto; padding:5px 9px; border-radius:999px; color:var(--pill); background:color-mix(in srgb,var(--pill),transparent 88%); font-size:11px; font-weight:700; }
.history-button { width:100%; display:flex; justify-content:space-between; margin:17px 0 9px; padding:14px; border:0; border-radius:15px; background:var(--card); color:inherit; font-weight:650; text-align:left; }
.simple-card { width:100%; min-height:70px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px; border:0; color:inherit; text-align:left; }
.contact-card { width:100%; display:flex; flex-direction:column; align-items:flex-start; gap:5px; padding:15px; border:0; color:inherit; text-align:left; }
.calendar-card { margin-top:3px; }
.month-header > button { width:44px; height:44px; border:0; background:transparent; color:var(--wine); font-size:37px; line-height:1; }
.event-bar { z-index:2; border:1px solid color-mix(in srgb,var(--bar-color),#fff 14%); cursor:pointer; pointer-events:auto; }
.booking-bar { cursor:pointer; }
.calendar-tools { align-items:flex-start; }
.legend { flex:1; }
.section-heading { margin-top:8px; }
.icon-button.small { width:47px; height:43px; font-size:30px; }
.detail-title { margin:0 0 16px; color:var(--wine); font:600 29px/1.12 "Vallamand Playfair",Georgia,serif; overflow-wrap:anywhere; }
.back-button { margin:0 0 12px; padding:6px 0; border:0; background:transparent; color:var(--wine); font-size:28px; line-height:1; }
.back-button span { font:500 14px/1 -apple-system,BlinkMacSystemFont,sans-serif; vertical-align:middle; }
.detail-grid { display:grid; gap:12px; }
.info-card { padding:16px; }
.info-card h3 { margin:0 0 12px; font-size:16px; }
.info-row { display:flex; align-items:flex-start; justify-content:space-between; gap:15px; padding:8px 0; border-top:1px solid var(--line); font-size:13px; }
.info-row span { flex:0 0 42%; color:var(--muted); }
.info-row strong,.info-row a { max-width:58%; color:inherit; text-align:right; overflow-wrap:anywhere; }
.info-row a { color:var(--wine); }
.detail-lead { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; color:var(--muted); font-size:13px; }
.muted { color:var(--muted); font-size:13px; }
.event-dialog { width:min(510px,calc(100% - 28px)); max-height:min(88vh,760px); padding:0; border:1px solid var(--line); border-radius:23px; color:inherit; background:var(--cream); box-shadow:0 24px 70px rgba(0,0,0,.28); }
.event-dialog::backdrop { background:rgba(20,16,18,.48); backdrop-filter:blur(5px); }
.event-dialog form { display:grid; gap:14px; padding:20px; }
.dialog-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.dialog-heading h2 { margin:0; color:var(--wine); font:600 23px/1.15 "Vallamand Playfair",Georgia,serif; }
.close-button { width:36px; height:36px; border:0; border-radius:50%; color:var(--wine); background:var(--card); font-size:26px; }
.event-dialog label { display:flex; flex-direction:column; gap:6px; color:var(--muted); font-size:13px; font-weight:600; }
.event-dialog input,.event-dialog select,.event-dialog textarea { width:100%; min-height:43px; padding:10px 12px; border:1px solid var(--line); border-radius:12px; color:inherit; background:var(--card); font:inherit; font-weight:450; }
.event-dialog textarea { resize:vertical; }
.date-fields { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.dialog-actions { display:flex; justify-content:flex-end; align-items:center; gap:10px; margin-top:3px; }
.primary-button,.delete-button { min-height:42px; padding:0 18px; border:0; border-radius:13px; font-weight:650; }
.primary-button { color:white; background:var(--wine); }
.delete-button { margin-right:auto; color:#a32d42; background:rgba(237,64,75,.1); }
@media (min-width: 760px) {
  .app-shell { padding: calc(26px + var(--safe-top)) 28px calc(40px + var(--safe-bottom)); }
  .brand-header { margin-bottom: 32px; }
  .page-heading h2 { font-size: 38px; }
  .calendar-card { padding: 18px 18px 20px; }
  .week-row, .day-cell { height: 100px; }
  .day-cell { padding: 10px 8px; justify-content: flex-start; font-size: 16px; }
  .event-bar { top: calc(40px + var(--lane) * 18px); height: 16px; line-height: 14px; font-size: 10px; }
  .weekday-row { font-size: 14px; margin-bottom: 10px; }
  .month-grid { gap: 7px; }
  .legend { grid-template-columns: repeat(3, minmax(0, auto)); font-size: 13px; }
  .upcoming-card { padding: 15px 18px; }
  .upcoming-card time { font-size: 14px; }
  .metric-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
  .greeting-banner { padding:23px 25px; }
  .greeting-banner h2 { font-size:30px; }
  .greeting-banner p { font-size:17px; }
  .detail-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --cream: #211f21; --wine: #d7829a; --muted: #aaa7aa; --card: rgba(51, 47, 50, .96); --line: rgba(215,130,154,.16); }
  body, html { background: var(--cream); color: #f3eff0; }
  .brand-header h1, .gate h2, .page-heading h2, .month-header, .month-arrow, .today-button, .section-heading h3 { color: var(--wine); }
  .calendar-card, .upcoming-card, .empty-card, .gate { background: var(--card); }
  .day-cell { color: #f3eff0; border-color: rgba(255,255,255,.07); background: var(--event-tint, rgba(255,255,255,.035)); }
  .day-cell.outside-month { color: #7b777a; background: rgba(0,0,0,.12); }
  .today-button { background: #322d30; border-color: rgba(215,130,154,.28); }
  .event-bar { color: #211b1e; }
  .app-nav { background:rgba(32,29,31,.74); border-color:rgba(255,255,255,.16); }
  .event-dialog { background:#292528; }
  .event-dialog input,.event-dialog select,.event-dialog textarea { background:rgba(255,255,255,.06); }
  .history-button,.metric-card { color:#f3eff0; }
}
@media (max-width:420px) {
  .app-shell { padding-left:13px; padding-right:13px; }
  .app-nav { width:calc(100% - 20px); min-height:64px; bottom:calc(6px + var(--safe-bottom)); border-radius:24px; }
  .tab-button { height:50px; }
  .tab-button small { font-size:8px; }
  .calendar-card { padding-left:7px; padding-right:7px; }
  .week-row,.day-cell { height:65px; }
  .day-cell { padding-top:5px; font-size:12px; }
  .event-bar { top:calc(27px + var(--lane) * 13px); height:12px; padding:0 3px; font-size:7px; line-height:10px; }
  .month-header h3 { font-size:18px; }
  .today-button { width:47px; height:47px; }
  .legend { gap:8px 9px; font-size:10px; }
  .metric-card { padding:11px; }
  .metric-card strong { font-size:18px; }
  .booking-card { padding:13px; }
}
