/* TOUCH Parenting | Family Love Language Map
   Brand colours from the TOUCH Communications Toolkit (Oct 2026) */
:root {
  --red: #E1251B;
  --slate: #455560;
  --cream: #EFE9DD;
  --blue: #7991A6;
  --pink: #F4BCAA;
  --white: #FFFFFF;
  --card: #FFFDF8;
  --line: #DDD4C3;
  --soft: #F7F2E8;
  --muted: #6A7782;

  /* Love language colours (drawn from the brand palette) */
  --c-words: #E1251B;
  --c-time: #E07A1F;
  --c-touch: #D6577A;
  --c-service: #5E7A93;
  --c-gifts: #455560;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(69, 85, 96, .08), 0 4px 16px rgba(69, 85, 96, .06);
  --font: "Red Hat Display", "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tap: 44px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.55;
  color: var(--slate);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--red); }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }

h1, h2, h3, .h3, .h4 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-weight: 900; font-size: clamp(2rem, 7vw, 2.8rem); color: var(--red); letter-spacing: -.01em; }
h2 { font-weight: 900; font-size: clamp(1.6rem, 5.5vw, 2.1rem); color: var(--red); }
.h3 { font-weight: 700; font-size: 1.25rem; color: var(--slate); margin-top: 1.6em; }
.h4 { font-weight: 700; font-size: 1.05rem; color: var(--slate); }
p { margin: 0 0 .8em; }
.lead { font-size: 1.12rem; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--blue); margin: 0 0 .4em; }

/* ---------- Top bar ---------- */
.topbar { background: var(--cream); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.brand { background: none; border: 0; padding: 8px 0; cursor: pointer; }
.brand img { height: 34px; width: auto; }

/* ---------- Stepper ---------- */
.stepper { background: var(--cream); position: sticky; top: 60px; z-index: 25; border-bottom: 1px solid var(--line); }
.stepper-inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding-top: 8px; padding-bottom: 8px; }
.step-tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: 0; padding: 6px 2px; border-radius: var(--radius-sm); cursor: pointer;
  color: var(--muted); font-weight: 700; font-size: .82rem; min-height: var(--tap);
}
.step-tab .num {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--line); background: var(--white); font-size: .85rem;
}
.step-tab.done .num { background: var(--blue); border-color: var(--blue); color: var(--white); }
.step-tab[aria-current="step"] { color: var(--red); }
.step-tab[aria-current="step"] .num { background: var(--red); border-color: var(--red); color: var(--white); }
@media (min-width: 560px) {
  .step-tab { flex-direction: row; justify-content: center; gap: 8px; font-size: .95rem; }
}

/* ---------- Panels ---------- */
.panel { padding: 24px 0 120px; }
.hero { padding-bottom: 48px; }

