html {
  font-size: 15px;
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background: #f5f7fb;
  color: #132034;
}

.workspace-shell {
  display: grid;
  gap: 1.25rem;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem 0;
  border-bottom: 1px solid #d8e0ea;
}

.workspace-header h1 {
  margin: 0;
  font-size: 2rem;
}

.workspace-status {
  min-width: 150px;
  max-width: 420px;
  text-align: center;
  border: 1px solid #b9c7d8;
  border-radius: 8px;
  padding: .55rem .75rem;
  background: #ffffff;
  color: #314760;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.builder-grid,
.output-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 1.25rem;
  align-items: start;
}

.builder-panel,
.result-panel {
  background: #fff;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 8px 30px rgba(18, 32, 52, 0.05);
}

.form-row,
.field-row {
  display: grid;
  gap: .45rem;
  margin-bottom: .9rem;
}

.form-row label,
.field-row label {
  color: #314760;
  font-weight: 650;
}

.field-row input,
.form-row select {
  min-height: 42px;
  border: 1px solid #b9c7d8;
  border-radius: 8px;
  padding: .55rem .7rem;
  background: #fff;
  color: #132034;
}

.summary-strip {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  padding: .75rem;
  margin: 1rem 0;
  background: #f8fafc;
}

.summary-strip span {
  color: #51647c;
}

.field-groups {
  display: grid;
  gap: 1rem;
}

.field-set {
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  padding: 1rem;
}

.field-set legend {
  float: none;
  width: auto;
  padding: 0 .35rem;
  margin-bottom: .75rem;
  font-size: .95rem;
  font-weight: 700;
  color: #132034;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1rem;
}

.action-row .btn {
  min-width: 132px;
}

.score-tile {
  display: grid;
  gap: .25rem;
  border: 1px solid #c7d7ec;
  border-radius: 8px;
  padding: 1rem;
  background: #eef4ff;
}

.score-tile span,
.score-tile small {
  color: #536b8e;
}

.score-tile strong {
  font-size: 2.6rem;
  line-height: 1;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin: 1rem 0 0;
}

.metric-grid div {
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  padding: .75rem;
  min-width: 0;
}

.metric-grid dt {
  color: #64748b;
  font-size: .85rem;
}

.metric-grid dd {
  margin: .2rem 0 0;
  font-weight: 700;
  word-break: break-word;
}

.page-shell {
  display: grid;
  gap: 1.25rem;
}

.hero-band,
.panel {
  background: #fff;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 8px 30px rgba(18, 32, 52, 0.05);
}

.hero-band {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #4b6b9a;
  font-size: .8rem;
  margin-bottom: .35rem;
}

.lead {
  color: #4d5f78;
  margin: .35rem 0 0;
}

.score-card {
  min-width: 130px;
  text-align: right;
  background: #eef4ff;
  border-radius: 12px;
  padding: 1rem 1.15rem;
}

.score-label, .score-sub {
  display: block;
  color: #56709a;
}

.score-value {
  display: block;
  font-size: 2.4rem;
  line-height: 1;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.subgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.stack {
  display: grid;
  gap: 1rem;
}

.list {
  padding-left: 1.2rem;
  margin: .75rem 0 0;
  word-break: break-word;
}

.compact li {
  margin-bottom: .35rem;
}

.preview-frame {
  width: 100%;
  min-height: 520px;
  border: 1px solid #d8e0ea;
  border-radius: 10px;
  background: #fff;
}

.code-block {
  white-space: pre-wrap;
  word-break: break-word;
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 10px;
  min-height: 520px;
  overflow: auto;
}

.muted {
  color: #6b7c93;
}

@media (max-width: 992px) {
  .grid-two,
  .builder-grid,
  .output-grid,
  .subgrid,
  .hero-band,
  .workspace-header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .score-card {
    text-align: left;
  }

  .workspace-status {
    text-align: left;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }
}
