/* Sandler palette, sampled from assets/logos/sandler-logo-navy-cyan.png */
:root {
  --navy: #24255C;
  --cyan: #23ABE2;
  --navy-tint: #EEEEF5;
  --cyan-tint: #E8F6FD;
  --green: #16703D;
  --green-tint: #E6F4EC;
  --red: #C0392B;
  --red-tint: #FBEBE9;
  --ink: #1C1D33;
  --muted: #5D6079;
  --line: #D8DAE6;
  --paper: #FFFFFF;
  --bg: #F6F7FB;
  --radius: 8px;
  --measure: 62ch;
  --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 0 7rem;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { color: var(--navy); line-height: 1.2; }
h1 { font-size: 2rem; margin: 0 0 1rem; }
h2 { font-size: 1.5rem; margin: 0 0 .5rem; }
p { max-width: var(--measure); }
.note { color: var(--muted); font-size: .9rem; }

/* ------------------------------------------------------------- header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.logo { height: 28px; width: auto; display: block; }

.progress {
  display: flex;
  gap: .4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .78rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.progress li {
  padding: .2rem .6rem;
  border-radius: 99px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.step-num { font-weight: 700; opacity: .65; }
.progress .is-current .step-num { opacity: 1; }
.progress .is-done { color: var(--navy); }
.progress .is-current {
  color: var(--navy);
  font-weight: 600;
  background: var(--cyan-tint);
  border-color: var(--cyan);
}

/* -------------------------------------------------------------- main */

main { max-width: 900px; margin: 0 auto; padding: 1.75rem 1.25rem; }
.screen[hidden] { display: none; }

.quote {
  margin: 0 0 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  border-left: 6px solid var(--cyan);
}
.quote p { margin: 0 0 .5rem; font-size: 1.2rem; font-weight: 500; }
.quote cite { font-style: normal; font-size: .85rem; opacity: .8; }

.steps {
  max-width: var(--measure);
  margin: 0 0 1rem;
  padding-left: 1.3rem;
}
.steps li { margin-bottom: .5rem; }

.fields { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.75rem; }
.field { display: block; flex: 1 1 260px; max-width: 420px; }
.field-date { flex: 0 0 auto; max-width: 200px; }
input[type="date"] {
  width: 100%;
  font: inherit;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: inherit;
}
.field span { display: block; font-weight: 600; margin-bottom: .35rem; color: var(--navy); }

input[type="text"] {
  width: 100%;
  font: inherit;
  padding: .6rem .7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: inherit;
}
input[type="text"]:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

/* ------------------------------------------------------- pick values */

.pick-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
  margin-top: 1.25rem;
}
@media (max-width: 860px) { .pick-layout { grid-template-columns: 1fr; } }

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(218px, 1fr));
  gap: .45rem;
}

