/* Working with Ell (ask-ell.html): the habits, in pictures. Leans on site.css and ell.css; only what's new is here. */
:root { --warn: #b5652b; --ok: #3e7f4f; --p1: #d7e8df; --p2: #f6ecb4; --p3: #f3e0d0; --p4: #e9ece4; }
.white { background: #fff; }

/* ---- what Ell is: three cards, each with a small drawing ---- */
.know-pic { width: 120px; height: 70px; display: block; margin-bottom: 16px; }
.know-pic .pp { fill: var(--canvas); stroke: var(--line); }
.know-pic .dr { fill: none; stroke: var(--ink-2); stroke-width: 1.4; stroke-linejoin: round; }
.know-pic .pt { fill: var(--paper); stroke: var(--ink-2); stroke-width: 1.2; }
.know-pic .go { fill: none; stroke: var(--brand); stroke-width: 2.2; stroke-linecap: round; }
.know-pic .go-pt { stroke: var(--brand); fill: var(--brass); }
.know-pic .tick { fill: none; stroke: var(--ok); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.know-pic .ph { fill: #fff; stroke: var(--ink-2); stroke-width: 1.4; }
.know-pic .ph-dot { fill: var(--tint); }
.know-pic .qm { fill: none; stroke: var(--warn); stroke-width: 2.4; stroke-linecap: round; }
.know-pic .qm-dot { fill: var(--warn); }
.know ul { list-style: none; margin: 10px 0 0; padding: 0; color: var(--ink-2); font-size: 16px; line-height: 1.4; }
.know li { padding: 9px 0; border-top: 1px solid var(--line); }
.aside { margin-top: clamp(22px, 4vh, 36px); color: var(--ink-2); max-width: 44em; }

.sub { font-size: clamp(25px, 2.6vw, 36px); line-height: 1.08; letter-spacing: -.026em; margin-top: clamp(40px, 7vh, 72px); }
.sub-lede { margin-top: 12px; color: var(--ink-2); font-size: clamp(17px, 1.4vw, 19px); max-width: 38em; }

/* ---- things you can always say: the words, then what they get you ---- */
.always .more-card { background: var(--canvas); box-shadow: none; display: grid; gap: 12px; align-content: start; }
.always .more-card p:not(.say) { margin: 0; }
.always .say { background: #fff; box-shadow: 0 0 0 1px var(--line); font-size: 17px; }
.always .stuck { background: var(--brand-deep); color: #fff; }
.always .stuck ol { margin: 0; padding-left: 1.2em; color: var(--on-dark); font-size: 16px; line-height: 1.45; display: grid; gap: 8px; }

/* ---- a habit: its words on the left, what it looks like on the right ---- */
.habit { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 64px); align-items: start; padding: clamp(30px, 5vh, 52px) 0; border-top: 1px solid var(--line); }
.cream .habit { border-color: #dedfd4; }
.habit:first-of-type { margin-top: clamp(28px, 5vh, 48px); }
.habit:last-of-type { padding-bottom: 0; }
.num { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff; font: 500 22px/1 var(--display); font-variant-numeric: tabular-nums; margin-bottom: 16px; }
.habit h3 { font-size: clamp(25px, 2.6vw, 36px); line-height: 1.08; letter-spacing: -.026em; }
.habit-words p { margin-top: 12px; color: var(--ink-2); font-size: clamp(17px, 1.4vw, 19px); line-height: 1.45; max-width: 26em; }
.habit-show { display: grid; gap: 16px; min-width: 0; }
.note { color: var(--ink-2); font-size: 15.5px; line-height: 1.45; padding-left: 14px; border-left: 3px solid var(--brass-deep); max-width: 34em; }

/* What the person types, as a chat bubble. */
.say { background: var(--wash); color: var(--ink); border-radius: 18px 18px 4px 18px; padding: 11px 16px; font-size: 16px; line-height: 1.4; width: fit-content; max-width: 100%; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.col { background: #fff; border-radius: 20px; box-shadow: 0 0 0 1px var(--line); padding: 16px; display: grid; gap: 8px; align-content: start; justify-items: start; min-width: 0; }
.white .col, .white .parts, .white .measure, .white .talk { background: var(--canvas); box-shadow: none; }
.white .talk .col { background: #fff; }
.col.no .say { background: var(--tint); color: var(--ink-2); }
.tag-no, .tag-yes { font: 500 12.5px/1 var(--display); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.tag-no::before, .tag-yes::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.tag-yes::before { background: var(--ok); }
.done { font-size: 13px; color: var(--ok); display: inline-flex; align-items: center; gap: 5px; margin: -2px 0 4px 6px; }
.done::before { content: ""; width: 10px; height: 6px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg) translateY(-2px); }
.or { font-size: 13px; color: var(--muted); padding-left: 6px; }

/* One message with its four parts marked. */
.parts { background: #fff; border-radius: 20px; box-shadow: 0 0 0 1px var(--line); padding: clamp(16px, 2vw, 24px); display: grid; gap: 16px; }
.big-say { font-size: clamp(18px, 1.7vw, 22px); line-height: 1.75; background: none; padding: 0; border-radius: 0; }
.big-say span { padding: 3px 7px; border-radius: 7px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.p1, .l1::before { background: var(--p1); } .p2, .l2::before { background: var(--p2); } .p3, .l3::before { background: var(--p3); } .p4, .l4::before { background: var(--p4); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14.5px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend li::before { content: ""; width: 16px; height: 16px; border-radius: 5px; flex: none; }

/* The measuring pictures. */
.measure { background: #fff; border-radius: 20px; box-shadow: 0 0 0 1px var(--line); padding: clamp(14px, 2vw, 22px); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: center; }
.measure:has(svg:only-child) { grid-template-columns: 1fr; }
.measure svg { width: 100%; height: auto; max-height: 260px; overflow: visible; }
.cloth { fill: var(--wash-2); stroke: var(--brand); stroke-width: 1.4; stroke-linejoin: round; }
.cloth-line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; }
.foldline { fill: none; stroke: var(--ink-2); stroke-width: 1.2; stroke-dasharray: 7 3 1.5 3; }
.tape { fill: none; stroke: var(--brass-deep); stroke-width: 5; stroke-linecap: round; }
.tape.thin { stroke-width: 3.5; }
.end { fill: #fff; stroke: var(--ink); stroke-width: 1.6; }
.lbl { font: 9.5px var(--font); fill: var(--ink-2); }
.lbl.strong { font: 600 11px var(--font); fill: var(--ink); font-variant-numeric: tabular-nums; }
.hows { list-style: none; margin: 0; padding: 0; font-size: 14.5px; line-height: 1.35; color: var(--ink-2); }
.hows li { padding: 10px 0; border-top: 1px solid var(--line); }
.hows li:first-child { border-top: 0; }
.hows b { display: block; color: var(--ink); font-weight: 600; }

/* Ell asks, you answer. */
.talk { background: #fff; border-radius: 20px; box-shadow: 0 0 0 1px var(--line); padding: 16px; display: grid; gap: 14px; }
.ell-says { display: flex; align-items: flex-end; gap: 10px; }
.ell-says .ell { width: 40px; height: 40px; }
.ell-says span { background: #fff; box-shadow: 0 0 0 1px var(--line); border-radius: 18px 18px 18px 4px; padding: 11px 16px; font-size: 16px; line-height: 1.4; }
.talk .col { box-shadow: 0 0 0 1px var(--line); }

/* Two ways in, kept apart. */
.roads { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 14px; align-items: center; }
.road { background: #fff; border-radius: 20px; box-shadow: 0 0 0 1px var(--line); padding: 20px; display: grid; gap: 6px; height: 100%; align-content: start; }
.road svg { width: 64px; height: 64px; margin-bottom: 6px; }
.road .body { fill: var(--wash-2); stroke: var(--brand); stroke-width: 1.4; }
.road b { font: 500 19px/1.15 var(--display); letter-spacing: -.012em; }
.road span { color: var(--ink-2); font-size: 15.5px; line-height: 1.4; }

/* The strip after a change, as the app shows it. */
.strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #fff; border-radius: 14px; box-shadow: 0 0 0 1px var(--line), 0 10px 24px rgba(27,53,46,.08); padding: 8px 8px 8px 16px; width: fit-content; max-width: 100%; font-size: 15px; }
.strip-words { margin-right: 10px; }
.strip-btn { padding: 8px 14px; border-radius: 9px; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
.strip-btn.on { background: var(--brand); color: #fff; box-shadow: none; }
.asks { display: grid; gap: 8px; justify-items: start; }
.cream .say { background: #fff; box-shadow: 0 0 0 1px var(--line); }
.cream .col .say { background: var(--wash); box-shadow: none; }

/* ---- the battery: which message takes how much ---- */
.batt-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.batt-grid .plain b { color: #fff; font-weight: 600; }
.sips { display: grid; gap: 18px; padding: clamp(20px, 2.6vw, 34px); border-radius: 22px; background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.sip { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; align-items: center; font-size: 16px; line-height: 1.3; }
.sip span { grid-column: 1 / -1; color: #fff; }
.sip i { height: 12px; border-radius: 6px; background: var(--brass); width: calc(var(--w) * 5%); min-width: 12px; }
.sip b { font: 500 14.5px var(--display); color: var(--on-dark); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sips > p { font-size: 13.5px; color: var(--on-dark-2); border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; }

/* ---- the card to print ---- */
.card-sheet { background: #fff; border-radius: 22px; box-shadow: 0 0 0 1px var(--line), 0 24px 60px rgba(27,53,46,.10); padding: clamp(22px, 3vw, 40px); margin-top: clamp(28px, 5vh, 48px); max-width: 980px; }
.card-sheet > header { display: flex; align-items: center; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.card-sheet > header .ell { width: 60px; height: 60px; }
.card-sheet > header b { display: block; font: 500 clamp(24px, 2.4vw, 32px)/1.05 var(--display); letter-spacing: -.026em; }
.card-sheet > header span { color: var(--ink-2); }
.card-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(24px, 4vw, 56px); padding: 22px 0; }
.card-cols h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--brand); margin-bottom: 12px; }
.card-cols h3:not(:first-child) { margin-top: 22px; }
.legend.tall { display: grid; gap: 9px; font-size: 16px; }
.legend.tall li { display: grid; grid-template-columns: 16px 6.2em 1fr; }
.legend.tall b { color: var(--ink); font-weight: 600; }
.card-line { color: var(--ink-2); font-size: 16px; line-height: 1.45; }
.card-line b { color: var(--ink); font-weight: 600; }
.card-cols ol { list-style: none; counter-reset: h; margin: 0; padding: 0; display: grid; gap: 0; font-size: 17px; line-height: 1.3; }
.card-cols ol li { counter-increment: h; display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.card-cols ol li:first-child { border-top: 0; padding-top: 0; }
.card-cols ol li::before { content: counter(h); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font: 500 15px/1 var(--display); }
.card-sheet > footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 15px; }
.card-sheet > footer span { color: var(--muted); }
.card-actions { margin-top: 26px; }
button.btn { cursor: pointer; }

@media (max-width: 900px) {
  .habit, .batt-grid { grid-template-columns: 1fr; }
  .habit { gap: 22px; }
}
@media (max-width: 620px) {
  .pair, .measure, .card-cols { grid-template-columns: 1fr; }
  .roads { grid-template-columns: 1fr; }
  .roads > .or { text-align: center; padding: 0; }
  .legend.tall { font-size: 15px; }
  .legend.tall li { grid-template-columns: 16px 5.4em 1fr; align-items: start; }
}

/* Printing from the page gives the card alone, on one sheet. The whole guide as a PDF is made by
   scripts/make-ask-ell.mjs, which opens the page with ?pdf (the class "pdf" on <html>). */
@media print {
  @page { size: A4; margin: 13mm 14mm; }
  html, body { background: #fff !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; animation: none !important; }
  .nav, .foot, .card-actions, .ell-hero .actions { display: none !important; }
  .wide { padding: 0 !important; max-width: none !important; }
  .rise, .up { opacity: 1 !important; transform: none !important; }
  .card-sheet { box-shadow: none; border: 1px solid #cdd3ca; margin: 0; max-width: none; }
  .card-cols { grid-template-columns: 1fr 1.1fr; }

  html:not(.pdf) :is(.ell-hero, #what, #ask, #check, #say, #battery, #card .eyebrow, #card h2) { display: none !important; }
  .pdf .keep { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 20px; font-size: 14px; }
  .pdf .keep li { padding: 10px 0 12px; }
  .pdf .keep b { font-size: 17px; }
  .pdf .sub { font-size: 24px; margin-top: 26px; }
  .pdf .sub-lede { font-size: 15px; margin-top: 8px; }
  .pdf .always { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pdf .always .more-card { break-inside: avoid; }
  .pdf .always .more-card p:not(.say), .pdf .always .stuck ol { font-size: 14px; }
  .pdf .always .stuck { background: var(--brand-deep); }
  .pdf #battery { break-before: auto; margin-top: 22px; }
  .pdf #check { break-before: auto; margin-top: 30px; }
  .pdf .big, .pdf .eyebrow { break-after: avoid; }
  html:not(.pdf) .band { padding: 0 !important; background: #fff !important; }

  /* The cover: the hero as one dark sheet. */
  .pdf .ell-hero { height: 270mm; border-radius: 22px; padding: 0; display: grid; align-content: center; justify-items: center; break-after: page; }
  .pdf .ell-hero .ell { width: 150px; }
  .pdf .ell-hero h1 { font-size: 78px; }
  .pdf .ell-hero .hero-sub { font-size: 21px; }
  .pdf .ell-hero::after { content: "The guide to asking Ell · ellwand.app/ask-ell"; position: absolute; bottom: 14mm; left: 0; right: 0; text-align: center; font: 500 12px var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--on-dark-2); }

  .pdf .band { padding: 0 !important; background: #fff !important; break-before: page; }
  .pdf .big { font-size: 34px; }
  .pdf .lede { font-size: 18px; margin-top: 14px; }
  .pdf .eyebrow { margin-bottom: 12px; }
  .pdf .more-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
  .pdf .more-card { padding: 16px; border-radius: 16px; background: var(--canvas); box-shadow: none; }
  .pdf .more-card h3 { font-size: 19px; }
  .pdf .know ul { font-size: 13.5px; }
  .pdf .aside { font-size: 15px; }

  .pdf .habit { grid-template-columns: 1fr; gap: 14px; padding: 20px 0; break-inside: avoid; }
  .pdf .habit:first-of-type { margin-top: 18px; }
  .pdf .habit-words { display: grid; grid-template-columns: 40px 1fr; column-gap: 14px; align-items: start; }
  .pdf .habit-words .num { width: 40px; height: 40px; font-size: 20px; margin: 0; grid-row: span 2; }
  .pdf .habit h3 { font-size: 24px; align-self: center; }
  .pdf .habit-words p { font-size: 15px; max-width: none; margin-top: 6px; }
  .pdf .habit-show { gap: 10px; padding-left: 54px; }
  .pdf .say, .pdf .ell-says span { font-size: 14px; padding: 8px 13px; }
  .pdf .big-say { font-size: 17px; padding: 0; }
  .pdf .note { font-size: 13.5px; max-width: none; }
  .pdf .col, .pdf .parts, .pdf .measure, .pdf .talk, .pdf .road { background: var(--canvas); box-shadow: none; padding: 13px; border-radius: 14px; }
  .pdf .talk .col { background: #fff; }
  .pdf .cream .say { box-shadow: 0 0 0 1px var(--line); }
  .pdf .measure svg { max-height: 150px; }
  .pdf .hows { font-size: 13px; }
  .pdf .road span { font-size: 13.5px; }
  .pdf .strip { box-shadow: 0 0 0 1px var(--line); font-size: 14px; }

  /* The battery: a dark sheet inside the margins. */
  .pdf #battery { background: var(--brand-deep) !important; border-radius: 22px; padding: 28px !important; break-inside: avoid; }
  .pdf .batt-grid { grid-template-columns: 1fr; gap: 22px; }
  .pdf .plain { margin-top: 16px; font-size: 15px; }
  .pdf .sip { font-size: 15px; }

  .pdf .card-sheet { margin-top: 20px; padding: 24px; }
}
