/* Copyright page generator: this page only, on top of /style.css and /tools/tools.css. */

/* the light that crosses the glass sits under the text, not over it (it washed out the top-left labels) */
.tool-card.glass::before, .tool-card .glass::before { z-index: -1; }

/* ---------- layout: the book fields, the page, then the other options (one column);
   fields on the left, the page on the right, kept in view (two columns) ---------- */
.tool-form.cp-grid { display: grid; gap: 30px; grid-template-areas: "book" "preview" "options"; }
.cp-book { grid-area: book; }
.cp-results { grid-area: preview; gap: 14px; }
.cp-options { grid-area: options; display: flex; flex-direction: column; gap: 30px; min-width: 0; }
@media (min-width: 900px) {
  .tool-form.cp-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "book preview" "options preview"; column-gap: 48px; row-gap: 30px; align-items: start; }
  .cp-results { position: sticky; top: 96px; }
}

/* ---------- fields ---------- */
.cp-fields { display: flex; flex-direction: column; gap: 14px; }
.tool-form .f-label-sm { margin-bottom: 7px; font-size: 13.5px; font-weight: 600; letter-spacing: 0.01em; text-transform: none; color: var(--ink-soft); }
.cp-row-year { grid-template-columns: minmax(0, 1fr) 104px; }
.tool-form textarea {
  display: block;
  width: 100%;
  min-height: 132px;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid var(--field-brd);
  background: var(--field-bg);
  box-shadow: inset 0 1px 2px rgba(29, 42, 69, 0.06);
  font: inherit;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  resize: vertical;
  transition: border-color 0.2s, background 0.2s;
}
.tool-form textarea:hover { border-color: rgba(29, 42, 69, 0.3); }
.tool-form textarea:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 1px; background-color: #fff; }
.tool-form input::placeholder, .tool-form textarea::placeholder { color: rgba(61, 74, 102, 0.45); }
/* one ISBN per line: the format on the left, the number on the right, the check under the number */
.isbn-field { display: grid; grid-template-columns: 6.2rem minmax(0, 1fr); column-gap: 12px; align-items: center; }
.isbn-field .f-label-sm { margin: 0; }
.isbn-field .isbn-msg { grid-column: 2; }
.isbn-msg { margin-top: 7px; font-size: 13px; line-height: 1.5; color: var(--ink-mute); }
.isbn-msg:empty { display: none; }
.isbn-msg.ok { color: var(--ok); }
.isbn-msg.warn { color: var(--warn); }
.isbn-msg.bad { color: var(--bad); }
.anim .isbn-msg:not(:empty) { animation: msg-in 0.3s var(--ease-out); }
@keyframes msg-in { from { opacity: 0; transform: translateY(-4px); } }

.link-btn {
  display: inline-block;
  padding: 11px 0;
  margin: -11px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gold-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.2s var(--ease-out);
}
.link-btn:hover { color: var(--gold-deep); }
.cp-reset { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: -6px; font-size: 13px; }
/* "Cleared. Undo" right where Start over was pressed (on a phone the page is far above) */
.cp-reset-done { color: var(--ok); }
.cp-reset-done:empty { display: none; }
.anim .cp-reset-done:not(:empty) { animation: msg-in 0.3s var(--ease-out); }

/* check boxes */
.ticks { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.tick { position: relative; display: flex; gap: 14px; align-items: flex-start; min-height: 44px; padding: 2px 0; cursor: pointer; }
.tick input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.tick-box {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border-radius: 9px;
  border: 1.5px solid rgba(29, 42, 69, 0.26);
  background: rgba(255, 255, 255, 0.65);
  transition: background 0.2s, border-color 0.2s;
}
.tick-box::after {
  content: "";
  width: 11px;
  height: 6px;
  border-left: 2px solid var(--cream);
  border-bottom: 2px solid var(--cream);
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg) scale(0.4);
  transition: transform 0.28s var(--ease-out), opacity 0.2s;
}
.tick input:checked + .tick-box { background: var(--ink); border-color: var(--ink); }
.tick input:checked + .tick-box::after { opacity: 1; transform: translateY(-1px) rotate(-45deg) scale(1); }
.tick input:focus-visible + .tick-box { outline: 2px solid var(--gold-deep); outline-offset: 3px; }
.tick-text { font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--ink); }
.tick-text small { display: block; margin-top: 3px; font-size: 13px; font-weight: 400; line-height: 1.55; color: var(--ink-mute); }
.tick-sub { margin-left: 40px; padding-top: 4px; }
.reveal { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 0.42s var(--ease-out), opacity 0.3s var(--ease-out); }
.reveal.is-open { grid-template-rows: 1fr; opacity: 1; }
.reveal-in { min-height: 0; overflow: hidden; }
/* room for the field's border, shadow and focus ring, which overflow: hidden would cut */
.reveal.is-open > .reveal-in { padding: 8px; margin: -8px; }

