/* Privacy: the app's own switches, and a message that shows what each one does. */
body.letterpress #privacy {
  max-width: 920px; margin-inline: auto;
  --pv-card: #fff; --pv-ground: var(--group);
  --pv-shadow: 0 0 0 1px #2021240c, 0 1px 2px #2021240a, 0 10px 26px -14px #20212426;
  --pv-on: var(--t1); --pv-knob: #fff; --pv-knob-on: #fff;
  --pv-warn: #b07a10; --pv-cream: #f7f2e8; --pv-brown: #5a4416;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.letterpress #privacy {
    --pv-card: #2c2c2d; --pv-ground: #212122;
    --pv-shadow: 0 0 0 1px #ffffff10, 0 12px 28px -14px #0009;
    --pv-on: #f3f3f4; --pv-knob: #e8e8ea; --pv-knob-on: #1c1c1d;
    --pv-warn: #e6b04a; --pv-cream: #2a251b; --pv-brown: #eedcb4;
  }
}
:root[data-theme="dark"] body.letterpress #privacy {
  --pv-card: #2c2c2d; --pv-ground: #212122;
  --pv-shadow: 0 0 0 1px #ffffff10, 0 12px 28px -14px #0009;
  --pv-on: #f3f3f4; --pv-knob: #e8e8ea; --pv-knob-on: #1c1c1d;
  --pv-warn: #e6b04a; --pv-cream: #2a251b; --pv-brown: #eedcb4;
}

body.letterpress #privacy .sub { max-width: 34em; }

/* The stage: Settings on the left, the message on the right, on one gray ground. */
.pv {
  margin-top: 28px; padding: 14px; border-radius: 24px; background: var(--pv-ground);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start;
}
.pv-group { margin: 10px 14px 7px; font-size: 12px; font-weight: 600; letter-spacing: -.005em; color: var(--t3); }
.pv-group + .pv-card { margin-bottom: 4px; }
.pv-card { border-radius: 16px; background: var(--pv-card); box-shadow: var(--pv-shadow); overflow: hidden; }

/* A row is one big switch: the label, its note and the knob. */
.pv-row {
  all: unset; box-sizing: border-box; position: relative; width: 100%; min-height: 56px; cursor: pointer;
  display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 16px;
  -webkit-tap-highlight-color: transparent; transition: background-color .16s;
}
.pv-row + .pv-row::before, .pv-more .pv-row::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--hair);
}
@media (hover: hover) { .pv-row:hover { background: var(--hover); } }
.pv-row:active { background: var(--sel); }
.pv-row:focus-visible { outline: 2px solid var(--t1); outline-offset: -3px; border-radius: 14px; }
.pv-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pv-text b { font-size: 14.5px; font-weight: 550; letter-spacing: -.012em; line-height: 1.3; color: var(--t1); }
.pv-text small { font-size: 12.5px; line-height: 1.38; letter-spacing: -.005em; color: var(--t2); }

.pv-sw { flex: none; position: relative; width: 38px; height: 23px; border-radius: 999px; background: color-mix(in srgb, var(--t1) 13%, var(--pv-card)); transition: background-color .22s var(--ease); }
.pv-sw::after {
  content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--pv-knob); box-shadow: 0 1px 2px #0000002e, 0 0 0 .5px #0000000d;
  transition: transform .3s cubic-bezier(.3, 1.35, .5, 1), background-color .22s;
}
.pv-row[aria-checked="true"] .pv-sw { background: var(--pv-on); }
.pv-row[aria-checked="true"] .pv-sw::after { transform: translateX(15px); background: var(--pv-knob-on); }
.pv-row:active .pv-sw::after { width: 21px; }
.pv-row[aria-checked="true"]:active .pv-sw::after { transform: translateX(12px); }

/* Hide sign-in codes appears under AI features, as in the app. */
.pv-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .32s var(--ease); }
.pv-more > div { overflow: hidden; min-height: 0; }
.pv[data-ai="true"] .pv-more { grid-template-rows: 1fr; }
.pv-more .pv-row { opacity: 0; transition: opacity .2s, background-color .16s; }
.pv[data-ai="true"] .pv-more .pv-row { opacity: 1; transition-delay: .08s, 0s; }

/* The message. Scenes share one cell so the stage never jumps. */
.pv-stage { display: grid; gap: 10px; }
.pv-scenes { display: grid; }
.pv-scene {
  grid-area: 1 / 1; align-self: stretch; display: flex; flex-direction: column; padding: 16px 16px 18px; border-radius: 16px; background: var(--pv-card); box-shadow: var(--pv-shadow);
  opacity: 0; visibility: hidden; transform: translateY(6px) scale(.985);
  transition: opacity .2s, transform .32s var(--ease), visibility 0s .32s;
}
.pv[data-show="images"] [data-scene="images"], .pv[data-show="fake"] [data-scene="fake"],
.pv[data-show="loc"] [data-scene="loc"], .pv[data-show="ai"] [data-scene="ai"] {
  opacity: 1; visibility: visible; transform: none; transition: opacity .22s .04s, transform .34s .04s var(--ease), visibility 0s;
}

