/* At Ease with AI: layout and components. Uses only the tokens in theme.css.
   Rules this file keeps: one column for reading, nothing moves on its own, no hover-only or drag-only actions,
   every control at least --target tall, state never shown by color alone, no picture behind text. */

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text);
  line-height: var(--line);
}
/* A faint sunrise in the empty margin, only when the margin is wide enough to hold it clear of the text */
@media (min-width: 66rem) {
  body {
    background-image: var(--backdrop);
    background-repeat: no-repeat;
    background-position: right top;
    background-size: min(30rem, calc((100vw - 48rem) / 2)) auto;
  }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: var(--title); }
h2 { font-size: var(--text-large); }
h3 { font-size: var(--text); }
p { margin: 0 0 1em; max-width: var(--measure); }
a { color: var(--primary); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
strong { font-weight: 700; }
.small { font-size: var(--text-small); color: var(--ink-soft); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* Headings receive focus when a new screen appears, so screen readers announce it; no ring needed */
[tabindex="-1"]:focus { outline: none; box-shadow: none; }

:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 9px var(--focus-halo);
}

/* Icons: line drawings from assets/icons.svg in the text color. Always beside words, never alone. */
.icon {
  flex: none; width: var(--icon); height: var(--icon);
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: middle;
}
/* A large icon in a soft tinted circle */
.tile-icon {
  flex: none; display: grid; place-items: center;
  width: var(--icon-circle); height: var(--icon-circle);
  color: var(--icon-ink); background: var(--icon-bg);
  border-radius: 50%;
}
.tile-icon .icon { width: var(--icon-big); height: var(--icon-big); }
.step-icon {
  display: block; width: var(--icon-circle); height: var(--icon-circle); padding: 0.75rem; margin: 0 0 0.75rem;
  color: var(--icon-ink); background: var(--icon-bg); border-radius: 50%;
}

/* Page frame */
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem;
  padding: 0.5rem 1rem;
  border-bottom: 4px solid var(--top-line);
  background: var(--surface);
}
.brand {
  display: inline-flex; align-items: center; gap: 0.75rem; min-height: var(--target);
  font-weight: 700; font-size: var(--text); line-height: 1.2; color: var(--ink); text-decoration: none;
}
.brand-mark { flex: none; width: 2.75rem; height: 2.75rem; }
.top-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.page { max-width: 44rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.where { font-size: var(--text-small); color: var(--ink-soft); margin: 0 0 0.75rem; font-weight: 600; }
.foot { max-width: 44rem; margin: 0 auto; padding: 1rem; border-top: var(--border-width) solid var(--line-soft); }
.foot p { font-size: var(--text-small); color: var(--ink-soft); max-width: none; margin: 0 0 0.5em; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: var(--target); min-width: var(--target);
  padding: 0.5rem 1.5rem;
  font: inherit; font-weight: 700; line-height: 1.25; text-align: center; text-decoration: none;
  color: var(--primary); background: var(--surface);
  border: var(--border-width) solid var(--primary); border-radius: var(--radius);
  cursor: pointer;
  touch-action: manipulation;
}
.btn:has(> .icon:first-child) { padding-left: 1.125rem; }
.btn:has(> .icon:last-child) { padding-right: 1.125rem; }
.top .btn { padding: 0.375rem 1rem; }
.btn-primary { color: var(--on-primary); background: var(--primary); }
.btn-quiet { border-color: transparent; background: transparent; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.btn[disabled] { opacity: 1; color: var(--ink-soft); background: var(--surface); border-style: dashed; border-color: var(--border); cursor: default; }
.btn-wide { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: var(--gap); margin-top: 1.5rem; align-items: center; }
.actions .push { margin-left: auto; }

/* Choices: big, full-width, with a visible tick as well as a color change */
.choices { display: grid; gap: var(--gap); margin: 1rem 0 0; padding: 0; list-style: none; }
.choice {
  display: flex; align-items: center; gap: 1rem; width: 100%;
  min-height: var(--target); padding: 0.75rem 1rem;
  font: inherit; font-weight: 600; text-align: left; line-height: 1.3;
  color: var(--ink); background: var(--surface);
  border: var(--border-width) solid var(--border); border-radius: var(--radius);
  cursor: pointer; touch-action: manipulation;
}
.choice .mark, .tile .mark {
  flex: none; width: 1.75rem; height: 1.75rem; display: grid; place-items: center;
  border: var(--border-width) solid var(--border); border-radius: 0.375rem; background: var(--surface);
  font-weight: 700; line-height: 1;
}
.choice[data-kind="single"] .mark, .tile[data-kind="single"] .mark { border-radius: 50%; }
.choice[aria-pressed="true"] { background: var(--tint); border-color: var(--primary); border-width: 4px; padding: calc(0.75rem - 2px) calc(1rem - 2px); }
.choice[aria-pressed="true"] .mark, .tile[aria-pressed="true"] .mark { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.choice[aria-pressed="true"] .mark::before, .tile[aria-pressed="true"] .mark::before { content: "\2713"; }

/* Picture tiles: the interview's choices with a large icon. Two across on wide screens, one on a phone.
   Each tile is a choice, read on its own, so the page still reads as one column. */
.tiles { display: grid; grid-template-columns: 1fr; gap: var(--gap); margin: 1rem 0 0; }
@media (min-width: 40rem) { .tiles { grid-template-columns: 1fr 1fr; } }
:root[data-text="large"] .tiles { grid-template-columns: 1fr; }
.group-title {
  grid-column: 1 / -1; margin: 0.75rem 0 -0.25rem;
  font-size: var(--text); color: var(--ink-soft);
}
.group-title:first-child { margin-top: 0; }
.tile {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.75rem;
  width: 100%; min-height: var(--target); padding: 1rem;
  font: inherit; text-align: left; line-height: 1.3;
  color: var(--ink); background: var(--surface);
  border: var(--border-width) solid var(--border); border-radius: var(--radius);
  cursor: pointer; touch-action: manipulation;
}
.tile .mark { align-self: start; }
.tile-text { display: block; min-width: 0; }
.tile-label { display: block; font-weight: 700; }
.tile-eg { display: block; margin-top: 0.25rem; font-size: var(--text-small); color: var(--ink-soft); line-height: 1.35; }
.tile[aria-pressed="true"] { background: var(--tint); border-color: var(--primary); border-width: 4px; padding: calc(1rem - 2px); }
.tile[aria-pressed="true"] .tile-icon { background: var(--surface); }
:root[data-contrast="high"] .tile[aria-pressed="true"] .tile-label { text-decoration: underline; text-decoration-thickness: 2px; }

/* "Why I ask": a quiet line with a lightbulb */
.why {
  display: flex; align-items: flex-start; gap: 0.75rem;
  margin: 1.5rem 0 0; padding: 0.75rem 1rem;
  font-size: var(--text-small); color: var(--ink-soft); line-height: 1.45;
  border-left: 0.375rem solid var(--accent);
}
.why .icon { margin-top: 0.05em; color: var(--icon-ink); }
:root[data-contrast="high"] .why { border: var(--border-width) solid var(--border); border-left-width: 0.5rem; }

.field {
  width: 100%; min-height: var(--target); padding: 0.5rem 1rem;
  font: inherit; color: var(--ink); background: var(--surface);
  border: var(--border-width) solid var(--border); border-radius: var(--radius);
}

/* Blocks: a soft edge and a thin line beneath give gentle depth */
.card {
  background: var(--surface); border: var(--border-width) solid var(--line-soft); border-radius: var(--radius);
  box-shadow: var(--lift);
  padding: 1.25rem; margin: 0 0 var(--gap);
}
.card > :last-child { margin-bottom: 0; }
.tinted { background: var(--tint); }
.note { background: var(--note); border: var(--border-width) solid var(--border); border-left-width: 0.5rem; border-radius: var(--radius); padding: 1rem 1.25rem; margin: 0 0 var(--gap); }
.note > :last-child { margin-bottom: 0; }
.picture { display: block; width: 100%; max-width: 20rem; height: auto; margin: 0 0 1rem; }
.steps { margin: 0 0 1rem; padding: 0; list-style: none; counter-reset: step; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: auto 1fr; gap: 0.75rem 1rem; align-items: start; margin: 0 0 var(--gap); }
.steps > li::before {
  content: counter(step);
  width: 2.5rem; height: 2.5rem; display: grid; place-items: center;
  font-weight: 700; color: var(--on-primary); background: var(--primary); border-radius: 50%;
}
.steps > li > div > :last-child { margin-bottom: 0; }
.steps > li[data-n]::before { content: attr(data-n); } /* keeps the right number when steps show one at a time */
.say { display: block; padding: 0.75rem 1rem; background: var(--tint); border: var(--border-width) solid var(--primary); border-radius: var(--radius); font-weight: 600; }
.reply { display: block; padding: 0.75rem 1rem; background: var(--surface); border: var(--border-width) dashed var(--border); border-radius: var(--radius); }
.label { display: block; font-size: var(--text-small); font-weight: 700; color: var(--ink-soft); margin: 0 0 0.25rem; }
[hidden] { display: none !important; }

/* A heading band: a soft wash behind a page title, with an optional picture beside it (never behind) */
.hero {
  display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: center;
  margin: 0 0 1.5rem; padding: 1.5rem 1.25rem;
  background: var(--band); border: var(--border-width) solid var(--line-soft); border-radius: calc(var(--radius) * 1.5);
}
.hero > div > :last-child, .hero > :last-child { margin-bottom: 0; }
.hero h1 { margin-bottom: 0.25em; }
.hero-picture { display: none; width: 100%; height: auto; }
@media (min-width: 36rem) {
  .hero-picture { display: block; max-width: 14rem; }
  .hero { grid-template-columns: 1fr auto; padding: 1.75rem 1.75rem; }
}
:root[data-text="large"] .hero-picture { max-width: 9rem; }
.hero-icon { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; }
.hero-icon > div { flex: 1 1 16rem; }
.hero-icon > div > :last-child { margin-bottom: 0; }
.hero .tile-icon { background: var(--surface); }
.lead { font-size: var(--text-large); line-height: 1.4; }

/* Pictured points: one per row, icon then a few words */
.points { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: var(--gap); }
.point {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; background: var(--surface);
  border: var(--border-width) solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--lift);
}
.point h2 { font-size: var(--text); margin: 0 0 0.125rem; }
.point p { margin: 0; color: var(--ink-soft); }

/* My lessons */
.hello { margin: 0 0 1.5rem; padding: 1.25rem; background: var(--band); border-radius: calc(var(--radius) * 1.5); border: var(--border-width) solid var(--line-soft); }
.hello > :last-child { margin-bottom: 0; }
.next-up {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem 1.25rem; align-items: start;
  background: var(--tint); border: 4px solid var(--primary); padding: 1.25rem;
}
.next-up h2 { font-size: var(--text-small); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); margin: 0 0 0.25rem; }
.next-up .next-title { font-size: var(--text-large); font-weight: 700; line-height: 1.3; margin: 0; }
.next-up .tile-icon { background: var(--surface); }
.next-up .actions { margin-top: 1rem; }
.lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--gap); }
.lessons .choice { width: 100%; }
.lesson-row .tile-icon { --icon-circle: 3rem; --icon-big: 1.75rem; }
.lesson-row .row-text { flex: 1 1 auto; min-width: 0; }
.lesson-row .row-text .small { font-weight: 400; }
/* Done: a filled circle with a tick. Not done yet: a plain arrow, so the two differ in shape, not only color. */
.done-mark {
  flex: none; width: 2.25rem; height: 2.25rem; display: grid; place-items: center;
  color: var(--primary); border: var(--border-width) solid transparent; border-radius: 50%;
}
.done-mark.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.done-mark .icon { width: 1.5rem; height: 1.5rem; }
.done-mark.on .icon { stroke-width: 3; }

