/* ─── Reset & Base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  background: #fff7ed;
  color: #1c1917;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ─────────────────────────────────────── */
header {
  background: #ea580c;
  color: #fff;
  padding: 0 1rem;
  height: 52px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(234,88,12,.35);
}
.header-inner { max-width: 960px; width: 100%; margin: 0 auto; }
.logo { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }

/* ─── Main ───────────────────────────────────────── */
main { max-width: 960px; width: 100%; margin: 0 auto; padding: 1.5rem 1rem 3rem; flex: 1; }

/* ─── Hero ───────────────────────────────────────── */
.hero { text-align: center; margin-bottom: 1.5rem; }
.hero-icon { font-size: 3rem; margin-bottom: .5rem; }
.hero h1 { font-size: 1.75rem; font-weight: 800; color: #ea580c; margin-bottom: .5rem; }
.description { color: #57534e; font-size: .95rem; line-height: 1.7; }

/* ─── Two-column layout ──────────────────────────── */
.layout-cols {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1rem;
  align-items: start;
}

/* ─── Card ───────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #fed7aa;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(234,88,12,.07);
  margin-bottom: 1rem;
}
.card h2 { font-size: 1.05rem; font-weight: 700; color: #ea580c; margin-bottom: .85rem; }

/* ─── Field ──────────────────────────────────────── */
.field { margin-bottom: .85rem; }
.field:last-child { margin-bottom: 0; }
.field-label {
  display: flex; align-items: center; gap: .35rem;
  font-size: .82rem; font-weight: 700; color: #44403c;
  margin-bottom: .3rem;
}
.field-opt { font-size: .68rem; color: #a8a29e; font-weight: 400; }
.field input[type="text"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  border: 1.5px solid #e7e5e4;
  border-radius: 9px;
  padding: .6rem .85rem;
  font-size: .9rem;
  font-family: inherit;
  color: #1c1917;
  background: #fafaf9;
  outline: none;
  transition: border-color .15s;
  appearance: none;
  -webkit-appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2378716c' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  padding-right: 2.2rem;
  cursor: pointer;
}
.field textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.6;
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: #ea580c; background: #fff; }
.field-hint { font-size: .72rem; color: #a8a29e; margin-top: .3rem; }

/* ─── Two-col field row ──────────────────────────── */
.field-row-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 1rem;
}

/* ─── Theme selector ─────────────────────────────── */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .5rem;
  margin-bottom: .85rem;
}
.theme-btn {
  width: 100%;
  display: block;
  aspect-ratio: 1;
  border-radius: 10px;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: transform .12s, border-color .12s;
  overflow: hidden;
  padding: 0;
  background: none;
}
.theme-btn:hover  { transform: scale(1.08); }
.theme-btn.active { border-color: #ea580c; transform: scale(1.08); }
.theme-btn-inner {
  width: 100%; height: 100%;
  border-radius: 7px;
  display: flex; flex-direction: column;
}
.theme-btn-top    { flex: 3; }
.theme-btn-bottom { flex: 1; }
.theme-label { font-size: .68rem; text-align: center; color: #57534e; margin-top: .2rem; }

/* ─── Tag input ──────────────────────────────────── */
.tag-input-wrap {
  border: 1.5px solid #e7e5e4;
  border-radius: 9px;
  padding: .45rem .6rem;
  background: #fafaf9;
  display: flex; flex-wrap: wrap; gap: .3rem;
  min-height: 42px;
  cursor: text;
  transition: border-color .15s;
}
.tag-input-wrap:focus-within { border-color: #ea580c; background: #fff; }
.tag-chip {
  display: inline-flex; align-items: center; gap: .2rem;
  background: #fed7aa; color: #9a3412;
  border-radius: 999px;
  padding: .18rem .55rem;
  font-size: .78rem; font-weight: 600;
}
.tag-chip-del {
  background: none; border: none; cursor: pointer;
  color: #ea580c; font-size: .85rem; line-height: 1;
  padding: 0; display: flex;
}
.tag-input-real {
  border: none; outline: none; background: none;
  font-size: .88rem; font-family: inherit; color: #1c1917;
  min-width: 80px; flex: 1;
}

/* ─── Generate button ─────────────────────────────── */
.btn-generate {
  width: 100%;
  background: #ea580c; color: #fff;
  border: none; border-radius: 10px;
  padding: .72rem;
  font-size: .97rem; font-weight: 700;
  cursor: pointer; transition: background .15s;
  font-family: inherit;
}
.btn-generate:hover { background: #c2410c; }

/* ─── Preview panel ──────────────────────────────── */
.preview-panel {
  position: sticky;
  top: 68px;
}
.preview-wrap {
  text-align: center;
  margin-bottom: .85rem;
}
#card-canvas {
  max-width: 100%;
  border-radius: 14px;
  border: 1.5px solid #e7e5e4;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
}
.canvas-placeholder {
  padding: 5rem 1rem;
  color: #a8a29e;
  font-size: .88rem;
  border: 2px dashed #fed7aa;
  border-radius: 14px;
  text-align: center;
}

/* ─── Result actions ──────────────────────────────── */
.result-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.btn-action {
  padding: .42rem .95rem;
  border: 1.5px solid #e7e5e4;
  border-radius: 8px;
  background: #fff; font-size: .82rem; font-weight: 600;
  color: #57534e; cursor: pointer;
  transition: background .12s, border-color .12s;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex; align-items: center;
}
.btn-action:hover { background: #f5f5f4; border-color: #d6d3d1; }
.btn-action.primary { background: #ea580c; color: #fff; border-color: #ea580c; }
.btn-action.primary:hover { background: #c2410c; }

/* ─── Hashtag output ─────────────────────────────── */
.hashtag-box {
  margin-top: .75rem;
  background: #fafaf9;
  border: 1.5px solid #e7e5e4;
  border-radius: 9px;
  padding: .65rem .85rem;
  font-size: .82rem;
  color: #44403c;
  line-height: 1.8;
  word-break: break-all;
}

/* ─── Amazon ──────────────────────────────────────── */
.amazon-card h2 { margin-bottom: 0.2rem; }
.amazon-note { font-size: 0.8rem; color: #a8a29e; margin-bottom: .85rem; }
.amazon-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }
.amazon-item {
  display: block; border: 1px solid #e0e0e0; border-radius: 10px;
  padding: 0.85rem; text-decoration: none; color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
}
.amazon-item:hover { border-color: #FF9900; box-shadow: 0 2px 8px rgba(255,153,0,0.15); transform: translateY(-1px); }
.amazon-item-icon { font-size: 1.6rem; margin-bottom: 0.3rem; }
.amazon-item-name { font-size: 0.85rem; font-weight: bold; margin-bottom: 0.18rem; }
.amazon-item-desc { font-size: 0.74rem; color: #888; line-height: 1.5; margin-bottom: 0.4rem; }
.amazon-item-link { font-size: 0.76rem; color: #FF9900; font-weight: bold; }

/* ─── Toast ───────────────────────────────────────── */
#sc-toast {
  position: fixed; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(1rem);
  background: #1c1917; color: #fff;
  padding: .6rem 1.2rem; border-radius: 8px;
  font-size: .85rem; font-weight: 600;
  z-index: 9999; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
#sc-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Footer ──────────────────────────────────────── */
footer {
  text-align: center; padding: 1.5rem 1rem;
  font-size: .82rem; color: #a8a29e;
  border-top: 1px solid #e7e5e4; margin-top: auto;
}
footer a { color: #ea580c; text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer p + p { margin-top: .3rem; }

/* ─── Tips grid (rank-tracker 統一パターン) ──────── */
.tips-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.tip-item { display: flex; gap: .65rem; }
.tip-icon { font-size: 1.4rem; flex-shrink: 0; }
.tip-text strong { display: block; font-weight: 700; margin-bottom: .15rem; font-size: .88rem; }
.tip-text p { font-size: .8rem; color: #78716c; line-height: 1.55; }

/* ─── Responsive ──────────────────────────────────── */
@media (max-width: 720px) {
  .layout-cols { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .theme-grid { grid-template-columns: repeat(3, 1fr); }
  .field-row-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.4rem; }
  .amazon-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hero h1 { font-size: 1.25rem; }
  .theme-grid { grid-template-columns: repeat(3, 1fr); }
  .tips-grid { grid-template-columns: 1fr; }
}

.amazon-notice {
  font-size: 0.72rem;
  color: #bbb;
  margin-top: 0.2rem;
}

/* ━━━ FAQ ━━━ */
.faq-list { display: flex; flex-direction: column; }
.faq-item { padding: .9rem 0; border-bottom: 1px solid #f0f0f0; }
.faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.faq-q { font-size: .9rem; font-weight: 700; color: #1a73e8; margin-bottom: .35rem; }
.faq-a { font-size: .85rem; color: #555; line-height: 1.75; }