.why {
  background: var(--white); border-left: 5px solid var(--red); border-radius: var(--radius-sm);
  padding: 12px 16px; margin: 8px 0 20px; box-shadow: var(--shadow);
}
.why strong { color: var(--red); display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.why .info-ico { flex: none; }
.why p { margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 10px 18px; border-radius: 999px; border: 2px solid transparent;
  font-weight: 700; cursor: pointer; text-decoration: none; line-height: 1.2; text-align: center;
  transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:focus-visible, .step-tab:focus-visible, .chip:focus-visible, .heart:focus-visible, .seg button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, .brand:focus-visible {
  outline: 3px solid var(--slate); outline-offset: 2px;
}
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: #C81F16; }
.btn-secondary { background: var(--white); color: var(--slate); border-color: var(--slate); }
.btn-secondary:hover { background: var(--soft); }
.btn-quiet { background: transparent; color: var(--slate); }
.btn-quiet:hover { background: rgba(69, 85, 96, .08); }
.btn-danger { background: transparent; color: var(--red); }
.btn-sm { white-space: nowrap; min-height: 38px; padding: 6px 14px; font-size: .92rem; }
.btn-lg { min-height: 54px; padding: 14px 24px; font-size: 1.05rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.cta-row { display: grid; gap: 10px; margin: 24px 0 8px; }
@media (min-width: 560px) { .cta-row { grid-template-columns: auto auto; justify-content: start; } }
.privacy { display: flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--muted); }

/* ---------- How it works ---------- */
.how { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.how li { display: flex; gap: 12px; background: var(--white); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.how-num { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--red); color: var(--white); display: grid; place-items: center; font-weight: 900; }
.how strong { display: block; }
.how div > span { color: var(--muted); font-size: .95rem; }
.how .how-num { color: var(--white); font-size: 1rem; }

/* ---------- Language list (welcome) ---------- */
.lang-list { display: grid; gap: 8px; }
.lang-item { background: var(--white); border-radius: var(--radius-sm); box-shadow: var(--shadow); overflow: hidden; }
.lang-item summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; align-items: center; gap: 10px; font-weight: 700; min-height: var(--tap); }
.lang-item summary::-webkit-details-marker { display: none; }
.lang-item summary::after { content: "+"; margin-left: auto; font-size: 1.3rem; color: var(--muted); }
.lang-item[open] summary::after { content: "–"; }
.lang-item .body { padding: 0 14px 14px 36px; color: var(--slate); }
.dot { width: 12px; height: 12px; border-radius: 4px; flex: none; display: inline-block; }

.note { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 24px; }
.note.gentle { background: var(--white); }

/* ---------- Banner ---------- */
.banner { background: #FCE3DA; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.banner p { margin: 0 0 10px; font-weight: 700; }

/* ---------- Person cards ---------- */
.people { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.person { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.person-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 0; }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: .9rem; color: var(--white); background: var(--slate); }
.person.child .avatar { background: var(--blue); }
.name-input {
  flex: 1; min-width: 0; border: 0; border-bottom: 2px solid var(--line); background: transparent;
  font-weight: 700; font-size: 1.1rem; padding: 6px 2px; border-radius: 0;
}
.name-input:focus { outline: none; border-bottom-color: var(--red); }
.icon-btn { flex: none; background: none; border: 0; width: var(--tap); height: var(--tap); border-radius: 50%; cursor: pointer; color: var(--muted); font-size: 1.3rem; }
.icon-btn:hover { background: rgba(69, 85, 96, .08); color: var(--red); }
.person-body { padding: 12px 14px 14px; }
.field-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.field-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); width: 100%; margin-bottom: -2px; }

.seg { display: inline-flex; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 6px 14px; min-height: 38px; font-weight: 700; font-size: .9rem; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--slate); color: var(--white); }
#adultPicker { margin-bottom: 16px; }

select.age {
  min-height: 42px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 34px 6px 14px; background: var(--white);
  font-weight: 700; font-size: .9rem; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23455560' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}

.scores { display: grid; gap: 8px; }
.score-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--soft); }
.score-row:first-child { border-top: 0; }
.score-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .98rem; line-height: 1.25; }
.num-input {
  width: 84px; min-height: var(--tap); border: 2px solid var(--line); border-radius: var(--radius-sm);
  text-align: center; font-weight: 700; font-size: 1.05rem; background: var(--white);
}
.num-input:focus { outline: none; border-color: var(--slate); }
.hearts { display: flex; gap: 2px; }
.heart { width: 36px; height: var(--tap); border: 0; background: none; cursor: pointer; padding: 0; display: grid; place-items: center; border-radius: 8px; }
.heart svg { width: 24px; height: 24px; }
.heart path { fill: #E4DCCB; transition: fill .1s; }
.heart.on path { fill: var(--hc, var(--red)); }
@media (max-width: 400px) { .heart { width: 28px; } .heart svg { width: 21px; height: 21px; } .score-name { font-size: .9rem; } }

.mini { margin-top: 12px; }
.mini-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--soft); }
.mini-bar span { height: 100%; }
.status { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; color: var(--muted); margin-top: 6px; }
.status .ok { color: #2F7D5B; font-weight: 700; }
.status .warn { color: var(--red); font-weight: 700; }

.add-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
@media (max-width: 400px) { .add-row { grid-template-columns: 1fr; } }

details.tip { background: var(--white); border-radius: var(--radius-sm); padding: 4px 14px; box-shadow: var(--shadow); }
details.tip summary { cursor: pointer; font-weight: 700; min-height: var(--tap); display: flex; align-items: center; }
details.tip ul { padding-left: 18px; margin-top: 0; }
details.tip li { margin-bottom: 6px; }

/* ---------- Map ---------- */
.top-chips { display: grid; gap: 8px; margin-bottom: 16px; }
.top-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: var(--white); border-radius: var(--radius-sm); padding: 10px 12px; box-shadow: var(--shadow); }
.top-chip b { margin-right: 4px; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 10px; font-size: .82rem; font-weight: 700; color: var(--white); white-space: nowrap; }

