/* Layout concept: a warm daybook. Cream pages, serif headings, terracotta for anything booked with you. Matches Wisdom Woven. */
:root {
  --bg: #fbf5ed; --paper: #fffaf5; --ink: #3f302b; --head: #49342c; --muted: #726158; --rule: #e2cfc0;
  --accent: #964d3f; --accent-ink: #fffaf5;
  --booking: #964d3f; --booking-bg: #f1d5c9; --booking-ink: #5e2b22;
  --event: #c28b73; --event-bg: #f6e8dc; --event-ink: #6b4636;
  --task: #5d7254; --task-bg: #e8eddf; --task-ink: #3f5039;
  --block: #eee6d9; --block-ink: #8a7568; --band: #e8eddf88;
  --warn: #8a5a1a; --warn-bg: #f7e7c8; --bad: #9c3434; --bad-bg: #f6dcd8;
  --display: Georgia, 'Times New Roman', serif;
  --body: Arial, Helvetica, sans-serif;
  --mono: Arial, Helvetica, sans-serif;
  --radius: .75rem;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #1f1714; --paper: #2a201c; --ink: #f3e8dc; --head: #f8ede2; --muted: #bba597; --rule: #4a3a33;
  --accent: #d98b78; --accent-ink: #2a1712;
  --booking: #d98b78; --booking-bg: #4a2a22; --booking-ink: #f6d6cc;
  --event: #c9a084; --event-bg: #3d2e25; --event-ink: #f0dccb;
  --task: #a9bd9a; --task-bg: #2c3528; --task-ink: #dde8d3;
  --block: #3a2e29; --block-ink: #b5a092; --band: #a9bd9a14;
  --warn: #e8c27a; --warn-bg: #3d2f14; --bad: #f0a59a; --bad-bg: #4a2220; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #1f1714; --paper: #2a201c; --ink: #f3e8dc; --head: #f8ede2; --muted: #bba597; --rule: #4a3a33;
  --accent: #d98b78; --accent-ink: #2a1712;
  --booking: #d98b78; --booking-bg: #4a2a22; --booking-ink: #f6d6cc;
  --event: #c9a084; --event-bg: #3d2e25; --event-ink: #f0dccb;
  --task: #a9bd9a; --task-bg: #2c3528; --task-ink: #dde8d3;
  --block: #3a2e29; --block-ink: #b5a092; --band: #a9bd9a14;
  --warn: #e8c27a; --warn-bg: #3d2f14; --bad: #f0a59a; --bad-bg: #4a2220; color-scheme: dark }
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--body); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; color: var(--head); margin: 0; line-height: 1.15; text-wrap: balance; letter-spacing: -.02em; }
h1 em, h2 em { font-style: italic; color: var(--accent); }
h1 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; } .wrap { overflow-wrap: anywhere; }
.muted { color: var(--muted); } .small { font-size: .84rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .row.tight { gap: 6px; } .row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 6px; } .stack > .row, .stack > .btn { margin-top: 10px; }
.stack label:not(.check) { font-weight: 600; font-size: .88rem; margin-top: 8px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .two label { display: block; margin-bottom: 6px; } .two > div { min-width: 0; }
input:not([type=checkbox]), select, textarea { width: 100%; min-height: 42px; padding: 8px 10px; background: var(--paper); border: 1px solid var(--rule); border-radius: .5rem; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; margin: 0; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 7px 15px; border: 1px solid var(--rule); border-radius: .5rem; background: var(--paper); font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--accent); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } .btn.primary:hover { filter: brightness(1.08); }
.btn.big { min-height: 48px; width: 100%; }
.btn.danger-quiet { color: var(--bad); margin-right: auto; }
.link { background: none; border: 0; padding: 4px 0; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.mark { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border: 1px solid var(--rule); border-radius: 50%; overflow: hidden; background: var(--paper); }
.mark::before { content: 'D'; grid-area: 1 / 1; font: italic 1.25rem var(--display); color: var(--accent); }
.mark img { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: contain; opacity: 0; }
.mark.has-logo img { opacity: 1; } .mark.has-logo::before { content: none; }
.brand, .bk-brand { display: flex; align-items: center; gap: 11px; }
.word { display: flex; flex-direction: column; line-height: 1.15; }
.word b { font: 700 .9rem var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--head); }
.word small { font: 700 .6rem var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin-top: 3px; }
.alert { padding: 9px 12px; background: var(--warn-bg); color: var(--warn); border-radius: 6px; font-size: .9rem; }
.empty { padding: 18px; border: 1px dashed var(--rule); border-radius: 8px; color: var(--muted); }
.toast { position: fixed; z-index: 50; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--head); color: var(--bg); padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: .9rem; max-width: calc(100vw - 32px); }

