:root{
  --bg:#EFEFEF;
  --panel:#ffffff;
  --card:#ffffff;
  --text:#101828;
  --muted:#667085;
  --line:#d0d5dd;
  --line-strong:#98a2b3;
  --accent:#111827;
  --accent-2:#0f172a;
  --warning:#b54708;
  --warning-soft:#fffaeb;
  --success:#067647;
  --success-soft:#ecfdf3;
  --shadow:0 10px 30px rgba(16,24,40,.07);
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family:Inter,-apple-system,BlinkMacSystemFont,"SF Pro Display","Helvetica Neue",Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.45;
}

.page-shell{
  max-width:1180px;
  margin:0 auto;
  padding:20px;
}

.hero-card{
  margin-bottom:18px;
  padding:20px 22px;
  background:rgba(255,255,255,.88);
  backdrop-filter:blur(10px);
  border:1px solid rgba(208,213,221,.8);
  border-radius:20px;
  box-shadow:var(--shadow);
}

.eyebrow,
.result-eyebrow{
  margin:0 0 6px;
  color:var(--muted);
  font-size:13px;
  letter-spacing:.01em;
  font-weight:700;
}

h1,
h2,
h3,
p{
  margin-top:0;
}

h1{
  margin-bottom:0;
  font-size:clamp(26px, 4vw, 36px);
  line-height:1.1;
}

.hero-copy,
.result-subtitle,
.card-copy,
.support-card,
.message-card{
  color:var(--muted);
  font-size:14px;
  line-height:1.6;
}

.hero-copy{
  margin:10px 0 0;
  max-width:720px;
}

.layout-grid{
  display:grid;
  grid-template-columns:420px minmax(0, 1fr);
  gap:18px;
  align-items:start;
}

.panel{
  padding:22px;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:22px;
  box-shadow:var(--shadow);
}

.lookup-panel{
  position:sticky;
  top:18px;
}

.section-title{
  margin:0 0 18px;
  font-size:18px;
  line-height:1.2;
  font-weight:800;
}

.lookup-form{
  display:grid;
  gap:16px;
}

.field label{
  display:block;
  margin-bottom:8px;
  font-size:13px;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:#344054;
}

.field{
  min-width:0;
}

.field input{
  width:100%;
  max-width:100%;
  min-width:0;
  display:block;
  border-radius:15px;
  border:1px solid var(--line);
  padding:13px 16px;
  font-size:14px;
  color:var(--text);
  background:#fff;
  transition:border-color .18s ease, box-shadow .18s ease;
}

.field input:focus{
  outline:none;
  border-color:#344054;
  box-shadow:0 0 0 4px rgba(17,24,39,.08);
}

.field input[type="date"]{
  appearance:none;
  -webkit-appearance:none;
  overflow:hidden;
  padding-right:48px;
}

.field input[type="date"]::-webkit-date-and-time-value{
  text-align:left;
}

.field input[type="date"]::-webkit-calendar-picker-indicator{
  opacity:.85;
}

.field-note{
  margin:8px 2px 0;
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
}

.button{
  appearance:none;
  width:100%;
  border:1px solid var(--accent-2);
  border-radius:15px;
  padding:13px 18px;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  transition:.18s ease;
}

.button.primary{
  background:var(--accent-2);
  color:#fff;
}

.button.secondary{
  background:#fff;
  color:var(--accent-2);
}

.button.primary:hover{
  transform:translateY(-1px);
}

.button.secondary:hover{
  border-color:#344054;
  background:#f8fafc;
}

.message-card,
.support-card,
.notice-card{
  margin-top:18px;
  padding:16px 18px;
  border-radius:18px;
  border:1px solid var(--line);
}

.message-card.warning,
.notice-card{
  background:var(--warning-soft);
  color:var(--warning);
  border-color:#f7d7a6;
}

.message-card.info{
  background:#f5f8ff;
  color:#1849a9;
  border-color:#c7d7fe;
  margin-bottom:18px;
}

.message-card.success{
  background:var(--success-soft);
  color:var(--success);
  border-color:#b7ebcd;
}

.support-card{
  background:#f8fafc;
}

.result-header{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
  margin-bottom:18px;
}

.result-title{
  margin:0;
  font-size:24px;
  line-height:1.15;
}

.result-subtitle{
  margin-bottom:0;
}

.customer-name{
  margin:0;
  padding:10px 12px;
  border-radius:14px;
  background:#f8fafc;
  border:1px solid var(--line);
  color:#344054;
  font-size:13px;
  font-weight:700;
}

.stage-chip-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:18px;
}

.stage-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:38px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  color:#475467;
  font-size:13px;
  font-weight:700;
}

