/* ---------------------------------------------------------------------------
   The first-run stocktake.

   Two hundred things to say yes or no to, so the tile is the unit: big enough
   to hit with a thumb, small enough that a whole department fits on a screen,
   and unambiguous at a glance about which ones are on. Everything else on the
   page is scaffolding around that one gesture.
   --------------------------------------------------------------------------- */

/* ---------- where you are in the flow ---------- */
.sw-progress {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 2px 0 20px;
}

.sw-pip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.sw-pip:disabled { cursor: default; opacity: .55; }
.sw-pip i { width: 8px; height: 8px; border-radius: 99px; background: var(--border-strong); }
.sw-pip.past { color: var(--green-dark); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.sw-pip.past i { background: var(--accent); }

.sw-pip.on {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.sw-pip.on i { background: var(--accent); box-shadow: 0 0 0 3px var(--ring); }

/* ---------- the headline block on every step ---------- */
.sw-hero { max-width: 760px; margin-bottom: 22px; }

.sw-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}

.sw-kicker .ic { width: 14px; height: 14px; }
.sw-hero h2 { margin: 8px 0 8px; font-size: 25px; line-height: 1.2; letter-spacing: -.02em; }
.sw-hero p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-soft); }
.sw-hero p i { font-style: normal; font-weight: 650; color: var(--text); }

.sw-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-soft);
}

.sw-note .ic { flex: none; width: 15px; height: 15px; margin-top: 2px; color: var(--gold); }

/* ---------- welcome: the three things the app holds ---------- */
.sw-three {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

.sw-card {
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.sw-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent);
}

.sw-tag .ic { width: 14px; height: 14px; }
.sw-card b { display: block; margin: 8px 0 5px; font-size: 15px; }
.sw-card p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--text-soft); }
.sw-card p i { font-style: normal; font-weight: 650; color: var(--text); }
.sw-card small { display: block; margin-top: 8px; font-size: 11.5px; color: var(--text-muted); }

/* ---------- step 2: what to track ---------- */
.sw-opts { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }

.sw-opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.sw-opt:hover { border-color: var(--accent); }
.sw-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.sw-opt.locked { cursor: default; opacity: .9; }
.sw-opt-txt { display: flex; flex-direction: column; gap: 3px; }
.sw-opt-txt b { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.sw-opt-txt b .ic { width: 16px; height: 16px; color: var(--text-muted); }
.sw-opt.on .sw-opt-txt b .ic { color: var(--accent); }
.sw-opt-txt i { font-style: normal; font-size: 12.5px; line-height: 1.55; color: var(--text-soft); }

/* ---------- the running tally ---------- */
.sw-count {
  display: flex;
  align-items: center;
  gap: 9px;
  position: sticky;
  top: 0;
  z-index: 3;
  margin-bottom: 18px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius-sm);
  /* opaque on purpose: --accent-soft is part-transparent in dark mode, and a
     sticky bar you can read the page through is worse than no bar at all */
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  font-size: 12.5px;
  color: var(--text-soft);
  box-shadow: 0 6px 14px -10px rgba(0, 0, 0, .5);
}

.sw-count .ic { flex: none; width: 15px; height: 15px; color: var(--accent); }
.sw-count b { color: var(--green-dark); font-weight: 800; }

/* ---------- the tick grids ---------- */
.sw-sect { margin-bottom: 24px; }

.sw-sect h4 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sw-sect h4 small {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
  opacity: .8;
}

.sw-sect-note { margin: -4px 0 10px; font-size: 12px; color: var(--text-muted); }

.sw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 8px;
}

.sw-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-soft);
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .12s ease, background-color .12s ease, color .12s ease;
}

.sw-tile:hover { border-color: var(--border-strong); background: var(--surface-2); }

.sw-tick {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--border-strong);
  border-radius: 7px;
  color: var(--text-muted);
}

.sw-tick .ic { width: 13px; height: 13px; }
.sw-name { min-width: 0; line-height: 1.3; }

.sw-name small {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--text-muted);
}

.sw-name small .ic { width: 11px; height: 11px; }

.sw-tile.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--green-dark);
  font-weight: 650;
}

.sw-tile.on .sw-tick {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}

/* one you'd already linked a real product to — the wizard didn't do this */
.sw-tile.mine.on { border-style: dashed; }

/* ---------- step: how much of each ---------- */
.sw-amounts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 640px;
}

.sw-amt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.sw-amt-name { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text-soft); }

.sw-amt-row input, .sw-amt-row select {
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.sw-amt-row input { width: 92px; }
.sw-amt-row input:focus, .sw-amt-row select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }

/* ---------- finish ---------- */
.sw-tally {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.sw-tally > div {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.sw-tally b { display: block; font-size: 26px; line-height: 1.1; color: var(--accent); }
.sw-tally span { display: block; margin-top: 4px; font-size: 12px; line-height: 1.45; color: var(--text-muted); }

.sw-next { max-width: 760px; margin-top: 26px; }
.sw-next h3 { margin: 0 0 10px; font-size: 16px; }
.sw-next ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.sw-next li { font-size: 13.5px; line-height: 1.6; color: var(--text-soft); }
.sw-next li b { color: var(--text); }
.sw-next li .ic { width: 14px; height: 14px; vertical-align: -.15em; color: var(--text-muted); }

/* ---------- the bar at the bottom of every step ---------- */
.sw-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.sw-nav .sw-quit { margin-left: auto; color: var(--text-muted); }

/* ---------- the way in, on My Products ---------- */
.sw-banner {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.sw-banner-ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-contrast);
}

.sw-banner-ic .ic { width: 17px; height: 17px; }
.sw-banner-txt { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.sw-banner-txt b { font-size: 14px; }
.sw-banner-txt span { font-size: 12.5px; line-height: 1.5; color: var(--text-soft); }

/* ---------- and the way back in, from Maintenance ---------- */
.maint-rerun {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 15px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.maint-rerun > span { display: grid; place-items: center; flex: none; color: var(--accent); }
.maint-rerun > span .ic { width: 18px; height: 18px; }
.maint-rerun > div { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.maint-rerun b { font-size: 13.5px; }
.maint-rerun div span { font-size: 12px; line-height: 1.5; color: var(--text-muted); }

@media (max-width: 620px) {
  .sw-hero h2 { font-size: 21px; }
  .sw-grid { grid-template-columns: 1fr 1fr; }
  .sw-nav .sw-quit { margin-left: 0; }
}
