:root {
  --teal: #69CDB3;
  --teal-dark: #4FB69B;
  --teal-wash: #F1FAF7;
  --ink: #333F48;
  --ink-soft: #6B7A85;
  --muted: #8A96A0;
  --line: #DFE6EB;
  --bg: #F6F8F9;
  --white: #fff;
  --danger: #D0554B;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(51,63,72,.06), 0 8px 24px rgba(51,63,72,.06);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ---------------------------------------------------------------- top bar */

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--ink);
  box-shadow: 0 1px 0 rgba(0,0,0,.12);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px;
}
.logo {
  width: 40px; height: 40px; border-radius: 8px; background: #fff;
  object-fit: contain; flex: none;
}
.titles h1 {
  margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .01em; color: #fff;
}
.titles p {
  margin: 1px 0 0; font-size: 12px; color: #9FB0BC; letter-spacing: .06em;
  text-transform: uppercase;
}
.topbar-actions { margin-left: auto; }

.progress { height: 3px; background: rgba(255,255,255,.14); }
.progress-bar {
  height: 100%; width: 100%; background: var(--teal);
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}

.banner {
  background: #FFF4E5; color: #7A4B00; font-size: 14px;
  padding: 10px 20px; text-align: center; border-bottom: 1px solid #F0DCBB;
}

/* ---------------------------------------------------------------- layout */

.wrap {
  max-width: 1180px; margin: 0 auto; padding: 28px 20px 120px;
  display: grid; grid-template-columns: 1fr; gap: 28px;
}

.rail { display: none; }