.stage-chip::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:999px;
  background:var(--line-strong);
}

.stage-chip-complete{
  background:var(--success-soft);
  color:var(--success);
  border-color:#b7ebcd;
}

.stage-chip-complete::before,
.stage-chip-current::before{
  background:currentColor;
}

.stage-chip-current{
  background:#fcfcfd;
  color:var(--accent);
  border-color:var(--accent);
}

.result-hero{
  margin-bottom:18px;
  padding:28px;
  border:1px solid var(--line);
  border-radius:24px;
  background:
    radial-gradient(circle at top center, rgba(47, 84, 235, .08), transparent 42%),
    linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  box-shadow:var(--shadow);
}

.result-card,
.muted-card{
  margin-bottom:16px;
  padding:20px;
  border:1px solid var(--line);
  border-radius:20px;
  background:var(--card);
}

.muted-card{
  background:#f8fafc;
}

.feature-card{
  display:flex;
  justify-content:space-between;
  gap:20px;
  align-items:center;
}

.feature-copy{
  min-width:0;
}

.feature-icon{
  flex:0 0 auto;
  width:96px;
  height:96px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:linear-gradient(180deg, #eef4ff 0%, #dfe9ff 100%);
  color:#155eef;
  font-size:34px;
  font-weight:800;
}

.feature-icon img{
  display:block;
  width:66px;
  height:66px;
  object-fit:contain;
}

.metadata-card{
  display:flex;
  justify-content:space-between;
  gap:18px;
  align-items:flex-start;
}

.metadata-card .stage-chip-row{
  margin-bottom:0;
  justify-content:flex-end;
}

.progress-rail{
  display:grid;
  grid-template-columns:repeat(6, minmax(0, 1fr));
  gap:0;
  margin:24px 0 22px;
}

.progress-step{
  position:relative;
  padding:0 10px 0 0;
}

.progress-step::before{
  content:"";
  position:absolute;
  top:18px;
  left:34px;
  right:-12px;
  height:3px;
  background:#d0d5dd;
}

.progress-step:last-child::before{
  display:none;
}

.progress-step-marker{
  position:relative;
  z-index:1;
  width:36px;
  height:36px;
  border-radius:999px;
  border:2px solid #d0d5dd;
  background:#fff;
  color:#98a2b3;
  display:grid;
  place-items:center;
  margin-bottom:14px;
}

.progress-step-complete::before{
  background:#155eef;
}

.progress-step-complete .progress-step-marker{
  background:#155eef;
  border-color:#155eef;
  color:#fff;
}

.progress-step-current::before{
  background:linear-gradient(90deg, #155eef 0%, #155eef 50%, #d0d5dd 50%, #d0d5dd 100%);
}

.progress-step-current .progress-step-marker{
  border-color:#155eef;
  color:#155eef;
  box-shadow:0 0 0 6px rgba(21, 94, 239, .08);
}

.progress-pulse{
  width:18px;
  height:18px;
  border-radius:999px;
  background:#155eef;
}

.progress-check{
  font-size:19px;
  line-height:1;
  font-weight:800;
}

.progress-step-copy h3{
  margin:0 0 6px;
  font-size:14px;
  line-height:1.25;
  font-weight:800;
  color:#101828;
}

.progress-step-copy p{
  margin:0;
  color:#475467;
  font-size:12px;
  line-height:1.55;
  max-width:140px;
}

.progress-step-current .progress-step-copy h3{
  color:#155eef;
}

.step-badge{
  display:inline-flex;
  align-items:center;
  margin-top:10px;
  padding:5px 10px;
  border-radius:999px;
  background:#eef4ff;
  color:#155eef;
  font-size:11px;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
}

.inline-note-card{
  display:flex;
  gap:14px;
  align-items:flex-start;
  padding:18px;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(255,255,255,.75);
}

.inline-note-card p{
  margin:0;
  color:#344054;
  font-size:15px;
  line-height:1.6;
}

.inline-note-icon{
  flex:0 0 auto;
  width:30px;
  height:30px;
  border-radius:999px;
  border:2px solid #155eef;
  color:#155eef;
  display:grid;
  place-items:center;
  font-size:16px;
  font-weight:800;
}

.metrics-card{
  display:grid;
  grid-template-columns:minmax(0, 1fr) 1px minmax(0, 1fr);
  gap:22px;
  align-items:center;
  margin-bottom:16px;
  padding:22px;
  border:1px solid var(--line);
  border-radius:20px;
  background:#fff;
}

.metric-item{
  display:flex;
  gap:16px;
  align-items:flex-start;
}

.metric-icon{
  flex:0 0 auto;
  width:52px;
  height:52px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:#eef4ff;
  color:#155eef;
  font-size:23px;
  font-weight:700;
}

.metric-copy{
  margin:0;
  font-size:18px;
  line-height:1.45;
  font-weight:700;
  color:#101828;
}

.metric-divider{
  width:1px;
  height:72px;
  background:#e4e7ec;
}

.card-title{
  margin:0 0 8px;
  color:var(--muted);
  font-size:12px;
  letter-spacing:.16em;
  text-transform:uppercase;
  font-weight:700;
}

.card-value{
  margin:0;
  font-size:30px;
  line-height:1.1;
  font-weight:800;
}

.empty-state .section-title{
  margin-bottom:10px;
}

.preview-stack{
  margin-top:22px;
}

.admin-shell{
  max-width:1080px;
}

.admin-panel{
  margin-bottom:18px;
}

.admin-form{
  display:grid;
  gap:18px;
}

textarea{
  width:100%;
  border-radius:15px;
  border:1px solid var(--line);
  padding:13px 16px;
  font-size:14px;
  color:var(--text);
  background:#fff;
  resize:vertical;
  min-height:110px;
  transition:border-color .18s ease, box-shadow .18s ease;
}

textarea:focus{
  outline:none;
  border-color:#344054;
  box-shadow:0 0 0 4px rgba(17,24,39,.08);
}

.admin-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:14px;
}

.estimate-table{
  display:grid;
  gap:12px;
}

.estimate-row{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  gap:16px;
  align-items:center;
  padding:16px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fcfcfd;
}

.estimate-label{
  margin:0 0 4px;
  font-size:16px;
  font-weight:700;
}

.estimate-aliases{
  margin:0;
  color:var(--muted);
  font-size:13px;
}

.estimate-inputs{
  display:grid;
  grid-template-columns:repeat(2, 110px);
  gap:10px;
}

.admin-actions{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:14px;
  margin-bottom:18px;
}

.sync-table{
  display:grid;
  gap:12px;
}

.sync-row{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  gap:16px;
  align-items:center;
  padding:16px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fcfcfd;
}

.sync-date{
  margin:0;
  color:var(--muted);
  font-size:13px;
  text-align:right;
}

.compact-field{
  margin-bottom:0;
}

.code-block{
  overflow:auto;
  padding:16px;
  border-radius:18px;
  border:1px solid var(--line);
  background:#0f172a;
  color:#e5e7eb;
  font-size:13px;
  line-height:1.6;
}

@media (max-width: 980px){
  .layout-grid{
    grid-template-columns:1fr;
  }

  .lookup-panel{
    position:static;
  }
}

@media (max-width: 640px){
  .page-shell{
    padding:14px;
  }

  .hero-card,
  .panel{
    padding:18px;
  }

  .result-header{
    flex-direction:column;
  }

  .result-hero{
    padding:22px 18px;
  }

  .progress-rail{
    grid-template-columns:1fr;
    gap:0;
    margin:18px 0 16px;
  }

  .progress-step{
    padding:0 0 12px 44px;
  }

  .progress-step::before{
    top:36px;
    left:17px;
    right:auto;
    bottom:-2px;
    width:3px;
    height:auto;
  }

  .progress-step:last-child{
    padding-bottom:0;
  }

  .progress-step:last-child::before{
    display:none;
  }

  .progress-step-marker{
    position:absolute;
    left:0;
    top:0;
    margin-bottom:0;
  }

  .progress-step-current::before{
    background:linear-gradient(180deg, #155eef 0%, #155eef 50%, #d0d5dd 50%, #d0d5dd 100%);
  }

  .progress-step-copy p{
    max-width:none;
    font-size:12px;
    line-height:1.4;
  }

  .step-badge{
    margin-top:7px;
  }

  .inline-note-card{
    padding:16px;
  }

  .feature-card,
  .metadata-card{
    flex-direction:column;
    align-items:flex-start;
  }

  .feature-icon{
    width:72px;
    height:72px;
    font-size:28px;
  }

  .feature-icon img{
    width:50px;
    height:50px;
  }

  .metrics-card{
    grid-template-columns:1fr;
    gap:18px;
  }

  .metric-divider{
    width:100%;
    height:1px;
  }

  .metadata-card .stage-chip-row{
    justify-content:flex-start;
  }

  .card-value{
    font-size:24px;
  }

  .admin-grid,
  .admin-actions,
  .estimate-row,
  .sync-row,
  .estimate-inputs{
    grid-template-columns:1fr;
  }

  .sync-date{
    text-align:left;
  }
}
