:root {
  --red: #e2321e;
  --ink: #1a1a1a;
  --paper: #fafaf7;
  --line: #ddd;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: var(--paper);
  color: var(--ink);
  padding-bottom: 3rem;
}

.site-header {
  background: var(--ink);
  color: #fff;
  padding: 1.5rem 1rem 1.2rem;
  text-align: center;
  border-bottom: 4px solid var(--red);
}

.site-header h1 {
  font-family: "Rampart One", sans-serif;
  margin: 0;
  font-size: 1.8rem;
  letter-spacing: 0.05em;
}

.site-header__sub {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  opacity: 0.8;
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.2rem;
  margin-bottom: 1.5rem;
}

.panel h2 {
  font-size: 1.1rem;
  margin: 0 0 1rem;
  border-left: 4px solid var(--red);
  padding-left: 0.6rem;
}

.field {
  display: block;
  margin-bottom: 1rem;
}

.field__label {
  display: block;
  font-size: 0.85rem;
  font-weight: bold;
  margin-bottom: 0.35rem;
}

input[type="text"],
textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
}

textarea {
  resize: vertical;
}

.title-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
}

.title-row__remove {
  background: none;
  border: none;
  color: var(--red);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0.3rem;
}

.title-add {
  display: flex;
  gap: 0.5rem;
}

.title-add input {
  flex: 1;
}

button {
  cursor: pointer;
}

.title-add button,
.title-row__remove {
  flex-shrink: 0;
}

.title-add button {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--ink);
  background: #fff;
  border-radius: 6px;
  font-size: 0.9rem;
}

.btn-primary {
  display: block;
  width: 100%;
  padding: 0.9rem;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1.05rem;
  font-weight: bold;
  margin-top: 0.5rem;
}

.btn-primary:disabled {
  opacity: 0.5;
}

.status-msg {
  min-height: 1.2em;
  font-size: 0.85rem;
  text-align: center;
  margin: 0.6rem 0 0;
  color: #666;
}

.result-panel canvas {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 1rem;
  display: block;
}

.amazon-links {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.amazon-links__title {
  font-size: 0.85rem;
  font-weight: bold;
  margin: 0 0 0.5rem;
}

.amazon-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.amazon-links a {
  display: block;
  padding: 0.5rem 0.7rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 0.9rem;
}

.hidden {
  display: none;
}

.site-footer {
  text-align: center;
  font-size: 0.8rem;
  color: #999;
}

.site-footer a {
  color: #999;
}