/* App shell */
.app { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.demo-bar { background: var(--warn-bg); color: var(--warn); text-align: center; font-size: .82rem; padding: 4px 16px; font-weight: 600; }
.top { display: flex; align-items: center; gap: 22px; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); background: var(--paper); border-bottom: 1px solid var(--rule); }
.tabs { display: flex; gap: 4px; flex: 1; }
.tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; font-weight: 600; color: var(--muted); cursor: pointer; display: flex; gap: 6px; align-items: center; }
.tabs button:hover { color: var(--ink); } .tabs button.on { background: var(--accent); color: var(--accent-ink); } .tabs button.on .dot { background: var(--accent-ink); }
.dot { font-style: normal; font-size: .72rem; min-width: 18px; height: 18px; border-radius: 9px; background: var(--paper); color: var(--accent); display: inline-grid; place-items: center; padding: 0 4px; }
.view { flex: 1; min-height: 0; overflow: auto; padding: 18px 16px 28px; }
.view > * { max-width: 1160px; margin-inline: auto; }
.view-tasks > *, .view-links > *, .view-hours > * { max-width: 860px; }
.view > h2 { margin-top: 26px; margin-bottom: 10px; }
.page-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; } .page-head.split { flex-direction: row; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head.split > div { min-width: 0; flex: 1 1 260px; }

/* Calendar */
.view-calendar { display: flex; flex-direction: column; padding-bottom: 12px; overflow: hidden; }
.view-calendar > * { width: 100%; }
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin: 8px auto 10px; }
.k::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 2px; background: var(--c); }
.k.booking { --c: var(--booking); } .k.event { --c: var(--event); } .k.task { --c: var(--task); } .k.block { --c: var(--block-ink); }
.phone-strip { display: none; }
.cal { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.cal-head { display: grid; grid-template-columns: 62px repeat(var(--n), minmax(0, 1fr)); border-bottom: 1px solid var(--rule); font-size: .82rem; color: var(--muted); }
.cal-head > div { padding: 7px 8px; border-left: 1px solid var(--rule); } .cal-head b { font: 1.05rem var(--display); color: var(--head); }
.cal-head .today { background: var(--accent); color: var(--accent-ink); } .cal-head .today b { color: inherit; }
.cal-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.cal-body { position: relative; display: grid; grid-template-columns: 62px repeat(var(--n), minmax(0, 1fr)); background-image: repeating-linear-gradient(to bottom, var(--rule) 0 1px, transparent 1px 46px); }
.gutter { position: relative; } .gutter span { position: absolute; right: 7px; transform: translateY(-50%); font: 400 .68rem var(--mono); color: var(--muted); white-space: nowrap; }
.col { position: relative; border-left: 1px solid var(--rule); cursor: copy; min-width: 0; }
.band { position: absolute; inset-inline: 0; background: var(--band); }
.item { position: absolute; display: flex; flex-direction: column; align-items: flex-start; overflow: hidden; padding: 2px 6px; border: 0; border-left: 3px solid var(--c); border-radius: 4px; background: var(--b); color: var(--i); text-align: left; cursor: pointer; font-size: .76rem; line-height: 1.2; }
.item b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; } .item span { font-size: .66rem; opacity: .85; white-space: nowrap; }
.item.short { flex-direction: row; align-items: center; gap: 6px; padding-block: 0; }
.item.short b { flex: 0 1 auto; min-width: 0; } .item.short span { flex: none; order: -1; }
.item.booking { --c: var(--booking); --b: var(--booking-bg); --i: var(--booking-ink); }
.item.event { --c: var(--event); --b: var(--event-bg); --i: var(--event-ink); }
.item.task { --c: var(--task); --b: var(--task-bg); --i: var(--task-ink); }
.item.block { --c: var(--block-ink); --b: repeating-linear-gradient(135deg, var(--block) 0 6px, transparent 6px 11px); --i: var(--block-ink); background: var(--b); }
.now-line { position: absolute; inset-inline: 0; height: 2px; background: var(--accent); z-index: 3; pointer-events: none; }

