:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #5c667a;
  --line: #d9dee8;
  --accent: #0f6cbd;
  --accent-soft: #eaf3ff;
  --success: #1f7a52;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

main {
  width: calc(100% - 48px);
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 0 48px;
  overflow: hidden;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 0 22px;
  border-bottom: 1px solid var(--line);
}

.page-head > div {
  min-width: 0;
  max-width: 100%;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 100%;
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.subtitle {
  max-width: 100%;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.subtitle span + span::before {
  content: " · ";
}

.prompt-link,
.link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.prompt-link:hover,
.link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

.summary-grid div {
  min-height: 84px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.summary-grid strong,
.summary-grid span {
  display: block;
}

.summary-grid strong {
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}

.summary-grid span {
  font-size: 15px;
  font-weight: 800;
}

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

.tool-card {
  display: grid;
  grid-template-rows: auto auto minmax(330px, 45vh) auto auto;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

h2 {
  min-width: 0;
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.status {
  flex: none;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #0b4f8a;
  font-size: 12px;
  font-weight: 800;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.preview {
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 330px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcff;
}

.preview-link {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 12px;
}

.preview img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.source-only {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  height: 100%;
  min-height: 220px;
  padding: 14px;
  text-align: left;
}

.source-only span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.source-only pre {
  overflow: auto;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: #283347;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
}

.note {
  font-size: 13px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 980px) {
  main {
    width: calc(100% - 28px);
    max-width: 760px;
    padding-top: 22px;
  }

  .page-head {
    align-items: start;
    flex-direction: column;
  }

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

  .tool-card {
    grid-template-rows: auto auto minmax(260px, 52vh) auto auto;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 28px;
  }

  .subtitle {
    font-size: 16px;
  }

  .subtitle span {
    display: block;
  }

  .subtitle span + span::before {
    content: "";
  }

  .card-head {
    flex-direction: column;
    align-items: start;
  }

  .status {
    align-self: flex-start;
  }
}