.pv-from { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.pv-av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--av); color: var(--avi); font-size: 12px; font-weight: 600; letter-spacing: .01em; }
.pv-who { display: grid; min-width: 0; }
.pv-who b { font-size: 14px; font-weight: 600; letter-spacing: -.012em; color: var(--t1); }
.pv-who small, .pv-from time { font-size: 12px; color: var(--t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-from time { align-self: start; padding-top: 2px; }
.pv-to { display: flex; align-items: baseline; gap: 8px; font-size: 13px; padding-bottom: 10px; border-bottom: 1px solid var(--hair); }
.pv-to span { color: var(--t3); }
.pv-to b { font-weight: 550; color: var(--t1); }
.pv-subj { margin: 12px 0 0; font-size: 16px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; color: var(--t1); }
.pv-body { margin: 8px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--t2); text-wrap: pretty; }
.pv-body b { font-weight: 600; color: var(--t1); font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* Images: a quiet bar and an empty frame until you say so. */
.pv-bar {
  margin: 12px 0 0; display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 4px 0 10px;
  border-radius: 10px; background: var(--pv-ground); font-size: 12.5px; color: var(--t2);
  transition: opacity .2s, margin .3s var(--ease), height .3s var(--ease);
}
.pv-bar svg, .pv-warn svg, .pv-pin, .pv-ai-h svg, .pv-pill svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pv-bar span { flex: 1; }
.pv-show {
  all: unset; box-sizing: border-box; height: 24px; padding: 0 10px; border-radius: 999px; cursor: pointer;
  font-size: 12px; font-weight: 550; color: var(--t1); background: var(--pv-card); box-shadow: 0 0 0 .5px var(--hair), 0 1px 2px #0000000f;
  position: relative;
}
.pv-show::before { content: ""; position: absolute; inset: -8px -6px; }
@media (hover: hover) { .pv-show:hover { background: var(--canvas); } }
.pv-show:focus-visible { outline: 2px solid var(--t1); outline-offset: 2px; }
.pv[data-images="true"] .pv-bar { visibility: hidden; opacity: 0; height: 0; margin-top: 0; overflow: hidden; pointer-events: none; }
.pv-img {
  margin-top: 10px; aspect-ratio: 7 / 3; border-radius: 10px; overflow: hidden; position: relative;
  background: var(--pv-ground);
}
.pv-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--t3); transition: opacity .25s; }
.pv-ph svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.pv[data-images="true"] .pv-ph { opacity: 0; }
.pv-img img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; filter: blur(8px); transform: scale(1.04); transition: opacity .35s, filter .45s var(--ease), transform .55s var(--ease); }
.pv[data-images="true"] .pv-img img { opacity: 1; filter: none; transform: none; }

/* Fake senders: one quiet line, not a red banner. */
.pv-warn { margin: 10px 0 0; display: flex; gap: 7px; align-items: flex-start; font-size: 12.5px; line-height: 1.35; color: var(--t2); transition: opacity .2s; }
.pv-warn svg { color: var(--pv-warn); margin-top: 1px; }
.pv-warn span { min-width: 0; overflow-wrap: anywhere; }
.pv[data-fake="false"] .pv-warn { opacity: 0; }
.pv-fakebtn { align-self: flex-start; display: inline-flex; align-items: center; height: 28px; margin-top: 12px; padding: 0 12px; border-radius: 999px; background: var(--pv-ground); font-size: 12.5px; font-weight: 550; color: var(--t2); }

/* A real letter ends with a footer, pinned to the bottom. */
.pv-foot-mail { margin: auto 0 0; padding-top: 12px; border-top: 1px solid var(--hair); font-size: 11.5px; color: var(--t3); }
.pv-fakebtn { margin-bottom: 16px; }

