/* Influence planning – styles */
@font-face { font-family: 'Poppins'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/poppins-regular.woff') format('woff'); }
@font-face { font-family: 'Poppins'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/poppins-medium.woff') format('woff'); }
@font-face { font-family: 'Poppins'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/poppins-bold.woff') format('woff'); }

:root {
  --navy: #1e365c;
  --teal: #00aeb9;
  --dark-teal: #00768a;
  --coral: #ff6a5a;
  --yellow: #ffbc42;
  --grey: #f4f4f8;
  --line: #c9ced6;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--navy);
  background: #fff;
  padding-bottom: env(safe-area-inset-bottom);
}
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 12px; font-weight: 700; }
h2 { font-size: 22px; }
h3 { font-size: 18px; margin-top: 20px; }
p { margin: 0 0 12px; }
ul, ol { margin: 0 0 12px; padding-left: 22px; }
li { margin-bottom: 4px; }
a { color: var(--dark-teal); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  background: #fff;
  border-bottom: 3px solid var(--teal);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); font-weight: 700; font-size: 18px; }
.brand img { display: block; }

main { max-width: 720px; margin: 0 auto; padding: 20px 16px 120px; outline: none; }

/* Cards */
.card { background: #fff; padding: 0; margin: 0 0 24px; }
.card--field { background: var(--grey); padding: 16px; }
.muted { font-size: 14px; }

/* Buttons – Chartwell website style */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 18px;
  background: #fff; color: var(--navy);
  border: 1px solid var(--navy);
  font-weight: 700; font-size: 15px;
  text-decoration: none; cursor: pointer;
  box-shadow: 4px 4px 0 var(--coral);
  transition: box-shadow .15s, transform .15s;
}
.btn:hover { box-shadow: 2px 2px 0 var(--coral); transform: translate(1px, 1px); }
.btn:active { box-shadow: 0 0 0 var(--coral); transform: translate(3px, 3px); }
.btn--primary { }
.btn--nav { box-shadow: 4px 4px 0 var(--teal); }
.btn--nav:hover { box-shadow: 2px 2px 0 var(--teal); }
.btn--nav:active { box-shadow: 0 0 0 var(--teal); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 16px 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--dark-teal); text-decoration: underline; cursor: pointer; font-weight: 500; }

/* Plan list */
.plans { list-style: none; padding: 0; margin: 0; }
.plan-item { background: var(--grey); margin: 0 0 12px; display: flex; align-items: stretch; border-left: 6px solid var(--teal); }
.plan-item__open { flex: 1; display: block; padding: 14px 16px; text-decoration: none; color: var(--navy); min-width: 0; }
.plan-item__name { display: block; font-weight: 700; overflow-wrap: anywhere; }
.plan-item__meta { display: block; font-size: 14px; }
.plan-item__del { background: none; border: 0; border-left: 1px solid #fff; padding: 0 16px; cursor: pointer; font-size: 14px; color: var(--navy); }
.empty { background: var(--grey); padding: 20px; }
.hero { margin: 0 0 24px; }
.hero__img { display: block; width: 100%; height: auto; }
.hero__slot { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: #fff; border: 2px dashed var(--line); font-size: 14px; text-align: center; padding: 16px; }
.hero h1 { font-size: 28px; margin: 20px 0 12px; }
.home-plans { margin-top: 32px; }
.home-plans h2 { font-size: 20px; }

.tip { background: var(--grey); border: 2px solid var(--yellow); padding: 14px 16px; margin: 0 0 16px; font-size: 15px; }
.tip p:last-child { margin: 0; }

/* Step tracker */
.tracker { list-style: none; margin: 0 0 6px; padding: 0; display: flex; justify-content: space-between; position: relative; }
.tracker::before { content: ''; position: absolute; left: 22px; right: 22px; top: 21px; height: 2px; background: var(--line); }
.tracker li { position: relative; margin: 0; }
.tracker button {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--line); background: #fff; color: var(--navy);
  font-weight: 700; cursor: pointer; padding: 0;
}
.tracker .is-done button { border-color: var(--dark-teal); color: var(--dark-teal); }
.tracker .is-current button { background: var(--yellow); border-color: var(--yellow); color: var(--navy); }
.tracker-label { text-align: center; font-weight: 500; font-size: 14px; margin: 0 0 16px; }
.back-link { display: inline-block; margin: 0 0 14px; font-size: 14px; }

/* Fields */
.field { margin: 16px 0 0; }
.field label { display: block; font-weight: 700; margin: 0 0 6px; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--navy);
  border: 1px solid var(--navy); background: #fff; padding: 10px 12px; border-radius: 0;
}
.field textarea { min-height: 140px; resize: vertical; }
.saved { font-size: 13px; min-height: 20px; margin: 6px 0 0; }