.legend { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 16px; background: var(--white); border-radius: var(--radius-sm); padding: 12px; box-shadow: var(--shadow); }
.legend div { display: flex; gap: 10px; align-items: center; font-size: .85rem; line-height: 1.35; }
@media (min-width: 640px) { .legend { grid-template-columns: 1fr 1fr; } }
.legend .tag { min-width: 112px; text-align: center; }

.tag { display: inline-block; flex: none; font-size: .7rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.tag.shared { background: var(--slate); color: var(--white); }
.tag.partial { background: var(--white); color: var(--slate); border: 2px solid var(--slate); }
.tag.solo { background: var(--white); color: var(--red); border: 2px dashed var(--red); }
.tag.quiet { background: var(--soft); color: var(--muted); border: 1px solid var(--line); }

.map { display: grid; gap: 12px; }
.map-row { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; border-top: 5px solid var(--lc); }
.map-row-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.map-row-head h3 { font-size: 1.08rem; font-weight: 700; margin: 0; }
.map-row-head .sub { display: block; font-size: .85rem; color: var(--muted); font-weight: 500; }
.bar-line { display: grid; grid-template-columns: minmax(70px, 30%) 1fr 48px; align-items: center; gap: 8px; padding: 4px 0; font-size: .92rem; }
.bar-line .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-line .who small { color: var(--muted); }
.bar-track { height: 14px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--lc); opacity: .35; }
.bar-line.top .bar-fill { opacity: 1; }
.bar-line.top .who { font-weight: 700; }
.bar-line .pct { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.star { color: var(--lc); font-size: .8rem; }

.empty { background: var(--white); border-radius: var(--radius); padding: 24px 16px; text-align: center; box-shadow: var(--shadow); }
.empty p { margin-bottom: 14px; }

/* ---------- Insights ---------- */
.insights { display: grid; gap: 12px; }
.insight { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; border-left: 6px solid var(--lc); }
.insight-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.insight h3 { margin: 0; font-size: 1.12rem; font-weight: 700; }
.insight p:last-child { margin-bottom: 0; }
.idea { background: var(--soft); border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 10px; font-size: .95rem; }
.idea b { color: var(--red); display: block; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Plan ---------- */
.heads-up { background: var(--slate); color: var(--white); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.heads-up h3 { color: var(--white); font-size: 1.12rem; }
.heads-up b.lbl { display: block; color: var(--pink); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 2px; }
.heads-up p { margin: 0; }
.plan-list { display: grid; gap: 12px; }
.plan-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.plan-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.plan-top h4 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.plan-top h4 small { color: var(--muted); font-weight: 500; font-size: .85rem; }
.effort { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius-sm); padding: 10px 12px; margin: 8px 0; font-size: .95rem; }
.effort strong { display: block; }
.effort.natural { background: #E5ECF1; }
.effort.reach { background: #FBEBDD; }
.effort.plan { background: #FCE3DA; }
.effort.plan strong { color: var(--red); }
.effort .ico { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: var(--white); font-size: .85rem; }
.effort.natural .ico { background: var(--c-service); }
.effort.reach .ico { background: var(--c-time); }
.effort.plan .ico { background: var(--red); }
.try { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 10px; }
.try p { margin: 0; }
.try .btn { padding-left: 0; color: var(--red); }
.try b { display: block; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.action-row { display: grid; gap: 10px; margin: 20px 0; }
@media (min-width: 560px) { .action-row { grid-template-columns: auto auto; justify-content: start; } }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(239, 233, 221, .96); backdrop-filter: blur(6px); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-inner { display: flex; justify-content: space-between; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
.bottom-inner .btn { flex: 1; max-width: 220px; }
.bottom-inner .btn-primary { margin-left: auto; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 50;
  background: var(--slate); color: var(--white); border-radius: 999px; padding: 10px 10px 10px 18px;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: calc(100% - 32px); font-size: .95rem;
}
.toast button { background: var(--white); color: var(--slate); border: 0; border-radius: 999px; padding: 6px 12px; font-weight: 700; cursor: pointer; }

/* ---------- Footer ---------- */
.footer { background: var(--slate); color: var(--white); padding: 32px 0 calc(110px + env(safe-area-inset-bottom)); }
.footer a { color: var(--white); }
.footer-logo { height: 40px; width: auto; margin-bottom: 14px; }
.footer .small { opacity: .85; }

/* ---------- Print ---------- */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 11pt; }
  .topbar { position: static; border: 0; }
  .stepper, .bottom-nav, .toast, .footer, .action-row, .why, #adultPicker, .icon-btn, .panel[data-step="0"], .panel[data-step="1"], .note.gentle, .try .btn { display: none !important; }
  .panel[data-step="2"], .panel[data-step="3"], .panel[data-step="4"] { display: block !important; padding: 0 0 10mm; }
  .panel[data-step="3"], .panel[data-step="4"] { break-before: page; }
  .plan-adult { display: block !important; break-inside: avoid-page; margin-bottom: 8mm; }
  .print-only { display: block; }
  .map-row, .insight, .plan-card, .heads-up { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .heads-up { background: #fff; color: var(--slate); }
  .heads-up h3 { color: var(--slate); }
  .heads-up b.lbl { color: var(--red); }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Icons ---------- */
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.btn .ico { width: 20px; height: 20px; }
.with-ico { display: flex; align-items: center; gap: 8px; }
.h3.with-ico .ico, .h4.with-ico .ico { color: var(--red); width: 22px; height: 22px; }
summary.with-ico .ico { color: var(--red); }
.footer .with-ico .ico { color: var(--white); }
.why strong .info-ico { width: 20px; height: 20px; color: var(--red); }
.page-title { display: flex; align-items: center; gap: 12px; }
.title-ico { flex: none; width: 44px; height: 44px; border-radius: 50%; background: #FCE3DA; color: var(--red); display: grid; place-items: center; }
.title-ico .ico { width: 24px; height: 24px; }
.lang-ico { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--white); }
.lang-ico .ico { width: 17px; height: 17px; }
.score-name .lang-ico { width: 26px; height: 26px; }
.with-lang { display: flex; align-items: center; gap: 10px; }
.map-row-head .lang-ico, .insight .lang-ico { width: 34px; height: 34px; border-radius: 10px; }
.map-row-head .lang-ico .ico, .insight .lang-ico .ico { width: 20px; height: 20px; }
.pill .ico { width: 14px; height: 14px; }
.idea b, .try b, .heads-up b.lbl { display: flex; align-items: center; gap: 6px; }
.idea b .ico, .try b .ico, .heads-up b.lbl .ico { width: 16px; height: 16px; }
.try .btn .ico { width: 16px; height: 16px; }