/* ---------- the page ---------- */
.book { position: relative; width: min(100%, 430px); margin: 4px auto 0; padding: 0 0 12px 12px; }
/* a few pages under it, on the fore-edge side (left, for the back of a title page) */
.book::before, .book::after { content: ""; position: absolute; border-radius: 4px 2px 2px 4px; }
.book::before { left: 6px; top: 6px; right: 6px; bottom: 6px; background: #f1e9d8; box-shadow: 0 1px 2px rgba(29, 42, 69, 0.1); }
.book::after { left: 0; top: 12px; right: 12px; bottom: 0; background: #e9dfca; box-shadow: 0 18px 40px -22px rgba(29, 42, 69, 0.45); z-index: -1; }
.book { isolation: isolate; }
.page {
  position: relative;
  z-index: 1;
  container-type: inline-size;
  aspect-ratio: 2 / 3;
  display: flex;
  flex-direction: column;
  padding: 18% 14% 13%;
  border-radius: 4px 1px 1px 4px;
  background:
    radial-gradient(140% 90% at 20% 0%, rgba(255, 255, 255, 0.9), transparent 60%),
    linear-gradient(180deg, #fdfaf2, #f8f2e4);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 26px 56px -30px rgba(29, 42, 69, 0.5), 0 6px 16px -10px rgba(29, 42, 69, 0.28);
}
/* the gutter: the page curves into the spine on the right */
.page::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 11%;
  border-radius: 0 1px 1px 0;
  background: linear-gradient(90deg, rgba(120, 95, 50, 0), rgba(120, 95, 50, 0.07) 60%, rgba(70, 55, 30, 0.16));
  pointer-events: none;
}
/* centered: in the middle of the page, as the Word file sets it (vertical alignment: center) */
.page[data-align="center"] { justify-content: center; text-align: center; padding-top: 14%; padding-bottom: 14%; }
.page[data-align="left"] { justify-content: flex-end; text-align: left; padding-top: 14%; }
.page-text {
  font-family: var(--serif);
  font-size: calc(clamp(10.5px, 4.3cqi, 14px) * var(--fit, 1));
  font-weight: 500;
  line-height: 1.5;
  color: #2c3a58;
  overflow-wrap: break-word;
}
.page[data-align="center"] .page-text { margin-inline: 2%; }
.pb + .pb { margin-top: 1.05em; }
.pb p { margin: 0; }
.pb-title p { font-style: italic; font-size: 1.14em; }
.pb.is-missing p { color: var(--gold-deep); opacity: 0.7; font-style: italic; }
.ph { color: var(--gold-deep); opacity: 0.75; font-style: italic; }
.anim .pb.is-new { animation: pb-in 0.46s var(--ease-out) both; }
@keyframes pb-in { from { opacity: 0; transform: translateY(8px); filter: blur(3px); } }
.anim .page-text.is-moving { animation: page-move 0.42s var(--ease-out); }
@keyframes page-move { from { opacity: 0; transform: translateY(10px); } }

.cp-caption { text-align: center; font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--ink-mute); }
.cp-actions { justify-content: center; gap: 8px; }
.btn-tool svg { flex: none; margin-right: 8px; }
.cp-actions .btn-tool { transition: transform 0.2s var(--ease-out), box-shadow 0.2s, background 0.2s; }
.cp-actions .btn-tool:hover { transform: translateY(-1px); }
.cp-actions .btn-tool:active { transform: scale(0.97); }
.cp-actions .btn-glass:hover { background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.5)); }
.cp-done { text-align: center; }
.cp-done:empty { display: none; }
.anim .cp-done:not(:empty) { animation: msg-in 0.3s var(--ease-out); }
.cp-legal { text-align: center; font-size: 12.5px; color: var(--ink-mute); }

/* no lone word on the last line of a hint or a note */
.tool-card .f-hint, .tool-card .status, .isbn-msg, .tick-text small { text-wrap: pretty; }

