:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #69758a;
  --border: #dce2ea;
  --accent: #2454ff;
  --accent-dark: #183bb3;
  --success: #e9f9ef;
  --success-text: #116430;
  --error: #fff0f0;
  --error-text: #9b1c1c;
  --warn: #fff8e6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #e8edff, transparent 34rem), var(--bg);
  color: var(--text);
}

.shell {
  width: min(980px, calc(100% - 32px));
  margin: 48px auto;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

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

h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.sub {
  max-width: 720px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.card, .alert {
  background: rgba(255,255,255,.86);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 18px 60px rgba(23, 32, 51, .08);
  padding: 24px;
  margin-bottom: 20px;
  backdrop-filter: blur(12px);
}

form {
  display: grid;
  gap: 18px;
}

label span {
  display: block;
  margin-bottom: 8px;
  font-weight: 750;
}

input[type=file], select {
  width: 100%;
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 16px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check span {
  margin: 0;
  font-weight: 650;
}

button, .download {
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: white;
  font-weight: 850;
  font-size: 16px;
  padding: 15px 20px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

button:hover, .download:hover {
  background: var(--accent-dark);
}

.alert-success {
  background: var(--success);
  color: var(--success-text);
}

.alert-error {
  background: var(--error);
  color: var(--error-text);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}

.metric strong {
  font-size: 28px;
}

.warnings {
  background: var(--warn);
}

.warnings ul {
  max-height: 320px;
  overflow: auto;
  padding-left: 20px;
}

.warnings li {
  margin-bottom: 8px;
}


.usage-card {
  background: linear-gradient(135deg, rgba(36, 84, 255, .10), rgba(255, 255, 255, .92));
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 18px 60px rgba(23, 32, 51, .08);
  padding: 24px;
  margin-bottom: 20px;
  backdrop-filter: blur(12px);
}

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

.usage-head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.usage-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--accent-dark);
  padding: 9px 13px;
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(23, 32, 51, .07);
}

.usage-bar {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 32, 51, .10);
  margin-bottom: 18px;
}

.usage-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.usage-grid div {
  background: rgba(255,255,255,.82);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
}

.usage-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}

.usage-grid strong {
  font-size: 26px;
}

.usage-note,
.usage-hint,
.usage-error {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.45;
}

.usage-error {
  color: var(--error-text);
  background: var(--error);
  border: 1px solid rgba(155, 28, 28, .18);
  border-radius: 14px;
  padding: 14px 16px;
}

.usage-hint code {
  background: rgba(23, 32, 51, .08);
  border-radius: 8px;
  padding: 2px 6px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head h2,
.result-head h3 {
  margin: 0;
  letter-spacing: -0.03em;
}

.section-head p:not(.kicker) {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color: var(--text);
  resize: vertical;
}

.form-hint {
  margin: -4px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.form-hint code,
.snippet-card code {
  background: rgba(23, 32, 51, .08);
  border-radius: 8px;
  padding: 2px 6px;
}

.results-list {
  display: grid;
  gap: 18px;
  margin-bottom: 20px;
}

.result-card {
  background: rgba(255,255,255,.90);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 18px 60px rgba(23, 32, 51, .08);
  padding: 22px;
}

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

.copy-btn {
  flex: 0 0 auto;
  padding: 11px 15px;
  border-radius: 12px;
  font-size: 14px;
}

.result-code {
  min-height: 260px;
  background: #fbfcff;
}

.result-warnings {
  margin-top: 14px;
  background: var(--warn);
  border: 1px solid rgba(172, 117, 0, .18);
  border-radius: 14px;
  padding: 12px 14px;
}

.result-warnings summary {
  cursor: pointer;
  font-weight: 800;
}

.result-warnings ul {
  margin-bottom: 0;
  padding-left: 20px;
}

@media (max-width: 720px) {
  .result-head,
  .usage-head {
    display: block;
  }

  .copy-btn,
  .usage-pill {
    margin-top: 12px;
  }
}
