:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #657281;
  --line: #d8dee8;
  --accent: #0e7c66;
  --accent-dark: #075f4d;
  --danger: #a63b32;
  --code: #111827;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(920px, calc(100vw - 32px));
  margin: 48px auto;
  display: grid;
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.06);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: white;
  font-weight: 800;
  font-size: 24px;
}

h1, h2, h3, p {
  margin: 0;
}

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

h2 {
  font-size: 22px;
  line-height: 1.25;
}

h3 {
  font-size: 16px;
  margin-bottom: 10px;
}

p {
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.55;
}

.create-form {
  display: grid;
  gap: 10px;
}

label {
  font-weight: 700;
  color: #273240;
}

.path-input {
  display: flex;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.path-input span {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: #eef2f5;
  color: #425160;
  border-right: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--ink);
  font-family: inherit;
}

button,
.button-link {
  width: fit-content;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

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

button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.ghost {
  background: #edf4f2;
  color: var(--accent-dark);
}

.ghost:hover {
  background: #dcece7;
}

.message {
  min-height: 24px;
  margin-top: 12px;
}

.message.error {
  color: var(--danger);
}

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

.danger-button:hover {
  background: #812b25;
}

.result-panel {
  display: grid;
  gap: 16px;
}

.result-panel[hidden] {
  display: none;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.copy-button {
  min-width: 116px;
  position: relative;
  overflow: hidden;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.copy-button.copied {
  background: var(--accent);
  color: white;
  animation: copy-pulse 520ms ease;
  box-shadow: 0 0 0 4px rgba(14, 124, 102, 0.14);
}

.copy-feedback {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #b9ded2;
  border-radius: 999px;
  padding: 0 12px;
  background: #e7f5f0;
  color: var(--accent-dark);
  font-weight: 800;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease;
}

.copy-feedback.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.copy-feedback[hidden] {
  display: none;
}

@keyframes copy-pulse {
  0% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.04);
  }

  100% {
    transform: scale(1);
  }
}

.result-head a {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent-dark);
  word-break: break-all;
}

.key-field,
.prompt-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #fbfcfd;
}

.prompt-field {
  width: 100%;
  min-height: 360px;
  resize: vertical;
  padding: 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}

.advanced {
  display: grid;
  gap: 10px;
}

.advanced summary {
  cursor: pointer;
  font-weight: 800;
  color: #273240;
}

pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
  border-radius: 8px;
  background: var(--code);
  color: #d6e2f0;
  font-size: 13px;
  line-height: 1.5;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 20px, 920px);
    margin: 18px auto;
  }

  .panel {
    padding: 18px;
  }

  .brand-row,
  .result-head {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 24px;
  }

  button {
    width: 100%;
  }
}