/* A photo on its way out: the picture, and a pill saying what goes with it. */
.pv-photo { flex: 1; min-height: 120px; margin-top: 12px; position: relative; border-radius: 10px; overflow: hidden; background: var(--pv-ground); }
.pv-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pv-pill {
  position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px 0 9px;
  border-radius: 999px; background: rgb(255 255 255 / .86); color: #202124; font-size: 12px; font-weight: 550;
  -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4); box-shadow: 0 1px 3px #0000001f;
}
.pv-pin { width: 14px; height: 14px; }
.pv-slash { transition: stroke-dashoffset .3s var(--ease); stroke-dasharray: 26; stroke-dashoffset: 0; }
.pv[data-loc="true"] .pv-loc-off, .pv[data-loc="false"] .pv-loc-on { display: none; }
.pv[data-loc="false"] .pv-slash { stroke-dashoffset: 26; }
.pv[data-loc="false"] .pv-pill { background: #202124e0; color: #fff; }
.pv-file { margin: 8px 0 0; font-size: 12px; color: var(--t3); }

/* AI: cream, as the app draws it. */
.pv-ai { flex: 1; display: flex; flex-direction: column; margin-top: 12px; padding: 11px 13px 12px; border-radius: 12px; background: var(--pv-cream); color: var(--pv-brown); transition: background-color .25s, color .25s; }
.pv-ai-h { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.pv-ai-h svg { fill: currentColor; stroke: none; width: 12px; height: 12px; }
.pv-ai-text { margin: 5px 0 0; font-size: 13px; line-height: 1.45; }
.pv-ai i { font-style: normal; }
.pv-red { padding: 0 4px; border-radius: 5px; background: color-mix(in srgb, currentColor 12%, transparent); }
.pv-raw { font-weight: 600; letter-spacing: .02em; }
.pv[data-codes="true"] .pv-raw, .pv[data-codes="false"] .pv-red { display: none; }
.pv[data-ai="false"] .pv-ai { background: var(--pv-ground); color: var(--t3); }
.pv[data-ai="false"] .pv-ai-on, .pv[data-ai="true"] .pv-ai-off { display: none; }

.pv-cap { margin: 0 6px; min-height: 2.9em; font-size: 13px; line-height: 1.45; color: var(--t2); text-wrap: pretty; }

/* The honest part, plainly. */
.pv-foot {
  margin-top: 22px; padding: 20px 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px 16px;
}
.pv-mark { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--group); color: var(--t2); }
.pv-mark svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.pv-foot p { margin: 0; font-size: 14.5px; line-height: 1.45; color: var(--t2); text-wrap: pretty; }
.pv-foot p b { font-weight: 600; color: var(--t1); }
.pv-link { font-size: 14px; color: var(--t1); text-decoration: none; white-space: nowrap; border-radius: 6px; padding: 4px 0; }
.pv-link::after { content: "→"; display: inline-block; margin-left: 5px; transition: transform .2s var(--ease); }
@media (hover: hover) { .pv-link:hover::after { transform: translateX(3px); } .pv-link:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; } }
.pv-link:focus-visible { outline: 2px solid var(--t1); outline-offset: 3px; }

@media (max-width: 720px) {
  .pv { grid-template-columns: 1fr; padding: 10px; border-radius: 22px; gap: 12px; }
  .pv-stage { order: -1; }
  .pv-group { margin-inline: 12px; }
  .pv-row { min-height: 56px; padding-block: 10px; }
  .pv-scene { padding: 14px 14px 16px; }
  .pv-img { aspect-ratio: 3 / 1; }
  .pv-photo { min-height: 96px; }
  .pv-subj { margin-top: 10px; }
  .pv-cap { min-height: 2.9em; margin: 0 8px 4px; }
  .pv-foot { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .pv-link { grid-column: 2; padding: 8px 0; margin-top: -10px; }
}

@media (prefers-reduced-motion: reduce) {
  #privacy .pv *, #privacy .pv *::after { transition-duration: 0s !important; transition-delay: 0s !important; }
  #privacy .pv-scene { transform: none; }
}

/* The backup note: one quiet line under the demo and a link, with no tile,
   rules or bold box of its own. It's a caveat, not a feature. */
.pv-foot { margin-top: 18px; padding: 0 4px; border: 0; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 24px; align-items: baseline; }
.pv-foot p { font-size: 13.5px; color: var(--t3); }
.pv-foot p b { font-weight: 500; color: var(--t2); }
.pv-link { font-size: 13.5px; color: var(--t2); }
@media (max-width: 700px) { .pv-foot { grid-template-columns: minmax(0, 1fr); } .pv-link { grid-column: 1; margin-top: 0; } }

/* The preview starts level with the first settings card, under its label. */
@media (min-width: 721px) { .pv-stage { margin-top: 35px; } }

/* Focus rings sit inside the cards, where the cards' clipping can't cut them. */
#privacy .pv-row:focus-visible { outline: 2px solid var(--t1); outline-offset: -3px; border-radius: 14px; }
#privacy .pv-link:focus-visible { outline: 2px solid var(--t1); outline-offset: 3px; }
.pv-foot { padding-inline: 0; }