.value-row {
  display: flex;
  align-items: center;
  gap: .25rem;
  height: 2.6rem;
  padding: 0 .25rem 0 .6rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.value-row.is-towards { background: var(--green-tint); border-color: var(--green); }
.value-row.is-away { background: var(--red-tint); border-color: var(--red); }
.value-row.is-custom .value-name { font-style: italic; }

.value-name {
  flex: 1;
  min-width: 0;
  font-size: .84rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm {
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
}
.pm-plus:hover:not(:disabled),
.pm-plus.is-on { border-color: var(--green); background: var(--green); color: #fff; }
.pm-minus:hover:not(:disabled),
.pm-minus.is-on { border-color: var(--red); background: var(--red); color: #fff; }
.pm:disabled { opacity: .3; cursor: not-allowed; }

.custom-add {
  margin-top: 1.25rem;
  padding: 1rem;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.custom-add label { display: block; font-weight: 600; color: var(--navy); margin-bottom: .45rem; }
.custom-row { display: flex; gap: .4rem; align-items: center; }
.custom-row input { flex: 1; }
.custom-error { color: #B4341F; font-size: .85rem; margin: .5rem 0 0; min-height: 1em; }

/* -------------------------------------------- selections column */

.pick-side { display: grid; gap: 1rem; position: sticky; top: 1rem; }
@media (max-width: 860px) { .pick-side { position: static; } }

.box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}
.box-towards { border-left: 5px solid var(--green); }
.box-away { border-left: 5px solid var(--red); }
.box h3 { font-size: 1rem; margin: 0 0 .75rem; }
.box-count { float: right; color: var(--muted); font-weight: 400; }
.optional { font-weight: 400; font-size: .75rem; color: var(--muted); }

.chips { display: flex; flex-direction: column; gap: .45rem; }
.chip {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .4rem .35rem .5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
.chip-towards { background: var(--green-tint); border-color: var(--green); }
.chip-away { background: var(--red-tint); border-color: var(--red); }
.chip-rank {
  flex: 0 0 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
}
.chip-label { flex: 1; }
.chip-btn {
  font: inherit;
  font-size: .75rem;
  padding: .2rem .5rem;
  border-radius: 99px;
  border: 1px solid var(--navy);
  background: var(--paper);
  color: var(--navy);
  cursor: pointer;
  white-space: nowrap;
}
.chip-btn:hover:not(:disabled) { background: var(--navy); color: #fff; }
.chip-btn:disabled { opacity: .3; cursor: not-allowed; }
.chip-remove { border-color: var(--muted); color: var(--muted); font-size: .95rem; line-height: 1; }
.empty { color: var(--muted); font-size: .88rem; margin: 0; }

/* ----------------------------------------------- review screen */

.review { display: grid; gap: 1.25rem; margin-top: 1.25rem; }
.review .chip { flex-wrap: wrap; }

.chip-draggable { cursor: grab; }
.chip-draggable:active { cursor: grabbing; }
.chip-grip {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1;
  cursor: grab;
  user-select: none;
}
.chip.is-dragging { opacity: .45; }
.chip.is-drop-target { outline: 2px dashed var(--navy); outline-offset: 2px; }

/* the buttons inside a draggable chip must not start a drag of their own */
.chip-draggable .chip-btn { cursor: pointer; }

/* --------------------------------------------------------- behaviors */

.examples {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  margin: 1rem 0 1.5rem;
}
.examples summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.examples-body { padding-top: .5rem; }
.examples-body ul { margin: .25rem 0 1rem; }

.behavior-block {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 5px solid var(--cyan);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}
.behavior-away { border-left-color: var(--navy); }
.behavior-block h3 { margin: 0 0 .15rem; display: flex; align-items: center; gap: .6rem; }
.tag {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .15rem .5rem;
  border-radius: 99px;
  background: var(--cyan-tint);
  color: var(--navy);
}
.tag-away { background: var(--navy-tint); }
.stem { color: var(--muted); margin: 0 0 .75rem; font-style: italic; }
.behavior-row { margin-bottom: .4rem; }


/* ----------------------------------------------------------- results */

.results-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.sheet {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
}
.sheet-head { border-bottom: 3px solid var(--cyan); padding-bottom: .75rem; margin-bottom: 1.25rem; }
.sheet-logo { height: 24px; width: auto; display: block; margin-bottom: .75rem; }
.sheet-head h1 { margin: 0; }
.sheet-meta { color: var(--muted); margin: .25rem 0 0; font-size: .9rem; }
.sheet-group { margin-bottom: 1.5rem; }
.sheet-group h2 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: .05em; color: var(--cyan); }
.sheet-away h2 { color: var(--navy); }
.sheet-value { margin-bottom: .9rem; break-inside: avoid; }
.sheet-value h3 { margin: 0; font-size: 1.02rem; }
.sheet-value ul { margin: .2rem 0 0; padding-left: 1.1rem; }
.sheet-value li { margin-bottom: .1rem; }

/* --------------------------------------------------------------- nav */

.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  padding: .85rem 1.25rem;
  background: var(--paper);
  border-top: 1px solid var(--line);
}
#nextBtn { margin-left: auto; }
.btn {
  font: inherit;
  font-weight: 600;
  padding: .6rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--navy);
  background: var(--paper);
  color: var(--navy);
  cursor: pointer;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:disabled { background: var(--line); border-color: var(--line); color: var(--muted); cursor: not-allowed; }
.btn[hidden] { display: none; }

/* --------------------------------------------------------- narrow screens */

@media (max-width: 560px) {
  body { font-size: 16px; padding-bottom: 6rem; }
  .site-header { padding: .7rem .9rem; gap: .5rem; }
  .logo { height: 22px; }
  .progress { font-size: .7rem; gap: .2rem; width: 100%; }
  .progress li { padding: .15rem .45rem; }
  main { padding: 1.25rem .9rem; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
  .quote { padding: 1rem 1.1rem; }
  .quote p { font-size: 1.05rem; }
  /* one column, so even the longest value stays on one line */
  .values-grid { grid-template-columns: 1fr; }
  .sheet { padding: 1.25rem 1.1rem; }
  .nav { padding: .7rem .9rem; gap: .5rem; }
  .btn { padding: .55rem 1rem; }
}
