/* Booker: spec sheet + mill. Full-page scale. Ignition Book, cite on icons. */

.book-page {
  overflow-x: clip;
  overflow-y: visible;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--studio, 46px));
}
.book-page .hs-head.is-lock { margin-bottom: 0; flex-shrink: 0; }
.book-page .hs-foot { margin-top: auto; flex-shrink: 0; }
.book-page .band.book-stage {
  max-width: 1520px;
  margin: 0 auto;
  padding: 32px 56px 56px;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
  flex: 1;
}
.book-stage .book-cal { margin-top: 24px; }
.book-stage .book-quiet { margin-top: 16px; font-size: 15px; color: var(--mute, #64748b); }
.book-stage .book-quiet a { color: inherit; }

.book-cal {
  --book-ink: var(--ink, #0f172a);
  --book-mute: var(--mute, #64748b);
  --book-line: #e2e8f0;
  --book-paper: #f8f9fa;
  --book-cite: var(--cite, #0284c7);
  --mill: cubic-bezier(0.16, 1, 0.3, 1);
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  border: 1px solid #111;
  border-radius: 2px;
  background: #fff;
  color: var(--book-ink);
  overflow: hidden;
}

.book-meta {
  padding: 32px 28px 28px;
  background: var(--book-paper);
  border-right: 1px solid var(--book-line);
  box-shadow: inset 3px 0 0 var(--book-cite);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.book-stamp {
  display: block;
  width: 96px;
  height: auto;
  margin-bottom: 18px;
  color: var(--book-ink);
}
.book-cite { stroke: var(--book-cite); }
.book-meta .book-what {
  font-family: var(--font-d, "Chakra Petch", sans-serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.18;
  margin: 0 0 22px;
}
.book-facts { list-style: none; margin: 0; padding: 0; }
.book-facts li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--book-mute);
  line-height: 1.4;
}
.book-facts li:last-of-type { margin-bottom: 0; }
.book-ico {
  color: var(--book-cite);
  margin-top: 2px;
  display: block;
  width: 22px;
  height: 22px;
}
.book-ico .core, .book-stamp .core, .book-frag .core { fill: currentColor; }
.book-frag {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 28px;
  color: var(--book-ink);
}

.book-body {
  padding: 24px 28px 28px;
  min-width: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.book-cal-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 16px;
  align-items: center;
  margin-bottom: 20px;
}
.book-body .book-cal-range {
  grid-column: 1;
  font-family: var(--font-m, "JetBrains Mono", ui-monospace, monospace);
  font-size: 15px;
  margin: 0;
}
.book-cal-nav {
  grid-column: 2;
  display: flex;
  gap: 8px;
}
.book-cal-nav button {
  width: 44px;
  height: 44px;
  border: 1px solid #111;
  border-radius: 2px;
  background: #fff;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background-color 140ms var(--mill);
}
.book-cal-nav button:hover:not(:disabled),
.book-cal-nav button:focus-visible:not(:disabled) {
  background: #f1f3f5;
}
.book-cal-nav button:focus { outline: none; }
.book-cal-nav button:focus-visible {
  outline: 1px solid var(--book-cite);
  outline-offset: 2px;
}
.book-cal-nav button:disabled { opacity: 0.28; cursor: default; }
.book-cal-nav svg { display: block; width: 16px; height: 16px; }

.book-days {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}
.book-day, .book-slot {
  border: 1px solid #111;
  border-radius: 2px;
  background: #fff;
  color: inherit;
  cursor: pointer;
  transition:
    background-color 140ms var(--mill),
    color 140ms var(--mill),
    border-color 140ms var(--mill),
    transform 140ms var(--mill);
}
.book-day {
  min-height: 80px;
  padding: 10px 6px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.book-day .wd {
  font-family: var(--font-m, "JetBrains Mono", ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--book-mute);
}
.book-day .dn {
  font-family: var(--font-d, "Chakra Petch", sans-serif);
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
}
.book-day:hover:not(:disabled):not([aria-checked="true"]),
.book-slot:hover:not(:disabled):not([aria-checked="true"]),
.book-day:focus-visible:not(:disabled):not([aria-checked="true"]),
.book-slot:focus-visible:not(:disabled):not([aria-checked="true"]) {
  background: transparent;
  border-color: var(--book-cite);
  color: var(--book-cite);
}
.book-day:active:not(:disabled),
.book-slot:active:not(:disabled) {
  transform: translateY(1px);
}
.book-day:hover:not(:disabled):not([aria-checked="true"]) .wd,
.book-day:focus-visible:not(:disabled):not([aria-checked="true"]) .wd {
  color: var(--book-cite);
}
.book-day:focus, .book-slot:focus, .book-hold:focus { outline: none; }
.book-day:focus-visible, .book-slot:focus-visible, .book-hold:focus-visible {
  outline: 1px solid var(--book-cite);
  outline-offset: 2px;
}
.book-day[aria-checked="true"],
.book-slot[aria-checked="true"] {
  background: var(--book-ink);
  color: #fff;
  border-color: var(--book-ink);
}
.book-day[aria-checked="true"] .wd { color: #cbd5e1; }
.book-day:disabled, .book-slot:disabled {
  opacity: 0.32;
  cursor: default;
  border-color: #cbd5e1;
}

.book-tz {
  margin: 12px 0 10px;
  font-family: var(--font-m, "JetBrains Mono", ui-monospace, monospace);
  font-size: 11px;
  color: var(--book-mute);
}

.book-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, auto);
  grid-auto-flow: column;
  gap: 10px;
}
.book-slot {
  min-height: 56px;
  font-family: var(--font-m, "JetBrains Mono", ui-monospace, monospace);
  font-size: 14px;
  padding: 0 8px;
}

.book-foot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--book-line);
}
.book-body .book-pick {
  margin: 0;
  font-size: 16px;
  min-height: 1.4em;
  transition: color 140ms var(--mill);
}
.book-cal.is-armed .book-pick { color: var(--book-ink); }
.book-body .book-done {
  margin: 0;
  font-size: 14px;
  color: var(--book-cite);
}
.book-who {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.book-commit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.book-mail-lab {
  display: block;
  min-width: 0;
  font-family: var(--font-m, "JetBrains Mono", ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--book-mute);
  transition: color 140ms var(--mill);
}
.book-cal.is-armed .book-mail-lab,
.book-cal.is-ready .book-mail-lab,
.book-commit:focus-within .book-mail-lab,
.book-who:focus-within .book-mail-lab {
  color: var(--book-ink);
}
.book-mail {
  display: block;
  width: 100%;
  max-width: none;
  margin-top: 8px;
  height: 56px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 2px;
  background: #fff;
  color: inherit;
  font: 16px var(--font-b, Inter, system-ui, sans-serif);
  box-shadow: inset 0 0 0 0 var(--book-cite);
  transition:
    border-color 140ms var(--mill),
    box-shadow 140ms var(--mill),
    background-color 140ms var(--mill);
}
.book-cal.is-armed .book-mail,
.book-cal.is-ready .book-mail {
  border-color: #111;
  box-shadow: inset 3px 0 0 var(--book-cite);
}
.book-mail[aria-invalid="true"] {
  border-color: var(--book-cite);
  box-shadow: inset 6px 0 0 var(--book-cite);
  animation: book-need 420ms var(--mill) 2;
}
.book-mail:focus {
  outline: 1px solid var(--book-cite);
  outline-offset: 2px;
  border-color: var(--book-cite);
}
.book-mail:-webkit-autofill {
  -webkit-text-fill-color: inherit;
  box-shadow: inset 3px 0 0 var(--book-cite), 0 0 0 1000px #fff inset;
}
@keyframes book-need {
  0%, 100% { box-shadow: inset 3px 0 0 var(--book-cite); }
  45% { box-shadow: inset 8px 0 0 var(--book-cite); }
}
.book-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.book-hold {
  font: 500 16px var(--font-b, Inter, system-ui, sans-serif);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #111;
  border-radius: 2px;
  background-color: #fff;
  background-image: linear-gradient(#c2410c, #c2410c);
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 0 100%;
  color: var(--book-mute);
  height: 56px;
  min-width: 168px;
  padding: 0 32px;
  cursor: default;
  width: auto;
  flex: 0 0 auto;
  transition:
    background-color 140ms var(--mill),
    background-size 140ms var(--mill),
    border-color 140ms var(--mill),
    color 140ms var(--mill),
    opacity 140ms var(--mill);
}
.book-cal.is-armed .book-hold {
  color: var(--book-ink);
  cursor: pointer;
}
.book-cal.is-ready .book-hold {
  border-color: var(--ignition, #ea580c);
  background-color: var(--ignition, #ea580c);
  color: #fff;
  cursor: pointer;
}
.book-cal.is-ready .book-hold:hover:not(:disabled),
.book-cal.is-ready .book-hold:focus-visible:not(:disabled) {
  background-size: 100% 100%;
  border-color: #c2410c;
}
.book-hold:disabled { cursor: default; }
.book-hold.is-send,
.book-hold.is-send:disabled {
  border-color: #c2410c;
  background-color: var(--ignition, #ea580c);
  background-size: 100% 100%;
  color: #fff;
  cursor: wait;
}

.book-cal.is-held .book-cal-nav,
.book-cal.is-held .book-hold {
  pointer-events: none;
  opacity: 0.45;
}
.book-cal.is-held .book-day:not([aria-checked="true"]),
.book-cal.is-held .book-slot:not([aria-checked="true"]) {
  pointer-events: none;
  opacity: 0.38;
}

html[data-theme="dark"] .book-cal {
  --book-ink: var(--night-ink, #f8fafc);
  --book-mute: var(--night-mute, #8492a6);
  --book-line: var(--night-line, #282d34);
  --book-paper: #121416;
  --book-cite: #38bdf8;
  background: #151719;
  border-color: var(--night-line, #282d34);
  color: var(--night-ink, #f8fafc);
}
html[data-theme="dark"] .book-meta {
  background: #121416;
  box-shadow: inset 3px 0 0 #38bdf8;
}
html[data-theme="dark"] .book-body { background: #151719; }
html[data-theme="dark"] .book-cal-nav button,
html[data-theme="dark"] .book-day,
html[data-theme="dark"] .book-slot {
  background: #151719;
  border-color: var(--night-ink, #f8fafc);
  color: var(--night-ink, #f8fafc);
}
html[data-theme="dark"] .book-cal-nav button:hover:not(:disabled) { background: #1e2227; }
html[data-theme="dark"] .book-day:hover:not(:disabled):not([aria-checked="true"]),
html[data-theme="dark"] .book-slot:hover:not(:disabled):not([aria-checked="true"]) {
  background: transparent;
  border-color: #38bdf8;
  color: #38bdf8;
}
html[data-theme="dark"] .book-day[aria-checked="true"],
html[data-theme="dark"] .book-slot[aria-checked="true"] {
  background: var(--night-ink, #f8fafc);
  color: var(--night, #0c0d0e);
  border-color: var(--night-ink, #f8fafc);
}
html[data-theme="dark"] .book-day[aria-checked="true"] .wd { color: #475569; }
html[data-theme="dark"] .book-day:disabled,
html[data-theme="dark"] .book-slot:disabled { border-color: var(--night-line, #282d34); }
html[data-theme="dark"] .book-hold {
  background-color: #151719;
  background-image: linear-gradient(#c2410c, #c2410c);
  border-color: var(--night-line, #282d34);
  color: var(--night-mute, #8492a6);
}
html[data-theme="dark"] .book-cal.is-armed .book-hold {
  color: var(--night-ink, #f8fafc);
  border-color: var(--night-ink, #f8fafc);
}
html[data-theme="dark"] .book-cal.is-ready .book-hold {
  background-color: var(--ignition, #ea580c);
  border-color: var(--ignition, #ea580c);
  color: #fff;
}
html[data-theme="dark"] .book-cal.is-ready .book-hold:hover:not(:disabled),
html[data-theme="dark"] .book-cal.is-ready .book-hold:focus-visible:not(:disabled) {
  background-size: 100% 100%;
  border-color: #c2410c;
}
html[data-theme="dark"] .book-mail {
  background: #151719;
  border-color: var(--night-line, #282d34);
  color: var(--night-ink, #f8fafc);
}
html[data-theme="dark"] .book-cal.is-armed .book-mail,
html[data-theme="dark"] .book-cal.is-ready .book-mail {
  border-color: var(--night-ink, #f8fafc);
}
html[data-theme="dark"] .book-mail:-webkit-autofill {
  -webkit-text-fill-color: var(--night-ink, #f8fafc);
  box-shadow: inset 3px 0 0 var(--book-cite), 0 0 0 1000px #151719 inset;
}
.book-cal.is-held .book-mail { opacity: 0.45; }
.book-cal.is-held .book-mail-lab { opacity: 0.45; }

@media (min-width: 821px) {
  .book-page .hs-head.is-lock .hs-nav { display: none; }
}

@media (max-width: 820px) {
  .book-page {
    min-height: calc(100svh - var(--studio, 40px));
  }
  .book-page .band.book-stage {
    padding: 20px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left));
    text-align: left;
  }
  .book-page .band.book-stage h1 {
    font-size: clamp(26px, 8vw, 32px);
    max-width: 14em;
  }
  .book-page .band.book-stage .lede {
    font-size: 16px;
    max-width: 28em;
  }
  .book-stage .book-cal { margin-top: 20px; }
  .book-cal {
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .book-stamp,
  .book-what,
  .book-frag { display: none; }
  .book-meta {
    border-right: 0;
    border-bottom: 1px solid var(--book-line);
    box-shadow: inset 0 3px 0 var(--book-cite);
    padding: 14px 16px 12px;
  }
  .book-facts li {
    margin: 0 0 8px;
    font-size: 13px;
    gap: 10px;
  }
  .book-facts li:last-of-type { margin-bottom: 0; }
  .book-ico { width: 18px; height: 18px; }
  .book-body { padding: 16px; }
  .book-cal-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 12px;
    margin-bottom: 14px;
  }
  .book-body .book-cal-range {
    grid-column: auto;
    flex: 1 1 10em;
    font-size: 13px;
    line-height: 1.35;
  }
  .book-cal-nav { grid-column: auto; flex: 0 0 auto; }
  .book-days {
    gap: 6px;
    margin-bottom: 16px;
  }
  .book-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(8, auto);
    gap: 8px;
  }
  .book-day {
    min-height: 56px;
    padding: 8px 2px 10px;
  }
  .book-day .wd { font-size: 10px; letter-spacing: 0.06em; }
  .book-day .dn { font-size: 20px; }
  .book-slot { min-height: 48px; font-size: 13px; }
  .book-tz { margin: 8px 0 8px; }
  .book-foot { margin-top: 16px; padding-top: 14px; }
  .book-body .book-pick { font-size: 15px; }
  .book-who, .book-commit { grid-template-columns: 1fr; }
  .book-hold { min-width: 0; width: 100%; height: 52px; padding: 0 20px; }
  .book-mail { height: 52px; }
  .book-stage .book-quiet { margin-top: 18px; }
  .book-page .hs-head.is-lock .hs-book-mobile {
    margin-left: 0;
    color: inherit;
  }
  .book-page .hs-head.is-lock .hs-book-mobile[aria-current] {
    color: inherit;
  }
}

@media (prefers-reduced-motion: reduce) {
  .book-day, .book-slot, .book-hold, .book-cal-nav button, .book-mail, .book-mail-lab, .book-pick { transition: none; }
  .book-day:active:not(:disabled), .book-slot:active:not(:disabled) { transform: none; }
  .book-mail[aria-invalid="true"] { animation: none; }
}