/* Lists */
.quick { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.quick-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; align-items: end; } .quick-opts label { font-size: .8rem; font-weight: 600; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.list { list-style: none; margin: 0 auto; padding: 0; border-top: 1px solid var(--rule); }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.list-main { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; background: none; border: 0; text-align: left; padding: 0; cursor: pointer; } span.list-main { cursor: default; }
.status { font: 400 .8rem var(--mono); color: var(--muted); } .status.warn { color: var(--warn); } .status.bad { color: var(--bad); }
.meta { display: flex; gap: 10px; align-items: center; font-size: .76rem; color: var(--muted); } .meta i { font-style: normal; }
.pri.p1 { color: var(--bad); font-weight: 500; }
.faded { opacity: .7; }
.link-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.link-card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; } .link-card.off { opacity: .7; }
.url { background: var(--bg); padding: 6px 9px; border-radius: 5px; font-size: .8rem; }
.hours-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 28px; }
.hours-grid section { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hours { display: flex; flex-direction: column; margin-bottom: 10px; }
.hour-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.hour-times { display: flex; align-items: center; gap: 6px; } .hour-times input { width: 118px; min-height: 36px; padding: 4px 6px; }
.add-block { margin-top: 12px; } .list.tight li { padding: 6px 2px; } .list.tight .btn { margin-right: 0; min-height: 34px; }
fieldset { border: 0; padding: 0; margin: 10px 0 0; min-width: 0; } legend { font-weight: 600; font-size: .88rem; padding: 0; }

/* Dialog */
.dlg { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); color: var(--ink); padding: 20px; width: min(500px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.dlg::backdrop { background: #2a1d1899; } .dlg > .row { margin-top: 14px; } .dlg > p { margin-top: 8px; }
.note-quote { font-family: var(--display); font-style: italic; border-left: 3px solid var(--booking); padding-left: 10px; white-space: pre-wrap; }

/* Public booking page */
.bk { min-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 28px 16px; }
.bk-brand, .bk-card { width: min(560px, 100%); }
.bk-card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: clamp(18px, 4vw, 30px); display: flex; flex-direction: column; gap: 10px; }
.bk-card h2 { margin-top: 12px; }
.bk-when { font: 1.2rem/1.5 var(--display); color: var(--head); }
.eyebrow { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--accent); } .eyebrow.ok { color: var(--task); }
.back { align-self: flex-start; }
.day-picks { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; }
.day-pick { flex: none; width: 66px; padding: 7px 0; display: flex; flex-direction: column; align-items: center; background: none; border: 1px solid var(--rule); border-radius: 7px; cursor: pointer; font-size: .76rem; color: var(--muted); }
.day-pick b { font: 1.35rem var(--display); color: var(--head); } .day-pick.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } .day-pick.on b { color: inherit; }
.time-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.time-pick { min-height: 44px; background: none; border: 1px solid var(--accent); border-radius: 6px; color: var(--accent); cursor: pointer; font-weight: 500; }
.time-pick:hover { background: var(--accent); color: var(--accent-ink); }
.preview-sheet { position: fixed; inset: 0; z-index: 30; background: var(--bg); overflow: auto; }
.preview-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; background: var(--warn-bg); color: var(--warn); font-weight: 600; font-size: .86rem; }

@media (max-width: 760px) {
  .app { padding-bottom: 0; }
  .top { padding-top: 8px; padding-bottom: 8px; justify-content: space-between; }
  .tabs { position: fixed; z-index: 20; bottom: 0; left: 0; right: 0; background: var(--paper); border-top: 1px solid var(--rule); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); justify-content: space-between; }
  .tabs button { flex: 1; justify-content: center; font-size: .76rem; padding: 9px 2px; }
  .view { padding-bottom: 88px; } .view-calendar { padding-bottom: 72px; padding-top: 12px; }
  .legend { display: none; }
  .phone-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 10px auto; }
  .phone-strip button { border: 1px solid var(--rule); background: var(--paper); border-radius: 6px; font-size: .68rem; color: var(--muted); padding: 3px 0; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
  .phone-strip b { font: 1.05rem var(--display); color: var(--head); } .phone-strip .on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } .phone-strip .on b { color: inherit; }
  .cal-head { display: none; }
  .cal-body { grid-template-columns: 54px repeat(var(--n), minmax(0, 1fr)); }
  .item { font-size: .84rem; }
  .quick-opts { grid-template-columns: repeat(3, minmax(0, 1fr)); } .quick-opts .btn { grid-column: 1 / -1; }
  input:not([type=checkbox]), select, textarea { font-size: 16px; }
  .hour-times { width: 100%; } .hour-times input { width: auto; flex: 1 1 0; min-width: 0; }
}
@media (prefers-reduced-motion: no-preference) { .toast { animation: rise .18s ease-out; } @keyframes rise { from { transform: translate(-50%, 8px); opacity: 0; } } }
