/* Taylor Financial brand: maroon + gold on white, Lato, light headings */
:root {
  --maroon: #73253c;
  --maroon-dark: #51031a;
  --maroon-tint: #f6ecef;
  --maroon-tint-2: #ead5db;
  --gold: #b3995d;
  --gold-tint: #faf5e8;
  --text: #444;
  --muted: #636363;
  --faint: #6e6e6e;
  --line: #e6e6e6;
  --bg: #fff;
  --bg-alt: #f8f8f8;
  --ok: #3d7a4f;
  --danger: #a3262c;
  --radius: 4px;
  --hour: 64px;
}

* { box-sizing: border-box; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 200; background: var(--maroon); color: #fff; padding: 10px 16px; border-radius: var(--radius); }
.skip:focus { top: 8px; }
main:focus { outline: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) { .blk, .btn, .seg button[aria-pressed="true"] { border: 1px solid CanvasText; } }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: Lato, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.5;
  color: var(--text); background: var(--bg);
}
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
main.wrap { flex: 1; padding-top: 28px; padding-bottom: 56px; }
a { color: var(--maroon); }
h1, h2, h3 { color: var(--maroon); margin: 0; }
h2 { font-weight: 300; font-size: 28px; }
h3 { font-weight: 700; font-size: 18px; }
.muted { color: var(--muted); }
.pad { padding: 40px 0; }
.small { font-size: 13px; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 28px; height: 78px; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { display: block; height: 52px; width: auto; }
.wordmark { font-weight: 700; letter-spacing: 3px; color: var(--maroon); font-size: 20px; line-height: 1; }
.wordmark small { display: block; font-size: 10px; letter-spacing: 5px; font-weight: 400; margin-top: 4px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14px; padding: 8px 12px; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a:hover { color: var(--maroon); }
.nav a.active { color: var(--maroon); border-bottom-color: var(--maroon); }
.nav .count { background: var(--maroon); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; margin-left: 4px; }
.user-chip { background: none; border: 0; text-align: right; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; line-height: 1.3; padding: 6px 0; }
.user-chip span { display: block; color: var(--faint); font-size: 12px; }

#signout[hidden] { display: none; }
#signout { white-space: nowrap; }
.page-band { background: var(--bg-alt); border-bottom: 1px solid var(--line); padding: 26px 0 22px; }
.page-band h1 { font-weight: 300; font-size: 34px; letter-spacing: .5px; }
.page-band p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

.site-footer { background: var(--maroon); color: #fff; font-size: 12px; padding: 18px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-footer a { color: #fff; }

/* Buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; text-decoration: none;
  padding: 12px 24px 11px; border-radius: var(--radius); border: 2px solid var(--maroon);
  background: var(--maroon); color: #fff; cursor: pointer; transition: background .15s, color .15s;
}
.btn:hover { background: var(--maroon-dark); border-color: var(--maroon-dark); }
.btn.ghost { background: transparent; color: var(--maroon); }
.btn.ghost:hover { background: var(--maroon); color: #fff; }
.btn.quiet { background: transparent; color: var(--muted); border-color: var(--line); }
.btn.quiet:hover { color: var(--maroon); border-color: var(--maroon); background: transparent; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.sm { padding: 6px 12px 5px; font-size: 11px; border-width: 1px; }
.btn:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid #1a5fb4; outline-offset: 2px; }
.site-footer :focus-visible, .dlg-head :focus-visible, .blk.mine:focus-visible { outline-color: #fff; }

label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--text); background: #fff;
  border: 1px solid #d4d4d4; border-radius: var(--radius); padding: 9px 10px;
}
input:focus, select:focus, textarea:focus { border-color: var(--maroon); outline: 2px solid var(--maroon); outline-offset: 1px; }
::placeholder { color: #767676; opacity: 1; }
input[type=checkbox] { width: auto; margin-right: 8px; accent-color: var(--maroon); }
textarea { min-height: 70px; resize: vertical; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--faint); margin-top: 3px; }
.check { display: flex; align-items: center; text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--text); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }

/* Schedule */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar .date-label { font-size: 22px; font-weight: 300; color: var(--maroon); margin: 0 8px; flex: 1; min-width: 200px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { font: inherit; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; padding: 0 14px; height: 38px; border: 0; background: #fff; color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--maroon); color: #fff; }
.room-pick { margin-bottom: 18px; }
.week-block + .week-block { margin-top: 28px; }
.week-room { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.week-room h2 { font-size: 24px; }
.week-room .chips { margin-top: 0; }
.sched-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 12px; }
.sched.week { min-width: 680px; column-gap: 8px; }
.day-head { padding: 10px 12px; }
.room-head.day-head h3 { font-size: 16px; font-weight: 700; }
.room-head.day-head h3 span { font-weight: 300; white-space: nowrap; }
.day-head a { text-decoration: none; }
.sched:not(.week) { max-width: calc(58px + var(--rooms) * 560px); }
.day-head a:hover { text-decoration: underline; }
.day-head.today { border-top-color: var(--gold); background: var(--gold-tint); }
.sched.week .blk { padding: 3px 6px; font-size: 11px; }
.sched.week .blk b { font-size: 12px; white-space: normal; }
.month { display: grid; grid-template-columns: repeat(var(--days), minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.m-head { padding: 8px 10px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); background: var(--bg-alt); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.m-cell { display: block; min-height: 116px; padding: 6px 8px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); position: relative; }
.m-cell:hover { background: var(--maroon-tint); }
.m-cell:focus-visible { outline-offset: -3px; }
.m-cell.other { background: var(--bg-alt); }
.m-cell.other .m-date { color: var(--faint); }
.m-cell.past .m-items { opacity: .65; }
.m-cell.today { box-shadow: inset 0 3px 0 var(--gold); }
.m-cell.today .m-date { background: var(--maroon); color: #fff; }
.m-cell.shut { background: repeating-linear-gradient(135deg, rgba(0,0,0,.03) 0 6px, transparent 6px 12px); }
.m-date { display: inline-block; min-width: 26px; text-align: center; font-weight: 700; color: var(--maroon); border-radius: 13px; padding: 1px 6px; font-size: 14px; }
.m-closed { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.m-count { display: none; }
.m-items { display: block; margin-top: 4px; }
.m-item, .m-more { display: block; font-size: 11.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.m-item.mine { font-weight: 700; color: var(--maroon-dark); }
.m-item.pending { font-style: italic; }
.m-more { color: var(--muted); }
i.room-0, i.room-1 { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: var(--maroon); }
i.room-1 { background: var(--gold); }
.legend i.room-0, .legend i.room-1 { width: 10px; height: 10px; border-radius: 50%; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rows { list-style: none; margin: 0; padding: 0; }
.results-title { margin: 6px 0 10px; color: var(--maroon); font-size: 15px; }
.free-day { padding: 10px 0; border-top: 1px solid var(--line); }
.free-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.free-list .btn { flex-direction: column; gap: 0; text-transform: none; letter-spacing: 0; font-size: 13px; padding: 7px 12px; }
.free-list .btn span { font-size: 11px; opacity: .8; }
.policy { max-width: 760px; }
.policy h2 { font-size: 22px; margin: 26px 0 8px; }
.policy li { margin-bottom: 6px; }
.check span a { text-decoration: underline; }
.toolbar input[type=date] { width: auto; }
.icon-btn { width: 38px; height: 38px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); cursor: pointer; color: var(--maroon); font-size: 18px; line-height: 1; }
.icon-btn:hover { border-color: var(--maroon); }
.notice { background: var(--gold-tint); border-left: 3px solid var(--gold); padding: 10px 14px; font-size: 14px; margin-bottom: 16px; }

.sched { display: grid; grid-template-columns: 58px repeat(var(--rooms), minmax(0, 1fr)); column-gap: 14px; }
.room-head { border-top: 3px solid var(--maroon); background: var(--bg-alt); padding: 14px 16px 12px; margin-bottom: 10px; }
.room-head h2 { font-size: 24px; }
.room-head .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.chip { font-size: 11px; letter-spacing: .5px; text-transform: uppercase; border: 1px solid var(--maroon-tint-2); color: var(--maroon); background: #fff; border-radius: 20px; padding: 2px 9px; }
.axis { position: relative; }
.axis span { position: absolute; right: 4px; transform: translateY(-50%); font-size: 11px; color: var(--faint); white-space: nowrap; }
.col {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius); cursor: crosshair; touch-action: pan-y; user-select: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(#f3f3f3 1px, transparent 1px);
  background-size: 100% var(--hour), 100% calc(var(--hour) / 2);
  background-position: 0 -1px;
}
.past { position: absolute; left: 0; right: 0; top: 0; background: repeating-linear-gradient(135deg, rgba(0,0,0,.035) 0 6px, transparent 6px 12px); pointer-events: none; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--gold); pointer-events: none; z-index: 3; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.closed { position: absolute; inset: 0; background: rgba(248,248,248,.9); display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); z-index: 4; cursor: not-allowed; padding: 20px; }
button.blk { font-family: inherit; text-align: left; border-top: 0; border-right: 0; border-bottom: 0; width: auto; display: block; }
.blk {
  position: absolute; left: 5px; right: 5px; border-radius: 3px; padding: 4px 8px; overflow: hidden; z-index: 2;
  font-size: 12px; line-height: 1.3; cursor: pointer; border-left: 3px solid var(--maroon);
  background: var(--maroon-tint); color: var(--maroon-dark);
}
.blk b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk.mine { background: var(--maroon); color: #fff; border-left-color: var(--gold); }
.blk.pending { background: var(--gold-tint); border: 1px dashed var(--gold); border-left: 3px solid var(--gold); color: #6b5a2c; }
.blk.ext { background: repeating-linear-gradient(135deg, #eee 0 6px, #f6f6f6 6px 12px); border-left-color: var(--faint); color: #4a4a4a; cursor: default; }
.blk.ghost { background: rgba(115,37,60,.18); border: 1px dashed var(--maroon); pointer-events: none; color: var(--maroon-dark); font-weight: 700; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 16px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* Lists, tables, cards */
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; background: #fff; }
.card.accent { border-top: 3px solid var(--maroon); }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.row .when { width: 210px; font-size: 14px; }
.row .when b { display: block; color: var(--maroon); font-size: 15px; }
.row .what { flex: 1; min-width: 180px; }
.row .what b { display: block; }
.row .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-block; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; padding: 2px 8px; border-radius: 20px; background: var(--bg-alt); color: var(--muted); border: 1px solid var(--line); vertical-align: 2px; }
.badge.released { color: var(--danger); border-color: #ecc8ca; background: #fdf3f3; }
.badge.confirmed, .badge.checked { color: #2f6b41; border-color: #c5dccb; background: #f1f8f3; }
.badge.pending { color: #6f591f; border-color: #e6d9b3; background: var(--gold-tint); }
.badge.cancelled, .badge.declined, .badge.error { color: var(--danger); border-color: #ecc8ca; background: #fdf3f3; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 8px; flex-wrap: wrap; }
.section-head:first-child { margin-top: 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--maroon); border-bottom-color: var(--maroon); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); font-weight: 400; padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.actions { white-space: nowrap; text-align: right; }
.empty { text-align: center; color: var(--faint); padding: 36px 0; }
.status-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #ccc; flex: none; }
.dot.on { background: var(--ok); }

/* Dialog, toasts, dev bar */
dialog { border: 0; border-radius: 6px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); color: var(--text); }
dialog::backdrop { background: rgba(60, 10, 25, .45); }
.dlg-head { background: var(--maroon); color: #fff; padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; }
.dlg-head h3 { color: #fff; font-weight: 300; font-size: 22px; }
.dlg-head button { background: none; border: 0; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.dlg-body { padding: 22px 24px 6px; max-height: calc(100vh - 220px); overflow-y: auto; }
.dlg-foot { padding: 14px 24px 22px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.dlg-foot .spacer { flex: 1; }
.dlg-error { color: var(--danger); font-size: 14px; margin: 0 0 12px; }
.detail dt { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); }
.detail dd { margin: 0 0 12px; }
#toasts { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: calc(100vw - 48px); }
.toast { background: var(--maroon-dark); color: #fff; padding: 12px 18px; border-radius: var(--radius); font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); border-left: 3px solid var(--gold); }
.toast.err { background: var(--danger); }
#devbar[hidden] { display: none; }
#devbar { position: fixed; left: 12px; bottom: 12px; z-index: 90; background: #222; color: #ddd; font-size: 12px; padding: 6px 8px; border-radius: 6px; display: flex; gap: 6px; align-items: center; }
#devbar select { width: auto; font-size: 12px; padding: 3px 6px; }

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  main.wrap { padding-top: 20px; padding-bottom: 40px; }
  .header-inner { height: auto; flex-wrap: wrap; gap: 0 12px; padding-top: 8px; }
  .brand img { height: 38px; }
  .user-chip { margin-left: auto; }
  #signout { padding: 8px 10px 7px; font-size: 11px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .nav a { padding: 10px 12px; }
  .page-band { padding: 14px 0 12px; }
  .page-band h1 { font-size: 24px; }
  .page-band p { font-size: 13px; }
  h2 { font-size: 22px; }

  /* 16px inputs stop iOS from zooming the page on focus; larger tap targets */
  input, select, textarea { font-size: 16px; padding: 11px 10px; }
  .btn { padding: 13px 18px 12px; }
  .btn.sm { padding: 10px 14px 9px; font-size: 12px; }
  .icon-btn { width: 44px; height: 44px; }

  .toolbar { gap: 8px; }
  .toolbar .date-label { flex-basis: 100%; order: -1; margin: 0; font-size: 20px; }
  .toolbar #today { height: 44px; }
  .toolbar input[type=date] { flex: 1 1 100%; min-width: 0; }
  .toolbar .seg { margin-left: auto; }
  .toolbar #book, .toolbar #find { flex: 1 1 40%; }
  .seg button { height: 44px; }
  .m-cell { min-height: 62px; padding: 4px; text-align: center; }
  .m-items, .m-closed { display: none; }
  .m-count { display: inline-block; margin-top: 4px; min-width: 22px; padding: 1px 6px; border-radius: 11px; background: var(--maroon-tint-2); color: var(--maroon-dark); font-size: 12px; font-weight: 700; }
  .m-cell { display: flex; flex-direction: column; align-items: center; }
  .m-head { padding: 6px 2px; text-align: center; font-size: 10px; }
  .seg button { padding: 0 10px; }
  .room-pick .seg { display: flex; }
  .room-pick .seg button { flex: 1; font-size: 12px; letter-spacing: .5px; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }

  .sched { grid-template-columns: 34px repeat(var(--rooms), minmax(0, 1fr)); column-gap: 6px; }
  .room-head { padding: 10px; }
  .room-head h2 { font-size: 18px; }
  .room-head .meta { font-size: 12px; }
  .chip { font-size: 10px; padding: 1px 7px; }
  .axis span { font-size: 10px; right: 2px; }
  .col { cursor: pointer; }
  .blk { left: 3px; right: 3px; padding: 3px 6px; font-size: 11px; }
  .blk b { font-size: 12px; white-space: normal; }
  .legend { gap: 8px 14px; }

  .grid-3 { grid-template-columns: 1fr 1fr; }
  .card { padding: 16px; }
  .card .grid-2, .card .grid-3 { grid-template-columns: 1fr; }
  .row { gap: 8px; }
  .row .when { width: 100%; }
  .row .actions { width: 100%; }
  .section-head .btn { flex: 1; }

  /* tables become stacked cards */
  .table-wrap { overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  td { border: 0; padding: 2px 0; }
  td:empty { display: none; }
  td.actions { text-align: left; white-space: normal; padding-top: 8px; }

  dialog { width: calc(100vw - 20px); max-width: none; max-height: calc(100dvh - 20px); }
  .dlg-head { padding: 14px 18px; }
  .dlg-head h3 { font-size: 20px; }
  .dlg-head button { padding: 4px 8px; }
  .dlg-body { padding: 18px 18px 4px; max-height: calc(100dvh - 190px); }
  .dlg-foot { padding: 12px 18px 18px; }
  .dlg-foot .spacer { display: none; }
  .dlg-foot .btn { flex: 1 1 40%; }
  #toasts { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .footer-inner { flex-direction: column; gap: 4px; }
}

@media (max-width: 380px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .dlg-body .grid-2, .dlg-body .grid-3 { grid-template-columns: 1fr 1fr; }
}
