/* Steps to Miles Calculator — StepsConverter Tools v1.2.0 */

.stm-calculator-wrap *,
.stm-calculator-wrap *::before,
.stm-calculator-wrap *::after { box-sizing: border-box; margin: 0; padding: 0; }

.stm-calculator-wrap {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px; line-height: 1.6; color: #1a202c;
  -webkit-font-smoothing: antialiased;
}

/* ── Card wrap ── */
.stm-hero-calc-wrap {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.16);
  border: 1px solid #eef0f4;
  overflow: hidden;
}

/* Colour stripe */
.stm-calc-stripe { height: 4px; background: linear-gradient(90deg, #1a56db, #00a99d); }

/* Body */
.stm-calc-body { padding: 22px 22px 22px; }

/* Head */
.stm-calc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.stm-calc-icon { width: 36px; height: 36px; background: #e8f0fb; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stm-calc-icon svg { width: 18px; height: 18px; stroke: #1a56db; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.stm-calc-title { font-size: 15px; font-weight: 700; color: #1a202c; }
.stm-calc-sub   { font-size: 11px; color: #b0b8c8; margin-top: 1px; }

/* Steps input */
.stm-steps-wrap { position: relative; margin-bottom: 14px; }
.stm-steps-input {
  width: 100%; height: 54px;
  font-family: inherit; font-size: 24px; font-weight: 700;
  color: #1a202c; background: #f7f8fa;
  border: 1.5px solid #dde1e9; border-radius: 6px;
  padding: 0 56px 0 16px;
  transition: border-color .2s, background .2s, box-shadow .2s;
  -moz-appearance: textfield; appearance: textfield;
}
.stm-steps-input::-webkit-outer-spin-button,
.stm-steps-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stm-steps-input::placeholder { color: #b0b8c8; font-size: 18px; font-weight: 400; }
.stm-steps-input:focus { outline: none; border-color: #1a56db; background: #f0f6ff; box-shadow: 0 0 0 3px rgba(26,86,219,0.10); }
.stm-steps-input.is-err { border-color: #dc2626; }
.stm-steps-unit-lbl { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 700; color: #b0b8c8; pointer-events: none; }
.stm-err-msg { font-size: 12px; color: #dc2626; margin-bottom: 10px; }

/* Inline row */
.stm-inline-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.stm-field-group-sm { display: flex; flex-direction: column; gap: 5px; }
.stm-field-label-sm { font-size: 10px; font-weight: 700; color: #8892a4; text-transform: uppercase; letter-spacing: 0.8px; }

/* Select */
.stm-sel-wrap { position: relative; }
.stm-calc-select { width: 100%; height: 40px; font-family: inherit; font-size: 13px; font-weight: 600; color: #4a5568; background: #f7f8fa; border: 1.5px solid #dde1e9; border-radius: 6px; padding: 0 32px 0 12px; appearance: none; cursor: pointer; transition: border-color .2s; }
.stm-calc-select:focus { outline: none; border-color: #1a56db; }
.stm-sel-arr { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.stm-sel-arr svg { width: 12px; height: 12px; stroke: #b0b8c8; fill: none; stroke-width: 2; stroke-linecap: round; }

/* Unit toggle */
.stm-unit-toggle { display: grid; grid-template-columns: 1fr 1fr; background: #f7f8fa; border: 1.5px solid #dde1e9; border-radius: 6px; padding: 2px; gap: 2px; height: 40px; }
.stm-unit-btn { border: 1.5px solid transparent; background: transparent; font-family: inherit; font-size: 12.5px; font-weight: 600; color: #b0b8c8; cursor: pointer; border-radius: 5px; transition: all .2s; }
.stm-unit-btn.active { background: #ffffff; color: #1a56db; border-color: #1a56db; box-shadow: 0 1px 4px rgba(0,0,0,0.10); }

/* Pace */
.stm-pace-label { font-size: 10px; font-weight: 700; color: #8892a4; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px; }
.stm-pace-toggle { display: grid; grid-template-columns: repeat(3, 1fr); background: #f7f8fa; border-radius: 6px; padding: 3px; gap: 3px; margin-bottom: 14px; }
.stm-pace-btn { height: 34px; border: 1.5px solid transparent; background: transparent; font-family: inherit; font-size: 12px; font-weight: 600; color: #b0b8c8; cursor: pointer; border-radius: 5px; transition: all .2s; }
.stm-pace-btn.active { background: #ffffff; color: #1a56db; border-color: #1a56db; box-shadow: 0 1px 4px rgba(0,0,0,0.10); }
.stm-pace-btn:hover:not(.active) { color: #4a5568; }

/* Calculate button */
.stm-btn-calc {
  width: 100%; height: 48px;
  background: #1a56db; color: #ffffff;
  border: none; border-radius: 4px;
  font-family: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 14px rgba(26,86,219,.30);
  margin-bottom: 22px;
}
.stm-btn-calc:hover { background: #1648c0; transform: translateY(-1px); }
.stm-btn-calc svg { width: 16px; height: 16px; stroke: white; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Await state */
.stm-await-state { padding: 36px 22px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.stm-await-ring { width: 56px; height: 56px; border-radius: 50%; border: 2px solid #eef0f4; display: flex; align-items: center; justify-content: center; }
.stm-await-ring svg { width: 24px; height: 24px; stroke: #dde1e9; fill: none; stroke-width: 2; stroke-linecap: round; }
.stm-await-title { font-size: 18px; font-weight: 700; color: #1a202c; }
.stm-await-text  { font-size: 12.5px; color: #b0b8c8; max-width: 240px; line-height: 1.6; }

/* Result panel */
.stm-result-panel { display: flex; flex-direction: column; }
.stm-result-topbar { height: 4px; background: linear-gradient(90deg, #1a56db, #00a99d); }
.stm-rp-sec { padding: 14px 22px; border-bottom: 1px solid #f7f8fa; }
.stm-rp-sec:last-of-type { border-bottom: none; }

/* Primary card */
.stm-primary-card { background: #1a56db; border-radius: 6px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.stm-pc-label { font-size: 10px; color: rgba(255,255,255,.65); font-weight: 600; text-transform: uppercase; letter-spacing: .7px; margin-bottom: 3px; }
.stm-pc-val   { font-size: 34px; font-weight: 800; color: #ffffff; line-height: 1; letter-spacing: -1px; }
.stm-pc-right { text-align: right; }
.stm-pc-sec-label { font-size: 10px; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 2px; }
.stm-pc-sec-val   { font-size: 18px; font-weight: 700; color: rgba(255,255,255,.85); }

/* Stats */
.stm-stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stm-stat-card { border-radius: 6px; padding: 11px 12px; border: 1px solid transparent; }
.stm-stat-green { background: #f0fdf4; border-color: #dcfce7; }
.stm-stat-amber { background: #fffbeb; border-color: #fef3c7; }
.stm-stat-icon { width: 26px; height: 26px; border-radius: 4px; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.stm-stat-icon svg { width: 13px; height: 13px; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.stm-green-ic { background: #dcfce7; }
.stm-green-ic svg { stroke: #16a34a; }
.stm-amber-ic { background: #fef3c7; }
.stm-amber-ic svg { stroke: #d97706; }
.stm-stat-val { font-size: 20px; font-weight: 800; color: #1a202c; line-height: 1; margin-bottom: 2px; }
.stm-stat-lbl { font-size: 10px; color: #8892a4; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }

/* SPM bar */
.stm-spm-bar { background: #f7f8fa; border: 1px solid #eef0f4; border-radius: 6px; padding: 9px 13px; display: flex; align-items: center; justify-content: space-between; }
.stm-spm-label { font-size: 12px; color: #8892a4; }
.stm-spm-val   { font-size: 12.5px; font-weight: 700; color: #1a202c; background: #eef0f4; padding: 2px 9px; border-radius: 4px; }

/* Reference table */
.stm-table-wrap { border-radius: 6px; overflow: hidden; border: 1px solid #eef0f4; }
.stm-ref-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.stm-ref-table th { background: #f7f8fa; padding: 8px 13px; text-align: left; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #b0b8c8; border-bottom: 1px solid #eef0f4; }
.stm-ref-table th:not(:first-child) { text-align: right; }
.stm-ref-table td { padding: 7px 13px; border-bottom: 1px solid #f7f8fa; color: #4a5568; font-size: 12px; }
.stm-ref-table td:not(:first-child) { text-align: right; font-weight: 600; color: #1a202c; }
.stm-ref-table tr:last-child td { border-bottom: none; }
.stm-ref-table tr.is-you td { background: #f0f6ff; color: #1a56db; }
.stm-ref-table tr.is-you td:first-child { font-weight: 700; }

/* Action buttons */
.stm-action-row { display: flex; gap: 7px; padding: 12px 22px 0; flex-wrap: wrap; }
.stm-act-btn { flex: 1; min-width: 70px; height: 36px; border-radius: 4px; font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px; border: 1.5px solid; transition: all .2s; white-space: nowrap; }
.stm-act-btn svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.stm-btn-reset  { background: #ffffff; border-color: #dde1e9; color: #4a5568; }
.stm-btn-reset:hover  { background: #f7f8fa; }
.stm-btn-copy   { background: #e8f0fb; border-color: #1a56db; color: #1a56db; }
.stm-btn-copy:hover   { background: #d6e4ff; }
.stm-btn-recalc { background: #1a56db; border-color: #1a56db; color: #ffffff; }
.stm-btn-recalc:hover { background: #1648c0; }

/* Secondary buttons */
.stm-secondary-row { display: flex; gap: 7px; padding: 8px 22px; flex-wrap: wrap; }
.stm-sec-btn { flex: 1; min-width: 80px; height: 38px; border-radius: 6px; font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px; border: 1.5px solid; transition: all .2s; white-space: nowrap; }
.stm-sec-btn svg { width: 13px; height: 13px; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.stm-btn-save  { background: #ffffff; border-color: #dde1e9; color: #4a5568; }
.stm-btn-save svg { stroke: #4a5568; }
.stm-btn-save:hover  { background: #f7f8fa; }
.stm-btn-email { background: #ffffff; border-color: #16a34a; color: #16a34a; }
.stm-btn-email svg { stroke: #16a34a; }
.stm-btn-email:hover { background: #f0fdf4; }
.stm-btn-share { background: #1a3a6b; border-color: #1a3a6b; color: #ffffff; }
.stm-btn-share svg { stroke: #ffffff; }
.stm-btn-share:hover { background: #122d54; }

/* Start new */
.stm-start-new-wrap { text-align: center; padding: 6px 22px 14px; }
.stm-start-new-btn { background: none; border: none; font-family: inherit; font-size: 12px; color: #b0b8c8; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: color .2s; }
.stm-start-new-btn svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.stm-start-new-btn:hover { color: #1a56db; }

/* Animations */
@keyframes stm-fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.stm-rp-sec, .stm-action-row, .stm-secondary-row, .stm-start-new-wrap { animation: stm-fade-up .3s ease both; }
.stm-rp-sec:nth-child(2)  { animation-delay: .04s; }
.stm-rp-sec:nth-child(3)  { animation-delay: .08s; }
.stm-rp-sec:nth-child(4)  { animation-delay: .12s; }
.stm-action-row            { animation-delay: .16s; }
.stm-secondary-row         { animation-delay: .20s; }
.stm-start-new-wrap        { animation-delay: .24s; }

/* Modal */
.stm-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.stm-modal { background: #ffffff; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.20); width: 100%; max-width: 420px; overflow: hidden; animation: stm-fade-up .25s ease both; }
.stm-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; border-bottom: 1px solid #eef0f4; }
.stm-modal-title { font-size: 14px; font-weight: 700; color: #1a202c; }
.stm-modal-close { background: none; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 4px; transition: background .2s; }
.stm-modal-close:hover { background: #f7f8fa; }
.stm-modal-close svg { width: 14px; height: 14px; stroke: #b0b8c8; fill: none; stroke-width: 2.5; stroke-linecap: round; }
.stm-modal-body { padding: 18px; }
.stm-modal-section { margin-bottom: 14px; }
.stm-modal-section:last-child { margin-bottom: 0; }
.stm-modal-label { font-size: 10px; font-weight: 700; color: #8892a4; text-transform: uppercase; letter-spacing: .7px; margin-bottom: 6px; }
.stm-modal-input-wrap { display: flex; gap: 7px; }
.stm-modal-input { flex: 1; height: 36px; border: 1.5px solid #dde1e9; border-radius: 4px; padding: 0 10px; font-family: inherit; font-size: 12px; color: #4a5568; background: #f7f8fa; }
.stm-modal-input:focus { outline: none; border-color: #1a56db; }
.stm-modal-copy-btn { height: 36px; padding: 0 12px; background: #1a56db; color: #ffffff; border: none; border-radius: 4px; font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .2s; white-space: nowrap; }
.stm-modal-copy-btn:hover { background: #1648c0; }
.stm-modal-divider { height: 1px; background: #eef0f4; margin: 14px 0; }
.stm-social-row { display: flex; gap: 7px; }
.stm-soc-btn { flex: 1; height: 34px; border-radius: 4px; border: 1.5px solid #eef0f4; background: #ffffff; font-family: inherit; font-size: 12px; font-weight: 600; color: #4a5568; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px; transition: background .2s; }
.stm-soc-btn:hover { background: #f7f8fa; }

/* Responsive */
@media (max-width: 520px) {
  .stm-inline-row { grid-template-columns: 1fr; }
  .stm-action-row, .stm-secondary-row { flex-direction: column; }
  .stm-act-btn, .stm-sec-btn { width: 100%; }
  .stm-primary-card { flex-direction: column; gap: 8px; }
  .stm-pc-right { text-align: left; }
}