@media (min-width: 1024px) {
  .wrap { grid-template-columns: 232px 1fr; align-items: start; }
  .rail {
    display: flex; flex-direction: column; gap: 2px;
    position: sticky; top: 96px;
  }
  .rail-item {
    display: flex; align-items: center; gap: 10px;
    background: none; border: 0; cursor: pointer;
    padding: 9px 12px; border-radius: 8px; text-align: left;
    font: 500 14px/1.3 inherit; color: var(--ink-soft);
  }
  .rail-item:hover { background: #EDF1F3; color: var(--ink); }
  .rail-item.active { background: var(--white); color: var(--ink); box-shadow: var(--shadow); }
  .rail-item.done .rail-num { background: var(--teal); color: #fff; border-color: var(--teal); }
  .rail-num {
    width: 22px; height: 22px; flex: none; border-radius: 50%;
    border: 1.5px solid var(--line); background: #fff;
    display: grid; place-items: center; font-size: 11px; font-weight: 700;
  }
  .rail-item.active .rail-num { border-color: var(--ink); color: var(--ink); }
}

/* ---------------------------------------------------------------- steps */

.step {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; margin-bottom: 20px; box-shadow: var(--shadow);
}
body:not(.single-page) .step { display: none; margin-bottom: 0; }
body:not(.single-page) .step.active { display: block; }
body.single-page .single-submit { display: block; }
.single-submit { display: none; padding: 4px 0 0; }
body.single-page .step-nav { display: none; }

.step-head { margin-bottom: 22px; }
.step-count {
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--teal-dark);
}
.step-head h2 {
  margin: 6px 0 0; font-size: 24px; font-weight: 700; letter-spacing: -.01em;
}
.intro { margin: 8px 0 0; color: var(--ink-soft); font-size: 14px; max-width: 60ch; }

.grid {
  display: grid; gap: 18px 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.field.full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

label { font-size: 13px; font-weight: 600; color: var(--ink); }
.req { color: var(--teal-dark); }
.hint { font-size: 12px; color: var(--muted); }

.input-wrap { position: relative; display: flex; }

input, select, textarea {
  width: 100%; font: 400 16px/1.4 inherit; color: var(--ink);
  background: var(--white); border: 1.5px solid var(--line); border-radius: 8px;
  padding: 12px 13px; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7A85' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
  padding-right: 34px;
}
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(105,205,179,.22);
}
input:invalid.touched { border-color: var(--danger); }
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

.unit {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: var(--muted); pointer-events: none; background: #fff;
  padding-left: 4px;
}
.input-wrap:has(.unit) input { padding-right: 58px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ------------------------------------------------------- vessel lookup */

.lookup {
  margin: 0 0 24px; padding: 16px; border-radius: 8px;
  background: var(--teal-wash); border: 1px solid var(--teal);
}
.lookup-row { display: flex; gap: 10px; }
.lookup-row input { background: #fff; }
.lookup-row .primary { margin: 0; flex: none; white-space: nowrap; }
.lookup .hint { display: block; margin-top: 7px; }
.lookup-result[hidden] { display: none; }
.lookup-result {
  display: flex; gap: 14px; align-items: center; margin-top: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px;
}
.lookup-photo-slot:empty { display: none; }
.lookup-photo-slot img {
  width: 148px; height: 99px; object-fit: cover; border-radius: 6px; display: block;
}
.lookup-meta { display: grid; gap: 3px; font-size: 13px; min-width: 0; }
.lookup-meta strong { font-size: 15px; }
.lookup-meta span { color: var(--ink-soft); }
.lookup-source { font-size: 12px; color: var(--muted); }
.lookup.busy .primary { opacity: .6; pointer-events: none; }
.lookup-error { color: var(--danger); font-size: 13px; margin-top: 10px; display: block; }

@media (max-width: 560px) {
  .lookup-row { flex-direction: column; }
  .lookup-row .primary { width: 100%; }
  .lookup-result { flex-direction: column; align-items: stretch; }
  .lookup-photo-slot img { width: 100%; height: 150px; }
}

/* ------------------------------------------------------------------ roi */

.roi-panel[hidden] { display: none; }
.roi-panel {
  margin: 0 0 24px; padding: 18px; border-radius: 8px;
  background: var(--ink); color: #fff;
}
.roi-head h3 { margin: 0; font-size: 17px; color: #fff; }
.roi-head .hint { color: #9FB0BC; display: block; margin-top: 3px; }
.roi-panel > .hint { color: #7D8E9A; margin: 12px 0 0; }
.roi-cards { display: grid; gap: 12px; margin-top: 14px;
             grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.roi-card { background: rgba(255,255,255,.06); border-radius: 8px; padding: 14px 16px; }
.roi-card h4 { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: var(--teal);
               letter-spacing: .04em; }
.roi-payback { font-size: 34px; font-weight: 700; line-height: 1; }
.roi-payback em { font-style: normal; font-size: 13px; font-weight: 400; color: #9FB0BC;
                  margin-left: 6px; }
.roi-lines { margin: 12px 0 0; padding: 0; list-style: none; font-size: 13px; }
.roi-lines li { display: flex; justify-content: space-between; gap: 12px;
                padding: 4px 0; border-top: 1px solid rgba(255,255,255,.09); }
.roi-lines span { color: #9FB0BC; }

/* ------------------------------------------------------------- downloads */

.overlay-downloads[hidden] { display: none; }
.overlay-downloads { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.dl-btn {
  display: inline-block; text-decoration: none; font: 600 15px/1 inherit;
  padding: 14px 22px; border-radius: 8px; background: var(--teal); color: var(--ink);
  border: 1.5px solid var(--teal);
}
.dl-btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.dl-btn.ghost-dl { background: transparent; color: var(--ink-soft);
                   border-color: var(--line); }
.dl-btn.ghost-dl:hover { border-color: var(--ink-soft); color: var(--ink); }
.demo-banner { background: #EEF3F6; color: var(--ink); border-bottom-color: var(--line); }

/* ---------------------------------------------------------------- matrix */

.matrix { margin-top: 26px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.matrix-head, .matrix-row {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 1px;
  background: var(--line);
}
.matrix-head > span, .matrix-row > * {
  background: var(--white); padding: 10px 12px; font-size: 13px;
  display: flex; flex-direction: column; justify-content: center;
}
.matrix-head > span {
  background: #EEF3F6; font-weight: 700; font-size: 12px; color: var(--ink);
}
.matrix-head em {
  font-style: normal; font-weight: 400; font-size: 11px; color: var(--muted);
}
.matrix-label { font-weight: 600; }
.matrix-cell { padding: 0; }
.cell-label { display: none; }
.matrix-input {
  border: 0; border-radius: 0; padding: 10px 12px; background: var(--teal-wash);
  text-align: center; font-size: 15px; height: 100%;
}
.matrix-input:focus { box-shadow: inset 0 0 0 2px var(--teal); }
.matrix-row.total > * { background: var(--teal); color: var(--ink); font-weight: 700; }
.matrix-total { text-align: center; align-items: center; }
.matrix-hint { display: block; padding: 10px 12px; background: #fff; }

@media (max-width: 640px) {
  .matrix-head { display: none; }
  .matrix-row { grid-template-columns: 1fr; gap: 0; padding-bottom: 10px; }
  .matrix-label {
    background: #EEF3F6; padding: 9px 12px; font-size: 12px;
    letter-spacing: .08em; text-transform: uppercase;
  }
  /* grid-template-columns is required: the inherited justify-content:center
     would otherwise centre a max-content track instead of filling the row. */
  .matrix-cell { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 8px 12px 0; }
  .cell-label { display: block; font-size: 12px; font-weight: 600; color: var(--ink); }
  .cell-label em { font-style: normal; font-weight: 400; color: var(--muted); }
  .matrix-input { text-align: left; border-radius: 6px; border: 1.5px solid var(--line); }
  .matrix-row.total { grid-template-columns: 1fr 1fr 1fr 1fr; gap: 1px; padding-bottom: 0; }
  .matrix-row.total .matrix-label { background: var(--teal); }
}

.callout {
  margin-top: 20px; display: flex; align-items: baseline; gap: 10px;
  background: var(--teal-wash); border: 1px solid var(--teal);
  border-radius: 8px; padding: 14px 16px; font-size: 14px;
}
.callout strong { margin-left: auto; font-size: 22px; }
.callout em { font-style: normal; color: var(--ink-soft); font-size: 13px; }

/* ---------------------------------------------------------------- files */

.dropzone {
  position: relative; border: 1.5px dashed var(--line); border-radius: 8px;
  padding: 22px; text-align: center; background: #FBFCFC; transition: .15s;
}
.dropzone.over { border-color: var(--teal); background: var(--teal-wash); }
.dropzone p { margin: 0 0 4px; font-size: 14px; }
.dropzone input {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; padding: 0; border: 0;
  width: 100%; height: 100%;
}
.filelist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.filelist li {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  background: var(--teal-wash); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 12px;
}
.filelist .size { margin-left: auto; color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- buttons */

.step-nav { display: flex; gap: 10px; margin-top: 28px; }
button {
  font: 600 15px/1 inherit; border-radius: 8px; cursor: pointer;
  padding: 14px 22px; border: 1.5px solid transparent; transition: .15s;
}
.primary { background: var(--ink); color: #fff; margin-left: auto; }
.primary:hover { background: #263038; }
.primary:active { transform: translateY(1px); }
.primary:disabled { opacity: .5; cursor: not-allowed; }
.primary.wide { width: 100%; margin: 0; padding: 16px; }
.ghost { background: transparent; border-color: var(--line); color: var(--ink-soft); }
.ghost:hover { border-color: var(--ink-soft); color: var(--ink); }
.topbar .ghost { border-color: rgba(255,255,255,.24); color: #C9D6DE; padding: 9px 14px;
  font-size: 13px; }
.topbar .ghost:hover { border-color: var(--teal); color: var(--teal); }
.step:first-of-type .prev { visibility: hidden; }

/* ---------------------------------------------------------------- overlay */

.overlay {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(51,63,72,.72); padding: 24px;
}
/* An author display rule beats the UA stylesheet's [hidden] { display: none }. */
.overlay[hidden] { display: none; }
.overlay .card {
  background: #fff; border-radius: 14px; padding: 36px 32px; text-align: center;
  max-width: 440px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.overlay h3 { margin: 16px 0 6px; font-size: 21px; }
.overlay p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.overlay .primary { margin: 22px auto 0; }
.spinner {
  width: 42px; height: 42px; margin: 0 auto; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--teal);
  animation: spin .8s linear infinite;
}
.tick {
  width: 52px; height: 52px; margin: 0 auto; border-radius: 50%;
  background: var(--teal); display: grid; place-items: center;
  color: #fff; font-size: 27px; font-weight: 700;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------- footer */

.foot {
  border-top: 1px solid var(--line); background: #fff;
  padding: 16px 20px; display: flex; justify-content: space-between;
  font-size: 12px; color: var(--muted);
  max-width: 1180px; margin: 0 auto;
}

body[data-mode=kiosk] .foot, body[data-mode=kiosk] .topbar-actions { display: none; }

/* On phones the single-page toggle is not useful and crowds the title. */
@media (max-width: 620px) {
  .topbar-actions { display: none; }
  .topbar-inner { padding: 10px 16px; gap: 11px; }
  .logo { width: 34px; height: 34px; }
  .titles h1 { font-size: 14px; }
  .titles p { font-size: 10px; }
  .wrap { padding: 18px 14px 90px; }
  .step { padding: 20px 16px; border-radius: 8px; }
  .step-head h2 { font-size: 21px; }
  .step-nav { position: sticky; bottom: 0; background: #fff; padding: 12px 0 4px;
              margin-top: 22px; }
}

/* ------------------------------------------------- embedded on another site */
/* The host page supplies its own header, footer and page background. */
body[data-embed] { background: transparent; }
body[data-embed] .topbar,
body[data-embed] .foot,
body[data-embed] .rail { display: none; }
body[data-embed] .wrap { padding: 0 0 40px; grid-template-columns: 1fr; max-width: none; }
body[data-embed] .step { box-shadow: none; }

/* ------------------------------------------------------ privacy and legal */
.consent { margin: 22px 0 0; padding: 14px 16px; border: 1px solid var(--line);
           border-radius: var(--radius); background: var(--teal-wash); }
.consent-box { display: flex; gap: 12px; align-items: flex-start; font-size: 13px;
               line-height: 1.5; color: var(--ink-soft); cursor: pointer; }
.consent-box input { width: 20px; height: 20px; margin: 1px 0 0; flex: none;
                     accent-color: var(--teal-dark); }
.consent-box input.touched:invalid { outline: 2px solid var(--danger); outline-offset: 2px; }
.consent a, .legal a { color: var(--teal-dark); }
.legal { margin: 0 auto; padding: 10px 20px 18px; text-align: center; font-size: 11px;
         color: var(--muted); max-width: 1180px; }
body[data-embed] .legal { padding-bottom: 8px; }
