:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --ink: #1c1f1d;
  --muted: #647067;
  --line: #d8ded7;
  --panel: #ffffff;
  --accent: #1f6f5b;
  --accent-strong: #154f42;
  --danger: #a33a2a;
}

* {
  box-sizing: border-box;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  min-height: 38px;
  padding: 0 14px;
}

button:hover {
  background: var(--accent-strong);
}

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

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 111, 91, 0.14);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

.shell {
  width: min(1080px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 0;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  margin-bottom: 14px;
}

.key-row,
.actions,
.list-tools,
.record-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.key-row input {
  flex: 1;
}

.composer {
  display: grid;
  gap: 13px;
}

.composer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

#copyPromptButton,
.delete-button {
  background: #fff;
  color: var(--accent);
}

.delete-button {
  border-color: #d9b0a9;
  color: var(--danger);
}

.list-tools {
  margin: 18px 0 12px;
}

.list-tools input {
  max-width: 520px;
}

#statusText {
  color: var(--muted);
  font-size: 14px;
}

.records {
  display: grid;
  gap: 12px;
}

.record {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.record-head {
  justify-content: space-between;
  align-items: flex-start;
}

.record h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

pre {
  margin: 14px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.58;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
}

@media (max-width: 720px) {
  .topbar,
  .key-row,
  .list-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .composer-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 28px;
  }
}
