/* ─── 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: 900px; width: 100%; margin: 0 auto; }
.logo { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }

/* ─── Main ───────────────────────────────────────── */
main { max-width: 900px; 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; }

/* ━━━ ヒーローバッジ ━━━ */
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.badge {
  display: inline-block;
  padding: 5px 13px;
  background: #ffedd5;
  color: #9a3412;
  border: 1.5px solid #fdba74;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ─── Input Card ─────────────────────────────────── */
.input-card {
  background: #fff;
  border: 1.5px solid #fed7aa;
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(234,88,12,.07);
}

.input-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .65rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.input-label { font-size: .9rem; font-weight: 700; color: #44403c; }

.input-stats { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }

.stat-chip {
  font-size: .78rem;
  font-weight: 600;
  color: #78716c;
  background: #f5f5f4;
  border-radius: 999px;
  padding: .18rem .65rem;
  white-space: nowrap;
}
.stat-chip.url-chip { color: #0369a1; background: #e0f2fe; }
.stat-chip.tag-chip { color: #7c3aed; background: #ede9fe; }

.text-area {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  border: 1.5px solid #e7e5e4;
  border-radius: 10px;
  padding: .85rem 1rem;
  font-size: .95rem;
  font-family: inherit;
  color: #1c1917;
  background: #fafaf9;
  line-height: 1.75;
  outline: none;
  transition: border-color .15s;
}
.text-area:focus { border-color: #ea580c; background: #fff; }
.text-area::placeholder { color: #a8a29e; }

.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: .6rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.opt-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  color: #57534e;
  cursor: pointer;
  user-select: none;
}
.opt-label input { accent-color: #ea580c; width: 14px; height: 14px; }

.input-actions { display: flex; gap: .5rem; }
.btn-sm {
  background: none;
  border: 1.5px solid #e7e5e4;
  border-radius: 7px;
  padding: .28rem .8rem;
  font-size: .8rem;
  color: #57534e;
  cursor: pointer;
  font-weight: 600;
  transition: background .15s, border-color .15s;
}
.btn-sm:hover { background: #f5f5f4; border-color: #d6d3d1; }

/* ─── Summary Bar ────────────────────────────────── */
.summary-bar {
  border-radius: 10px;
  padding: .7rem 1.1rem;
  margin-bottom: 1rem;
  font-size: .9rem;
  font-weight: 700;
  text-align: center;
  background: #f5f5f4;
  color: #78716c;
  transition: background .2s, color .2s;
}
.sum-bar-ok { background: #dcfce7; color: #15803d; }
.sum-bar-over { background: #fee2e2; color: #b91c1c; }
.sum-empty { color: #a8a29e; }
.sum-ok { color: #15803d; }
.sum-over { color: #b91c1c; }

/* ─── Platforms Grid ─────────────────────────────── */
.platforms-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin-bottom: 1rem;
}

/* ─── Platform Card ──────────────────────────────── */
.platform-card {
  background: #fff;
  border: 1.5px solid #e7e5e4;
  border-radius: 12px;
  padding: .9rem 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  transition: border-color .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.platform-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.08); }
.platform-card.card-warn { border-color: #fbbf24; }
.platform-card.card-over { border-color: #f87171; background: #fff5f5; }

/* Card Header */
.pc-header {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}
.pc-icon {
  font-size: 1.2rem;
  line-height: 1.2;
  flex-shrink: 0;
  margin-top: .05rem;
}
.pc-title {
  flex: 1;
  min-width: 0;
}
.pc-name {
  display: block;
  font-size: .85rem;
  font-weight: 700;
  color: #1c1917;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-note {
  display: block;
  font-size: .72rem;
  color: #a8a29e;
  margin-top: .05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badge */
.pc-badge {
  flex-shrink: 0;
  font-size: .7rem;
  font-weight: 700;
  padding: .18rem .5rem;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-empty { background: #f4f4f5; color: #a1a1aa; }
.badge-ok    { background: #dcfce7; color: #15803d; }
.badge-warn  { background: #fef9c3; color: #a16207; }
.badge-over  { background: #fee2e2; color: #b91c1c; }

/* Progress Bar */
.pc-bar-wrap {
  height: 6px;
  background: #f0efed;
  border-radius: 999px;
  overflow: hidden;
}
.pc-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ea580c, #f97316);
  transition: width .3s ease, background .3s;
  width: 0;
}
.pc-bar.bar-warn { background: linear-gradient(90deg, #d97706, #fbbf24); }
.pc-bar.bar-over { background: linear-gradient(90deg, #dc2626, #f87171); }

/* Count Text */
.pc-count {
  font-size: .8rem;
  color: #57534e;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .15rem;
}
.pc-used {
  font-weight: 700;
  color: #ea580c;
  font-size: .88rem;
}
.platform-card.card-over .pc-used { color: #dc2626; }
.pc-sep { color: #a8a29e; }
.pc-remain { color: #78716c; font-size: .75rem; }
.remain-over { color: #dc2626 !important; font-weight: 700; }

/* Action Buttons */
.pc-actions {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  margin-top: .1rem;
}

.btn-post {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: .32rem .6rem;
  font-size: .78rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: #ea580c;
  color: #fff;
  transition: background .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-post:hover { background: #c2410c; }
.btn-post.btn-post-copy { background: #44403c; }
.btn-post.btn-post-copy:hover { background: #1c1917; }

.btn-trim {
  flex: 1;
  min-width: 0;
  padding: .32rem .6rem;
  font-size: .78rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  border: 1.5px solid #fca5a5;
  background: #fff;
  color: #dc2626;
  transition: background .15s;
  white-space: nowrap;
}
.btn-trim:hover { background: #fee2e2; }

/* ─── Toast ──────────────────────────────────────── */
#sns-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  background: #1c1917;
  color: #fff;
  padding: .65rem 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);
}
#sns-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Info Card ──────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #fed7aa;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(234,88,12,.07);
  margin-bottom: 1rem;
}
.card h2 { font-size: 1.1rem; font-weight: 700; color: #ea580c; margin-bottom: .75rem; }
.tips-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.tip-item { display: flex; gap: .75rem; }
.tip-icon { font-size: 1.5rem; flex-shrink: 0; }
.tip-text strong { display: block; font-weight: 700; margin-bottom: .2rem; font-size: .9rem; }
.tip-text p { font-size: .82rem; color: #78716c; line-height: 1.5; }

/* ━━━ 活用シーン ━━━ */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.scene-item {
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: 12px;
  padding: 0.9rem 1rem;
}
.scene-item strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #9a3412;
  margin-bottom: 0.3rem;
}
.scene-item p {
  font-size: 0.8rem;
  color: #78716c;
  line-height: 1.55;
  margin: 0;
}

/* ━━━ 関連ツール ━━━ */
.related-tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.related-tool-item {
  display: block;
  background: #fff;
  border: 1.5px solid #fed7aa;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  text-decoration: none;
  color: #1c1917;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.related-tool-item:hover {
  border-color: #ea580c;
  box-shadow: 0 2px 8px rgba(234,88,12,0.15);
}
.related-tool-item span {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}
.related-tool-item small {
  display: block;
  font-size: 0.75rem;
  color: #78716c;
  font-weight: 400;
  margin-top: 0.25rem;
}

/* ─── Platform Limit Table ───────────────────────── */
.limit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  margin-top: .5rem;
}
.limit-table th {
  background: #fff7ed;
  color: #57534e;
  font-weight: 700;
  padding: .4rem .7rem;
  text-align: left;
  border-bottom: 1.5px solid #fed7aa;
}
.limit-table td {
  padding: .38rem .7rem;
  border-bottom: 1px solid #f0efed;
  color: #44403c;
}
.limit-table tr:last-child td { border-bottom: none; }
.limit-table td:nth-child(2) { font-weight: 700; color: #ea580c; text-align: right; }
.limit-table td:nth-child(3) { color: #a8a29e; font-size: .78rem; }

/* ─── 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; }

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 780px) {
  .platforms-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 1.4rem; }
}
@media (max-width: 480px) {
  .platforms-grid { grid-template-columns: 1fr; }
  .tips-grid { grid-template-columns: 1fr; }
  .scene-grid { grid-template-columns: 1fr; }
  .related-tools { grid-template-columns: 1fr; }
  .amazon-grid { grid-template-columns: 1fr; }
  .input-header { flex-direction: column; align-items: flex-start; }
  .hero h1 { font-size: 1.25rem; }
}

/* ━━━ Amazonおすすめ ━━━ */
.amazon-card h2 { margin-bottom: 0.25rem; }
.amazon-note { font-size: 0.82rem; color: #999; margin-bottom: 1rem; }
.amazon-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.amazon-item {
  display: block;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 0.9rem;
  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.7rem; margin-bottom: 0.35rem; }
.amazon-item-name { font-size: 0.88rem; font-weight: bold; margin-bottom: 0.2rem; }
.amazon-item-desc { font-size: 0.76rem; color: #888; line-height: 1.5; margin-bottom: 0.45rem; }
.amazon-item-link { font-size: 0.78rem; color: #FF9900; font-weight: bold; }

.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: #ea580c; margin-bottom: .35rem; }
.faq-a { font-size: .85rem; color: #555; line-height: 1.75; }
