:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: #f5f7fb;
  color: #172033;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.topbar,
.panel,
.summary-card {
  background: #ffffff;
  border: 1px solid #dce3ef;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(45, 57, 85, 0.08);
}

.topbar {
  min-height: 96px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #5f6f89;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
}

h2 {
  margin-bottom: 6px;
  font-size: 22px;
}

h3 {
  margin-bottom: 12px;
  font-size: 17px;
}

.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: #edf3ff;
  color: #244c86;
  font-size: 13px;
  font-weight: 700;
}

.status-pill.pending {
  background: #fff6db;
  color: #7a5600;
}

.status-pill.success {
  background: #e7f8ef;
  color: #11633c;
}

.status-pill.error,
.status-pill.blocked {
  background: #ffecee;
  color: #9b1c31;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.summary-card {
  padding: 16px;
}

.summary-card span {
  display: block;
  color: #66738a;
  font-size: 13px;
  margin-bottom: 8px;
}

.summary-card strong {
  display: block;
  min-height: 30px;
  font-size: 25px;
}

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

.main-column,
.side-column {
  display: grid;
  gap: 16px;
}

.panel {
  padding: 18px;
}

.template-header,
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid #c7d3e4;
  border-radius: 8px;
  background: #f8fbff;
  color: #27405f;
  cursor: pointer;
}

label {
  display: grid;
  gap: 6px;
  color: #44536a;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

input,
textarea {
  width: 100%;
  border: 1px solid #cbd6e5;
  border-radius: 8px;
  padding: 10px 11px;
  color: #172033;
  background: #ffffff;
}

textarea {
  resize: vertical;
}

button:not(.icon-button) {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: #225ea8;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.template-list,
.detail-grid {
  display: grid;
  gap: 10px;
}

.detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.template-item,
.detail-item {
  border: 1px solid #dde5f1;
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

.template-item strong,
.detail-item strong {
  display: block;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
}

.template-item p,
.detail-item p,
.guardrail p {
  margin-bottom: 0;
  color: #5c6a80;
  line-height: 1.55;
}

.result-box {
  min-height: 140px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border-radius: 8px;
  background: #101a2b;
  color: #e7eefb;
  font-size: 12px;
  line-height: 1.55;
}

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

  .topbar,
  .template-header {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-grid,
  .workspace,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
