:root {
  --bg: #0b141a;
  --surface: #111b21;
  --surface-2: #1f2c34;
  --text: #e9edef;
  --muted: #8696a0;
  --primary: #00a884;
  --primary-hover: #06cf9c;
  --secondary: #2a3942;
  --border: #2a3942;
  --accent: #075e54;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
}

header {
  background: var(--accent);
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: calc(14px + env(safe-area-inset-top));
}

header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

main {
  padding: 12px;
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 4px;
}

input, textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
}

input:focus, textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 0;
  border-color: var(--primary);
}

textarea {
  white-space: pre-wrap;
  min-height: 220px;
  line-height: 1.5;
}

.template-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.template-list button {
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.template-list button:hover {
  background: var(--secondary);
  border-color: var(--primary);
}

.template-list button.active {
  background: var(--accent);
  border-color: var(--primary);
}

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

button, .button-link {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

button:hover:not(:disabled), .button-link:hover {
  background: var(--primary-hover);
}

button.secondary {
  background: var(--secondary);
}

button.secondary:hover:not(:disabled) {
  background: #354752;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#send-btn {
  flex: 1;
}

.muted {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 12px;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

@media (min-width: 600px) {
  .template-list {
    grid-template-columns: 1fr 1fr;
  }
}
