/* Plastic Software — document pages (release notes, FAQ, policies). Loaded after site.css. */

.nav a[aria-current]::after { transform: scaleX(1); }

.doc {
  padding: clamp(2rem, 6vw, 4.5rem) var(--gutter) clamp(4rem, 10vw, 8rem);
}

/* ---------- Head ---------- */

.doc__app {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.doc__app img { width: 2rem; height: 2rem; border-radius: 22.37%; }
.doc__app span { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size 0.4s var(--ease); }
.doc__app:hover span { background-size: 100% 1.5px; }

.doc__title {
  font-size: clamp(2.25rem, 6.2vw, 5.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.005em;
  font-feature-settings: "palt";
  word-break: keep-all;
}
.doc__lead {
  margin-top: clamp(1rem, 2vw, 1.5rem);
  max-width: 44em;
  color: var(--muted);
  font-size: clamp(0.9375rem, 0.35vw + 0.88rem, 1.0625rem);
  line-height: 1.9;
}
.doc__lead a { color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

.subnav {
  margin-top: clamp(2rem, 4.5vw, 3.5rem);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav ul { display: flex; gap: clamp(1.25rem, 3vw, 2.5rem); }
.subnav a {
  position: relative;
  display: block;
  padding: 0.875rem 0;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.2s;
}
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current] { color: var(--ink); }
.subnav a[aria-current]::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px 0;
  height: 2px;
  background: var(--ink);
}

/* ---------- Body ---------- */

.doc__main { margin-top: clamp(2rem, 5vw, 4rem); min-width: 0; }
.doc__main--narrow { max-width: 50rem; }

.doc__cols {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}

/* Prose: text the product team wrote, set to be read */
.prose { font-size: 0.9375rem; line-height: 1.85; overflow-wrap: anywhere; }
.prose--lg { font-size: 1.0625rem; line-height: 2; }
.prose > * + * { margin-top: 1em; }
.prose h2 {
  margin-top: 2.5em;
  font-size: clamp(1.25rem, 1vw + 1rem, 1.625rem);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.02em;
  font-feature-settings: "palt";
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 2em; font-size: 1.0625rem; font-weight: 700; line-height: 1.5; }
.prose h4 { margin-top: 1.6em; font-size: 0.9375rem; font-weight: 700; line-height: 1.5; }
.prose h5 { margin-top: 1.4em; font-size: 0.875rem; font-weight: 700; color: var(--muted); }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose ul { list-style: none; }
.prose ul > li { position: relative; }
.prose ul > li::before {
  content: "";
  position: absolute;
  left: -1em; top: 0.8em;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--muted);
}
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 0.4em; }
.prose li > ul, .prose li > ol { margin-top: 0.4em; }
.prose a { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--accent-ink); }
.prose s { color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 1.5em; }
.prose strong, .prose b { font-weight: 700; }

/* ---------- Release notes ---------- */

.yindex { position: sticky; top: calc(var(--header-h) + 2rem); margin-top: clamp(2rem, 5vw, 4rem); }
.yindex ol { list-style: none; margin: 0; padding: 0; }
.yindex a {
  display: block;
  padding: 0.3rem 0;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s;
}
.yindex a:hover { color: var(--ink); }
.yindex a[aria-current] { color: var(--accent-ink); }