/* Style circle */
.circle {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 50%;
  font-weight: 700; font-size: 14px;
}

/* Quick guide boxes (step 2) */
.styles-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0 0 16px; }
@media (min-width: 600px) { .styles-grid { grid-template-columns: 1fr 1fr; } }
.style-box { background: #fff; padding: 16px; border-top: 6px solid; }
.style-box h3 { margin: 0 0 8px; display: flex; align-items: center; gap: 10px; }
.style-box ul { font-size: 15px; margin: 0; }

/* Checklist */
.style-section { background: #fff; margin: 0 0 24px; padding: 0; }
.style-section > h3 { padding-bottom: 10px; border-bottom: 6px solid; border-color: inherit; }
.style-section > h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.stmt { border: 0; margin: 0 0 10px; padding: 14px; background: var(--grey); }
.stmt legend { padding: 0; margin: 0 0 8px; font-weight: 500; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.scale label { position: relative; display: block; cursor: pointer; }
.scale input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scale span {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  min-height: 58px; padding: 6px 2px;
  border: 1px solid var(--line); background: #fff; text-align: center;
  font-size: 12px; line-height: 1.2;
}
.scale span b { font-size: 17px; line-height: 1.2; }
.scale input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 1px; }
.scale input:checked + span { background: var(--sc); border-color: var(--sc); color: var(--si); }

.totals {
  position: sticky; bottom: 0; z-index: 10;
  background: var(--navy); color: #fff;
  margin: 0 -16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.totals__row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.totals__item { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.totals__item .circle { width: 30px; height: 30px; font-size: 11px; }
.totals__item b { font-size: 17px; }
.totals__count { font-size: 13px; margin: 6px 0 0; }
.totals.is-done { background: var(--dark-teal); }

.result { background: var(--grey); padding: 16px 20px; margin: 16px 0; border: 1px solid var(--navy); }
.result__row { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.result__row:last-child { margin: 0; }
.result__label { display: block; font-size: 14px; }
.result__value { display: block; font-weight: 700; font-size: 18px; }
.notice { background: var(--grey); border: 2px solid var(--yellow); padding: 14px 16px; margin: 16px 0; }
.notice p:last-child { margin: 0; }

/* Toolkits (step 3) */
.toolkit { background: #fff; margin: 0 0 16px; border: 1px solid var(--line); border-top: 6px solid; padding: 16px; }
.toolkit__head { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.toolkit__head h3 { margin: 0; }
.toolkit__kicker { display: block; font-size: 13px; font-weight: 500; }
.toolkit h4 { font-size: 16px; margin: 14px 0 6px; }
.toolkit ul { margin: 0; }
.cue { margin: 0 0 10px; }
.cue b { display: block; }
.cue ul { list-style: none; padding: 0; }
.cue li { margin: 0 0 2px; }
.all-styles summary { cursor: pointer; color: var(--dark-teal); font-weight: 700; text-decoration: underline; margin: 0 0 16px; min-height: 44px; display: flex; align-items: center; }

.step-nav { display: flex; justify-content: space-between; gap: 12px; margin: 24px 0 0; }
.actions-card h3 { margin-top: 0; }

/* Dialog */
.dialog { position: fixed; inset: 0; background: rgba(30, 54, 92, .55); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.dialog[hidden] { display: none; }
.dialog__box { background: #fff; padding: 20px; max-width: 420px; width: 100%; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 14px; margin-top: 16px; }

/* Print / Save as PDF */
#print { display: none; }
@media print {
  @page { margin: 16mm; }
  body { background: #fff; font-size: 11pt; }
  .top, main, .dialog { display: none !important; }
  #print { display: block; }
  #print h1 { font-size: 18pt; }
  #print h2 { font-size: 13pt; margin: 16pt 0 4pt; }
  #print .pr-block { white-space: pre-wrap; border-left: 3pt solid var(--teal); padding: 2pt 0 2pt 8pt; margin: 0 0 8pt; }
  #print table { border-collapse: collapse; width: 100%; }
  #print td, #print th { border-bottom: 1px solid #c9ced6; text-align: left; padding: 3pt 4pt; vertical-align: top; }
  #print .pr-style { break-inside: avoid; }
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.totals__item .circle { box-shadow: 0 0 0 2px #fff; }
.card--field .field { margin: 0; }
.style-section .stmt:last-child { margin-bottom: 0; }
.stmt legend { float: left; width: 100%; }
.stmt .scale { clear: both; }
