:root {
  --bg: #f8f6ef;
  --ink: #1b1f22;
  --brand: #005f73;
  --brand-2: #ee9b00;
  --surface: #fffcf2;
  --line: #d9d4c9;
  --error: #b42318;
  --ok: #006d77;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(circle at 10% 10%, #e9d8a6 0%, transparent 45%),
    radial-gradient(circle at 85% 20%, #94d2bd 0%, transparent 38%),
    linear-gradient(135deg, #fefae0 0%, #f8f6ef 45%, #edf6f9 100%);
  color: var(--ink);
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.panel {
  width: min(780px, 100%);
  background: color-mix(in srgb, var(--surface) 88%, white 12%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: 0 25px 45px -35px rgba(0, 0, 0, 0.6);
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  text-transform: uppercase;
  color: var(--brand);
}

h1 {
  margin: 0.35rem 0 0.25rem;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.lede {
  margin-top: 0;
  color: #3a444a;
}

label {
  display: block;
  margin: 1rem 0 0.45rem;
  font-weight: 700;
}

textarea {
  width: 100%;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid #b9b2a6;
  padding: 0.85rem;
  font: inherit;
  background: #fff;
}

textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--brand) 58%, white);
  outline-offset: 1px;
}

.help {
  margin-top: 0.5rem;
  color: #4f595f;
  font-size: 0.92rem;
}

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

button {
  border: none;
  border-radius: 999px;
  padding: 0.68rem 1rem;
  font: inherit;
  font-weight: 700;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  transition:
    transform 120ms ease,
    opacity 120ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

button.ghost {
  background: transparent;
  border: 1px solid #9aa8af;
  color: #1f2a30;
}

.status,
.error {
  min-height: 1.25rem;
  margin: 0.8rem 0 0;
}

.status {
  color: #30434d;
}

.error {
  color: var(--error);
  font-weight: 700;
}

.rate-help {
  margin-top: 0.6rem;
  border: 1px solid #e8c9b9;
  background: #fff5ef;
  border-radius: 12px;
  padding: 0.75rem;
}

.rate-help-title {
  margin: 0;
  font-weight: 700;
  color: #8a2f09;
}

.rate-help-body {
  margin: 0.35rem 0 0.7rem;
  color: #6b3a22;
  font-size: 0.92rem;
}

.result {
  margin-top: 1rem;
  padding: 0.9rem;
  border: 1px solid #bfd8cf;
  border-radius: 12px;
  background: #fbfffd;
  min-height: 170px;
  overflow: hidden;
}

.result.is-empty {
  border-style: dashed;
  border-color: #c9d6d2;
  background: #f8fcfb;
}

.result.is-empty .resolved-details,
.result.is-empty .copy-feedback {
  opacity: 0.6;
}

.result h2 {
  margin: 0 0 0.55rem;
}

code {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  background: #f0f7f6;
  border: 1px solid #c9ddda;
  padding: 0.65rem;
  border-radius: 8px;
  word-break: break-all;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.copy-feedback {
  color: var(--ok);
  font-weight: 700;
}

.resolved-details {
  margin-top: 0.8rem;
}

.resolved-details summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  cursor: pointer;
  user-select: none;
  color: var(--brand);
  font-weight: 700;
}

.resolved-details summary::-webkit-details-marker {
  display: none;
}

.resolved-details summary::after {
  content: "+";
  font-size: 1rem;
  line-height: 1;
  color: var(--brand);
}

.resolved-details[open] summary::after {
  content: "−";
}

.resolved-url {
  margin-top: 0.55rem;
  color: #415159;
  font-size: 0.88rem;
  word-break: break-word;
  white-space: normal;
}

@media (max-width: 640px) {
  .panel {
    border-radius: 14px;
    padding: 1rem;
  }

  .actions button,
  .result-actions button {
    width: 100%;
  }

  .result-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}