/* ---------- notes: one quiet list, not a pile of cards ---------- */
.cp-results .notes:not(:empty) {
  gap: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 10px 28px -20px rgba(29, 42, 69, 0.35);
}
.cp-results .notes .status { gap: 10px; padding: 11px 15px; border: 0; border-radius: 0; background: none; font-size: 13.5px; line-height: 1.5; }
.cp-results .notes .status + .status { border-top: 1px solid var(--hairline); }
.cp-results .notes .status .dot { width: 20px; height: 20px; margin-top: 0; font-size: 11px; }

/* ---------- phones: the line just changed follows the options in a small bar at the foot ---------- */
.peek {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 44;
  display: flex;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transform: translateY(calc(100% + 18px));
  transition: transform 0.46s var(--ease-out), opacity 0.3s var(--ease-out), visibility 0s linear 0.46s;
}
.peek.is-on { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
.peek-in {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 30rem;
  min-height: 64px;
  padding: 8px 8px 8px 12px;
  border-radius: 22px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 20px 44px -14px rgba(29, 42, 69, 0.62), 0 4px 12px -4px rgba(29, 42, 69, 0.3);
}
.peek-text { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; margin: 0; }
/* a tiny page: a few lines set on cream */
.peek-page {
  flex: none;
  position: relative;
  width: 32px;
  height: 46px;
  border-radius: 3px 1px 1px 3px;
  background:
    linear-gradient(var(--gold-line), var(--gold-line)) 50% 30% / 12px 1.5px no-repeat,
    linear-gradient(rgba(44, 58, 88, 0.55), rgba(44, 58, 88, 0.55)) 50% 42% / 18px 1px no-repeat,
    linear-gradient(rgba(44, 58, 88, 0.4), rgba(44, 58, 88, 0.4)) 50% 50% / 20px 1px no-repeat,
    linear-gradient(rgba(44, 58, 88, 0.4), rgba(44, 58, 88, 0.4)) 50% 58% / 16px 1px no-repeat,
    linear-gradient(rgba(44, 58, 88, 0.4), rgba(44, 58, 88, 0.4)) 50% 70% / 14px 1px no-repeat,
    linear-gradient(180deg, #fdfaf2, #f1e9d8);
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.6);
}
.peek-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.peek-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.72; }
.peek-sub { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-family: var(--serif); font-size: 15.5px; font-weight: 500; line-height: 1.2; overflow-wrap: anywhere; }
.peek-sub.is-missing { font-style: italic; opacity: 0.7; }
.anim .peek-sub.is-new { animation: msg-in 0.3s var(--ease-out); }
.peek-go {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 14px 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: var(--cream);
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.2s, transform 0.2s var(--ease-out);
}
.peek-in:hover .peek-go { background: rgba(255, 255, 255, 0.18); }
.peek-in:active .peek-go { transform: scale(0.96); }
html:not(.anim) .peek { transform: none; transition: opacity 0.2s, visibility 0s linear 0.2s; }
html:not(.anim) .peek.is-on { transition-delay: 0s; }
@media (max-width: 899px) {
  html { scroll-padding-bottom: 92px; }
}
@media (min-width: 900px) {
  .peek { display: none; }
}

/* ---------- reference prose ---------- */
.prose .cp-parts li { color: var(--ink-soft); }
.prose em { color: var(--ink); }

/* ---------- closing call ---------- */
.cp-final { padding-bottom: 80px; }
.cp-final-copy { max-width: 36rem; margin: 18px auto 0; color: var(--ink-soft); font-size: 16.5px; line-height: 1.7; }

/* next to the form, the page keeps the proportions of a 6 × 9 in book and stays in view:
   its size follows the window height, and app.js sets the type smaller when the text is long */
@media (min-width: 900px) {
  .book { width: min(100%, 410px, calc((100vh - 250px) * 0.6667)); }
  .page { min-height: 0; overflow: hidden; }
}

@media (max-width: 479px) {
  .cp-grid .f-row:not(.cp-row-year) { grid-template-columns: 1fr; }
  .cp-row-year { grid-template-columns: minmax(0, 1fr) 92px; }
  .tick-sub { margin-left: 20px; }
  /* phones: the label back above its field, so the checks under it get the full width */
  .isbn-field { display: block; }
  .isbn-field .f-label-sm { margin-bottom: 7px; }
  /* Word on its own line, the two small ones side by side under it */
  .cp-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .cp-actions .btn-tool { width: 100%; padding: 0 12px; }
  .cp-actions #dl-docx { grid-column: 1 / -1; }
}
