:root {
  --teal: #00D6E0;
  --teal-dark: #009FA8;
  --teal-soft: #E6FBFD;
  --navy: #0B1F2A;
  --gray-100: #f4f8f9;
  --gray-200: #e6ecef;
  --gray-300: #cfd6da;
  --gray-500: #8a9399;
  --gray-700: #5a6770;
  --white: #ffffff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--gray-100);
  color: var(--navy);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main.card {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 32px;
  background: var(--white);
  min-height: 100vh;
}

@media (min-width: 520px) {
  main.card {
    margin: 24px auto;
    border-radius: 14px;
    box-shadow: 0 6px 22px rgba(11, 31, 42, 0.08);
    min-height: auto;
  }
}

.brand { text-align: center; }
.brand-tag {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--teal-dark);
  font-weight: 700;
}
.brand h1 {
  font-size: 24px;
  line-height: 1.18;
  margin: 8px 0 6px;
  font-weight: 700;
}
.brand-h1-accent { color: var(--teal-dark); }
.brand-sub {
  font-size: 13px;
  color: var(--gray-700);
  margin: 0;
}

.intro {
  margin-top: 18px;
  padding: 14px 14px 12px;
  background: var(--teal-soft);
  border-left: 3px solid var(--teal);
  border-radius: 6px;
}
.intro-thesis {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
}
.intro-instruction {
  margin: 0;
  font-size: 12.5px;
  color: var(--gray-700);
  line-height: 1.45;
}

hr {
  border: 0;
  height: 1px;
  background: var(--gray-200);
  margin: 18px 0;
}

.field-group { margin-bottom: 18px; }

.group-label {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--teal-dark);
}
.group-hint {
  font-size: 12px;
  color: var(--gray-700);
  margin: 4px 0 10px;
}
.hint-end {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 6px;
}

.group-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

input[type="text"], input[type="tel"], input[type="email"], textarea {
  display: block;
  width: 100%;
  padding: 11px 12px;
  margin-bottom: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.12s;
}

input:focus, textarea:focus {
  border-color: var(--teal);
}

textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.45;
  margin-bottom: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
  transition: opacity 0.12s, transform 0.04s;
}
button:active { transform: translateY(1px); }
button[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  font-size: 15px;
  background: var(--teal);
  color: var(--navy);
}
.btn-primary:hover { background: var(--teal-dark); color: var(--white); }

.btn-secondary {
  flex: 1;
  padding: 10px;
  font-size: 13px;
  background: var(--white);
  border: 1px solid var(--teal);
  color: var(--teal-dark);
}
.btn-secondary:hover { background: var(--teal-soft); }

.btn-ghost {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--white);
  border: 1px solid var(--teal);
  color: var(--teal-dark);
}
.btn-ghost:hover { background: var(--teal-soft); }

#output-section { margin-top: 18px; }

.email-card {
  background: var(--gray-100);
  border-radius: 8px;
  padding: 14px;
  margin-top: 8px;
}

.email-subject {
  font-size: 11px;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.email-body {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  color: var(--navy);
  white-space: pre-wrap;
  margin: 0;
}

.output-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.output-status {
  text-align: center;
  font-size: 12px;
  color: var(--teal-dark);
  margin-top: 8px;
}

.annotation {
  margin-top: 22px;
  padding: 16px;
  background: #fbfcfd;
  border: 1px solid var(--teal);
  border-radius: 8px;
}
.annotation-title {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 8px;
}
.annotation-lead {
  font-size: 13px;
  line-height: 1.5;
  color: var(--navy);
  margin: 0 0 10px;
}
.annotation-list {
  font-size: 13px;
  line-height: 1.55;
  color: var(--navy);
  margin: 0 0 12px;
  padding-left: 18px;
}
.annotation-list li {
  margin-bottom: 6px;
}
.annotation-list strong {
  color: var(--teal-dark);
}
.annotation-punch {
  font-size: 13px;
  line-height: 1.55;
  color: var(--navy);
  font-weight: 600;
  margin: 0;
  padding-top: 10px;
  border-top: 1px dashed var(--gray-300);
}
.annotation-footnote {
  font-size: 12px;
  line-height: 1.5;
  color: var(--gray-700);
  font-style: italic;
  margin: 10px 0 0;
}

.error-text {
  background: #ffeaea;
  border: 1px solid #ffb4b4;
  color: #a02020;
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
  margin: 0;
}

.page-footer {
  margin-top: 28px;
  font-size: 11px;
  color: var(--gray-500);
  text-align: center;
}

/* Loading state */
.btn-primary.is-loading {
  background: var(--gray-300);
  color: var(--gray-700);
  cursor: wait;
}