.year { scroll-margin-top: calc(var(--header-h) + 1.5rem); }
.year + .year { margin-top: clamp(3rem, 7vw, 5.5rem); }
.year__title {
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--ink);
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.ver {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1rem clamp(1rem, 3vw, 3rem);
  padding-block: clamp(1.5rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.ver__num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.ver__head time {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.ver__os { margin-top: 0.5rem; color: var(--muted); font-size: 0.75rem; line-height: 1.5; }
.ver:target .ver__num { color: var(--accent-ink); }
.ver__body h4 {
  margin-top: 1.5em;
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
}
.ver__body > h4:first-child { margin-top: 0.35em; }
.ver__body h4 + ul { margin-top: 0.5em; }
.ver__link a {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-weight: 600;
}
.ver__link svg { flex: none; width: 1rem; height: 1rem; margin-top: 0.4em; color: var(--muted); }

/* ---------- Feature reference ---------- */

.doc__cols--cats { grid-template-columns: 12.5rem minmax(0, 1fr); }
.yindex--cats a { font-family: var(--font-body); font-size: 0.875rem; font-weight: 500; padding: 0.4rem 0; }
.yindex--cats a[aria-current] { font-weight: 700; }

.fcat { scroll-margin-top: calc(var(--header-h) + 1.5rem); }
.fcat + .fcat { margin-top: clamp(3rem, 6vw, 5rem); }
.fcat__title {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding-bottom: 0.875rem;
  border-bottom: 2px solid var(--ink);
  font-size: clamp(1.375rem, 1.4vw + 1rem, 2rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.02em;
  font-feature-settings: "palt";
}
.fcat__title span {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.flist { columns: 2 20rem; column-gap: clamp(1.5rem, 3vw, 3rem); }
.flist li {
  break-inside: avoid;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
  line-height: 1.65;
}
.flist strong { display: block; font-size: 0.9375rem; font-weight: 600; letter-spacing: 0.01em; }
.flist li span { display: block; margin-top: 0.2rem; color: var(--muted); font-size: 0.875rem; }

/* ---------- FAQ ---------- */

.qa-list { border-top: 2px solid var(--ink); }
.qa { border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 1rem); }
.qa summary {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: clamp(1.125rem, 2.2vw, 1.5rem) 0;
  cursor: pointer;
  list-style: none;
  font-size: clamp(1rem, 0.5vw + 0.92rem, 1.1875rem);
  font-weight: 700;
  line-height: 1.6;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary span { flex: 1; }
.qa__mark { flex: none; margin-top: 0.25em; color: var(--muted); transition: transform 0.45s var(--ease), color 0.3s; }
.qa summary:hover .qa__mark, .qa[open] .qa__mark { color: var(--ink); }
.qa[open] .qa__mark { transform: rotate(45deg); }
.qa__body { padding: 0 2.25rem clamp(1.5rem, 3vw, 2.25rem) 0; }
/* copy the link to this question: the last thing in the answer, at its right edge */
.qa__body { display: flow-root; }
.qa__copy {
  float: right;
  display: grid;
  place-items: center;
  width: 2.25rem; height: 2.25rem;
  margin: 0.5rem -0.5rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.25s, color 0.25s;
}
.qa__copy:hover, .qa__copy:focus-visible { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.qa__copy svg { grid-area: 1 / 1; transition: opacity 0.25s, transform 0.35s var(--ease); }
.qa__copy-done { opacity: 0; transform: scale(0.6); }
.qa__copy.is-done { color: var(--accent); }
.qa__copy.is-done .qa__copy-link { opacity: 0; transform: scale(0.6); }
.qa__copy.is-done .qa__copy-done { opacity: 1; transform: none; }

/* keyboard shortcuts, kept as the two-column list the product team authored */
.shortcuts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  max-width: 30rem;
  font-size: 0.875rem;
}
.shortcuts-grid .grid-item { padding: 0.55rem 0; border-bottom: 1px solid var(--line); min-height: 2.6rem; }
.shortcuts-grid .grid-item:nth-child(even) { text-align: right; }
.shortcuts-grid .grid-item.no-line { border-bottom-color: transparent; }
.shortcuts-grid .grid-item.is-head { color: var(--muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; border-bottom-color: var(--ink); }
.key {
  display: inline-grid;
  place-items: center;
  min-width: 1.9em;
  padding: 0.1em 0.5em;
  border: 1px solid var(--line);
  border-radius: 0.4em;
  background: var(--panel);
  box-shadow: 0 1.5px 0 var(--line);
  font: 600 0.8125rem/1.5 var(--font-mono);
}

/* ---------- Feedback ---------- */

.contacts { display: grid; border-top: 2px solid var(--ink); }
.contacts__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.25rem, 3vw, 2.25rem) 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3.6vw, 3rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.contacts__item svg { flex: none; width: 0.7em; height: 0.7em; color: var(--accent); transition: transform 0.6s var(--ease); }
.contacts__item span { background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 0.07em no-repeat; padding-bottom: 0.08em; transition: background-size 0.7s var(--ease); }
.contacts__item:hover span, .contacts__item:focus-visible span { background-size: 100% 0.07em; }
.contacts__item:hover svg { transform: translate(0.08em, -0.08em); }
.doc__em { font-style: normal; font-weight: 600; color: var(--accent); white-space: nowrap; }
/* the way to the in-app support: a path through the app's menus, not a link */
.contacts__path { justify-content: flex-start; flex-wrap: wrap; gap: 0.1em 0.35em; }
.contacts__path svg { width: 0.55em; height: 0.55em; color: var(--muted); }
.contacts__path span { background: none; }
.contacts__path .menu-icon svg { width: 0.95em; height: 0.95em; color: var(--ink); }

/* ---------- Small screens ---------- */

@media (max-width: 51.99rem) {
  .doc__cols { display: block; }
  .yindex {
    top: calc(var(--header-h) + var(--nav-shift, 0px));
    transition: top 0.32s var(--ease);
    z-index: 5;
    margin: 1.5rem calc(-1 * var(--gutter)) 0;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
  }
  .yindex ol { display: flex; gap: 0.25rem; padding: 0.5rem var(--gutter); overflow-x: auto; scrollbar-width: none; }
  .yindex ol::-webkit-scrollbar { display: none; }
  .yindex li { flex: none; }
  .yindex a { padding: 0.3rem 0.75rem; border-radius: 999px; font-size: 0.8125rem; white-space: nowrap; }
  .yindex--cats a { padding: 0.3rem 0.75rem; font-size: 0.8125rem; }
  .fcat { scroll-margin-top: calc(var(--header-h) + 4rem); }
  .yindex a[aria-current] { background: var(--ink); color: var(--bg); }
  .year { scroll-margin-top: calc(var(--header-h) + 4rem); }
  .ver { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
  .ver__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.25rem 0.75rem; }
  .ver__head time, .ver__os { margin-top: 0; }
  .qa__body { padding-right: 0; }
}

/* How to add books: the app's own footnotes */
.prose .note { color: var(--muted); font-size: 0.875rem; }
.fcat .qa-list { border-top-width: 1px; }
.contacts__note { margin-top: clamp(1.5rem, 3vw, 2.25rem); max-width: 40em; color: var(--muted); font-size: 0.9375rem; line-height: 1.8; }

/* ---------- Haste: everything on one compact page ---------- */
.haste { display: block; width: 100%; max-width: 68rem; margin-inline: auto; box-sizing: border-box; padding-top: calc(var(--header-h, 4rem) + clamp(2rem, 6vw, 4rem)); }
.haste__head { padding-bottom: clamp(2rem, 5vw, 3.5rem); }
.haste__icon { width: 4.5rem; height: 4.5rem; margin-bottom: 1.25rem; }
.haste__tagline { margin-top: 0.5rem; font-size: clamp(1.25rem, 1.4vw + 0.9rem, 1.875rem); font-weight: 800; line-height: 1.4; letter-spacing: 0.01em; text-wrap: balance; word-break: auto-phrase; }
.haste__head .doc__lead { margin-top: 1rem; }
.haste__get { margin-top: 1.75rem; display: flex; align-items: center; gap: 1rem; color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.haste__sec { width: 100%; max-width: none; margin-inline: 0; padding-top: clamp(2.5rem, 6vw, 4.5rem); scroll-margin-top: var(--header-h, 4rem); }
.haste__sec > h2 { padding-bottom: 0.875rem; border-bottom: 2px solid var(--ink); font-size: clamp(1.375rem, 1.2vw + 1rem, 1.875rem); font-weight: 800; line-height: 1.35; }
.haste__sec .qa-list { border-top: 0; }
.haste__features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(1.5rem, 4vw, 3rem); list-style: none; padding: 0; }
.haste__features li { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.haste__features h3 { font-size: 1.0625rem; font-weight: 800; line-height: 1.5; }
.haste__features p { margin-top: 0.3rem; color: var(--muted); font-size: 0.9375rem; line-height: 1.8; }
.haste__sec .ver { padding-top: 1.25rem; }
.haste__policy summary span { color: var(--muted); font-size: 0.9375rem; font-weight: 500; line-height: 1.8; }
.haste__note { margin-top: 1.25rem; color: var(--muted); font-size: 0.9375rem; line-height: 1.8; }
.haste .contacts { margin-top: 0.5rem; }
@media (max-width: 43.99rem) { .haste__features { grid-template-columns: minmax(0, 1fr); } }

/* Haste: custom search downloads */
.haste__more { margin-top: 1.5rem; }
.haste__more a, .haste__zip { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; }
.haste__more a svg, .haste__zip svg { transition: transform 0.5s var(--ease); }
.haste__more a:hover svg, .haste__zip:hover svg { transform: translateX(3px); }
.haste__zip { padding: 0.75rem 1.5rem; border: 1.5px solid var(--line); border-radius: 999px; color: var(--ink); }
.haste__zip:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.haste__back { margin-bottom: 1.25rem; font-size: 0.875rem; font-weight: 600; }
.haste__back a { color: var(--muted); }
.haste__back a:hover { color: var(--ink); }
.searches { list-style: none; padding: 0; }
.searches a { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1rem; align-items: center; padding: 0.875rem 0; border-bottom: 1px solid var(--line); }
.searches__name { font-weight: 700; line-height: 1.5; }
.searches__url { grid-column: 1; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; line-height: 1.6; overflow-wrap: anywhere; }
.searches__keys { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 0.25rem; }
.searches kbd { display: inline-grid; place-items: center; min-width: 1.75rem; height: 1.75rem; padding: 0 0.35rem; border: 1px solid var(--line); border-radius: 0.375rem; font-family: var(--font-latin), sans-serif; font-size: 0.75rem; font-weight: 700; }
.searches a:hover .searches__name { text-decoration: underline; text-underline-offset: 0.2em; }
.haste__back + .doc__title { font-size: clamp(1.75rem, 4vw, 3rem); line-height: 1.25; word-break: auto-phrase; text-wrap: balance; }

/* product pages: anchors land below the sticky local nav */
.has-localnav .qa, .has-localnav .fcat, .has-localnav .ver, .has-localnav .year { scroll-margin-top: calc(var(--local-h) + 1.25rem); }
