:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --surface: #ffffff;
  --muted: #6b7787;
  --text: #101828;
  --line: #dfe6ef;
  --blue: #5865f2;
  --blue-dark: #414bd8;
  --pink: #f0167a;
  --green: #0a8f5a;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea,
a {
  font: inherit;
}

.shell {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.eyebrow,
.hero-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
}

.icon-button,
.primary-button,
.tab,
.quick-prompts button {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--blue);
  box-shadow: var(--shadow);
  font-size: 24px;
}

.hero,
.panel,
.assistant,
.links {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
}

.hero strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}

.primary-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
}

.primary-button:active {
  background: var(--blue-dark);
}

.wide {
  width: 100%;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.card {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.1;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 12px;
}

.tab {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: #e9eef6;
  color: #2f3a4a;
  font-weight: 800;
}

.tab.is-active {
  background: var(--text);
  color: #fff;
}

.panel,
.assistant {
  padding: 16px;
  margin-bottom: 12px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-title span,
#statusPill {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

pre,
textarea {
  width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

pre {
  margin: 0;
  color: #2f3a4a;
  font-size: 15px;
  line-height: 1.45;
}

.quick-prompts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.quick-prompts button {
  min-height: 38px;
  border-radius: 12px;
  background: #eef4ff;
  color: var(--blue);
  font-weight: 800;
}

textarea {
  resize: vertical;
  min-height: 86px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcff;
  color: var(--text);
  line-height: 1.35;
}

.answer {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #f7f9fc;
}

.links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.links a {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #eef4ff;
  color: var(--blue);
  text-align: center;
  text-decoration: none;
  font-weight: 800;
}

.error {
  color: #b42318;
}

@media (max-width: 430px) {
  .shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  h1 {
    font-size: 24px;
  }

  .hero {
    align-items: stretch;
    flex-direction: column;
  }

  .cards,
  .links,
  .quick-prompts {
    grid-template-columns: 1fr;
  }
}
