/* SpeedNeed — household speed calculator: profile grid, activity table,
   recommendation + plan/upload verdict panels. */

.sn {
  /* --accent (#ea580c) is ≈3.5:1 on white — fine for decor, under AA for
     text. Text usages take --sn-accent-ink (≈4.6:1 on white / white-on-it
     ≈5.4:1) instead. */
  --sn-accent-ink: #c2410c;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.3rem 1.25rem 1.1rem;
  margin: 1.4rem 0 1.8rem;
}

/* household controls */
.sn-house {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: flex-end;
}
.sn-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--text-dim);
  flex: 1 1 9rem;
  min-width: 0;
  max-width: 100%;
}
.sn-field--s { flex: 0 1 6.5rem; }
.sn-field--r { flex: 1 1 12rem; }

.sn input[type="text"],
.sn input[type="number"],
.sn select {
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  min-height: 44px; /* ≥44px tap target */
  width: 100%;
  max-width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sn select { cursor: pointer; }
.sn input:focus,
.sn select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

.sn input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  margin: 0.55rem 0 0.2rem;
  min-height: 44px; /* tall hit area for touch drags */
}
.sn-concline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.sn-concline output {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sn-concscale {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}

/* activity table */
.sn-scroll { overflow-x: auto; margin-top: 1rem; }
.sn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.sn-table th,
.sn-table td {
  padding: 0.4rem 0.55rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.sn-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  white-space: nowrap;
}
.sn-table td small {
  display: block;
  font-size: 0.76rem;
  color: var(--text-dim);
  font-weight: 500;
  line-height: 1.35;
}
.sn-num { font-variant-numeric: tabular-nums; text-align: right !important; white-space: nowrap; }
.sn-table thead th.sn-num { text-align: right; }
.sn-count input {
  width: 4.2rem;
  padding: 0.3rem 0.45rem;
  font-size: 0.95rem;
  text-align: center;
}
tr.sn-total td {
  border-top: 2px solid var(--border);
  border-bottom: none;
  font-weight: 700;
  background: color-mix(in srgb, var(--primary) 6%, transparent);
}

/* main output */
.sn-out {
  display: block;
  margin-top: 1rem;
  min-height: 1.6rem;
}
.sn-scoreline {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.sn-scoreline strong {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.sn-chip {
  display: inline-block;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  color: #fff;
  background: var(--sn-accent-ink);
}
.sn-planline {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.05rem;
  font-weight: 650;
}
.sn-planline strong { color: var(--sn-accent-ink); }
.sn-note {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--text-dim);
  font-weight: 500;
}
.sn-note strong { color: var(--text); }

/* verdict panels */
.sn-panel {
  margin-top: 1.3rem;
  border-top: 2px dashed var(--border);
  padding-top: 1rem;
}
.sn-panel > h2 { margin-top: 0; font-size: 1.15rem; }
.sn-panel-sub {
  margin: 0 0 0.8rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.sn-panel .sn-field { max-width: 12rem; }

.sn-verdict {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.98rem;
  font-weight: 550;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border-inline-start: 4px solid var(--border);
  background: var(--bg);
}
.sn-verdict strong { font-variant-numeric: tabular-nums; }
.sn-v-short { border-inline-start-color: #dc2626; background: #fef2f2; }
.sn-v-tight { border-inline-start-color: #d97706; background: #fffbeb; }
.sn-v-fit   { border-inline-start-color: #16a34a; background: #f0fdf4; }
.sn-v-over  { border-inline-start-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--bg)); }
.sn-v-check { border-inline-start-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.sn-upneed { display: block; font-size: 0.98rem; font-weight: 550; }
.sn-upneed strong { font-variant-numeric: tabular-nums; color: var(--sn-accent-ink); }

.sn-hint { font-size: 0.95rem; font-weight: 500; color: var(--text-dim); }
.sn-error { font-size: 0.95rem; font-weight: 600; color: #b91c1c; }

@media (max-width: 560px) {
  .sn { padding: 1rem 0.85rem; }
  .sn-scoreline strong { font-size: 1.6rem; }
  .sn-field--r { flex: 1 1 100%; }
}