/* Things to print */
.printables { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: var(--gap); }
@media (min-width: 40rem) { .printables { grid-template-columns: 1fr 1fr; } }
:root[data-text="large"] .printables { grid-template-columns: 1fr; }
.printable {
  display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem;
  background: var(--surface); border: var(--border-width) solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--lift);
}
.printable .choice { flex: 1 1 auto; padding: 0.25rem; font-weight: 700; color: var(--primary); background: transparent; border-color: transparent; }
.printable .choice > span:last-child { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.printable .btn { width: 100%; }

/* One step at a time: only the current step shows */
:root[data-onestep="on"] [data-steps] > [data-step]:not([data-current]) { display: none; }
:root:not([data-onestep="on"]) [data-steps][data-all-ok] ~ .step-nav { display: none; }

/* Settings panel */
dialog.panel {
  width: min(36rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow: auto;
  padding: 1.25rem; color: var(--ink); background: var(--paper);
  border: 3px solid var(--primary); border-radius: var(--radius);
}
dialog.panel::backdrop { background: rgba(0, 0, 0, 0.6); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; min-height: var(--target); padding: 0.75rem 1rem; margin: 0 0 0.75rem;
  font: inherit; font-weight: 600; text-align: left; color: var(--ink); background: var(--surface);
  border: var(--border-width) solid var(--border); border-radius: var(--radius); cursor: pointer; }
.switch .state { flex: none; min-width: 3.5rem; padding: 0.25rem 0.5rem; text-align: center; font-weight: 700; border: var(--border-width) solid var(--border); border-radius: 999px; }
.switch[aria-pressed="true"] { background: var(--tint); border-color: var(--primary); }
.switch[aria-pressed="true"] .state { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* Style-guide helpers (design/index.html only) */
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.75rem; margin: 0 0 1rem; }
.swatch { border: 2px solid var(--border); border-radius: var(--radius); padding: 0.75rem; font-size: var(--text-small); font-weight: 600; color: var(--ink); }
.sw-paper { background: var(--paper); }
.sw-surface { background: var(--surface); }
.sw-tint { background: var(--tint); }
.sw-band { background: var(--band); }
.sw-note { background: var(--note); }
.sw-primary { background: var(--primary); color: var(--on-primary); }
.sw-accent { background: var(--accent); }
.sw-ink { background: var(--ink); color: var(--paper); }
.icon-sheet { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.75rem; }
.icon-sheet li { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 0.75rem 0.5rem; text-align: center;
  font-size: var(--text-small); background: var(--surface); border: var(--border-width) solid var(--line-soft); border-radius: var(--radius); overflow-wrap: anywhere; }
.icon-sheet .icon { width: 2rem; height: 2rem; color: var(--icon-ink); }
.section { margin-top: 2rem; }
code { overflow-wrap: anywhere; }

@media (max-width: 30rem) {
  .actions .btn { flex: 1 1 100%; }
  .actions .push { margin-left: 0; }
  .tile { padding: 0.75rem; gap: 0.75rem; }
  .tile[aria-pressed="true"] { padding: calc(0.75rem - 2px); }
  .tile .tile-icon, .next-up .tile-icon { --icon-circle: 3rem; --icon-big: 1.75rem; }
  .next-up { grid-template-columns: 1fr; }
  .point { padding: 0.75rem 1rem; }
  .point .tile-icon { --icon-circle: 3.25rem; --icon-big: 2rem; }
  .brand-mark { width: 2.25rem; height: 2.25rem; }
}
@media print {
  .top, .actions, .foot, dialog { display: none !important; }
  body { background: #fff; }
  .card, .point, .hero, .hello { box-shadow: none; }
}

/* Together and First Steps always show one step at a time */
[data-steps][data-always] > [data-step]:not([data-current]) { display: none; }

/* Links styled as buttons or choices are not underlined; the box already shows they can be pressed */
a.btn, a.choice { text-decoration: none; }
a.btn-quiet { text-decoration: underline; } /* a quiet link has no box, so it keeps its underline */
[data-after] { margin-top: 1.5rem; }

/* Added for the app pages */
.spaced { margin-top: 1.5rem; }
.tight { margin-top: 0.5rem; }
.block { display: block; }
.code { font-size: 2.5rem; line-height: 1.3; font-weight: 700; text-align: center; letter-spacing: 0.02em; padding: 1.5rem 1rem; background: var(--surface); border: 4px solid var(--primary); border-radius: var(--radius); overflow-wrap: anywhere; }
.mark.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.mark.on::before { content: "\2713"; }
.erase { margin-top: 1.5rem; padding-top: 1rem; border-top: var(--border-width) solid var(--border); }
.after { margin-top: 1.5rem; }
@media print {
  .code { font-size: 2.5rem; border: 4px solid #000; color: #000; background: #fff; }
  .card, .note { border-color: #000; }
  a { color: #000; }
}
/* Helper guides on paper: smaller type than the screen, so the Together guide fits two pages */
@media print {
  @page { margin: 0.5in; }
  .guide { max-width: none; padding: 0; font-size: 10.5pt; line-height: 1.3; }
  .guide h1 { font-size: 17pt; margin: 0 0 6pt; }
  .guide h2 { font-size: 12.5pt; margin: 10pt 0 3pt; break-after: avoid; }
  .guide p, .guide li { max-width: none; margin: 0 0 2pt; }
  .guide ul, .guide ol { margin: 0 0 4pt; padding-left: 16pt; }
}

/* Footer: the maker's logo, kept quiet, and the privacy link */
.foot-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.foot-logo { height: 2.25rem; width: auto; opacity: 0.8; }
:root[data-contrast="high"] .foot-logo { opacity: 1; filter: grayscale(1) contrast(2); }
.foot a { color: var(--ink-soft); }

/* A wider pop-up for longer reading, such as the privacy words */
dialog.panel-wide { width: min(46rem, calc(100vw - 2rem)); }
dialog.panel-wide h1 { font-size: var(--text-large); }
@media print { .foot-logo { opacity: 1; } }
