:root {
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --accent: #22d3ee;
  --bg: #0f172a;
  --card-bg: #1e293b;
  --card-bg-2: #243044;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --input-bg: #0f172a;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  margin: 0;
  line-height: 1.5;
  min-height: 100vh;
}

.fixed-background-image {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 400px;
  height: 400px;
  background-image: url("img/bg-bottom-right.png");
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: contain;
  opacity: 0.4;
  z-index: -1;
  pointer-events: none;
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

header {
  margin-bottom: 30px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 30px;
  text-align: center;
}
.brand-eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  margin: 0 0 10px;
  font-weight: 600;
}
header h1 {
  font-size: 2.8rem;
  font-weight: 800;
  margin: 0;
  color: #ffffff;
  text-shadow:
    0 0 7px rgba(99, 102, 241, 0.3),
    0 0 10px rgba(99, 102, 241, 0.5),
    0 0 21px rgba(99, 102, 241, 0.8);
  letter-spacing: 0.04em;
}
header .lead {
  margin: 18px auto 0;
  max-width: 720px;
  color: var(--text-muted);
  font-size: 1rem;
}

.how-to {
  background: var(--card-bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 30px;
}
.how-to-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: var(--accent);
}
.how-to-steps {
  margin: 0;
  padding-left: 1.2em;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.9;
}
.how-to-steps li { margin-bottom: 4px; }

.main-content {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 30px;
  align-items: start;
}

.step-section {
  background: var(--card-bg);
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  margin-bottom: 30px;
  border: 1px solid var(--border);
}

.step-title {
  font-size: 1.25rem;
  color: var(--text-main);
  margin-top: 0;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

.field-group { margin-bottom: 24px; }
.field-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 10px;
  display: block;
  color: var(--text-main);
}

.subgroup-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 22px 0 12px;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
  text-transform: uppercase;
}
.subgroup-label:first-child { margin-top: 0; }

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  cursor: pointer;
  background: #334155;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  transition: all 0.2s;
  user-select: none;
  color: var(--text-main);
}
.chip:hover { background: #475569; transform: translateY(-1px); }
.chip input { display: none; }
.chip:has(input:checked) {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}
.chip.chip-none:has(input:checked) {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
  box-shadow: none;
}

.slider-wrap {
  display: flex;
  align-items: center;
  gap: 15px;
}
input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
}
.slider-val {
  min-width: 56px;
  font-family: monospace;
  font-weight: bold;
  color: var(--primary);
  text-align: right;
}

input[type="text"] {
  width: 100%;
  padding: 10px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-sizing: border-box;
  color: var(--text-main);
}
input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

/* ===== 場所カテゴリ用タブ ===== */
.place-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.place-tab-btn {
  cursor: pointer;
  background: var(--card-bg-2);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s;
}
.place-tab-btn:hover { color: var(--text-main); border-color: var(--primary); }
.place-tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}
.place-tab-btn .tab-count {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.72rem;
  opacity: 0.8;
}
.place-panel { display: none; }
.place-panel.active { display: block; }

.preview-sidebar {
  position: sticky;
  top: 20px;
}
.sticky-card {
  background: var(--card-bg);
  color: white;
  padding: 25px;
  border-radius: var(--radius);
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.5);
  border: 1px solid var(--border);
}
.sticky-card h3 {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--accent);
}
.prompt-display {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 8px;
  padding: 15px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9rem;
  min-height: 200px;
  max-height: 460px;
  overflow-y: auto;
  white-space: pre-wrap;
  margin: 15px 0;
  border: 1px solid var(--border);
  color: #e2e8f0;
}

.action-row {
  display: flex;
  gap: 10px;
}
.primary-btn {
  flex: 2;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}
.primary-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }
.secondary-btn {
  flex: 1;
  padding: 14px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}
.secondary-btn:hover { border-color: var(--primary); color: var(--text-main); }

.safety-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 15px;
  text-align: left;
  line-height: 1.6;
}

.banner-container {
  margin: 20px 0;
  width: 100%;
}
.banner-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--input-bg);
  transition: all 0.2s ease;
  text-decoration: none;
}
.banner-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 557 / 112;
  object-fit: contain;
  display: block;
}
.banner-item:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.about-tool {
  margin-top: 50px;
  padding: 30px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  line-height: 1.8;
}
.about-tool h2 {
  font-size: 1.1rem;
  color: var(--text-main);
  margin: 0 0 14px;
}
.about-tool p { margin: 0 0 12px; font-size: 0.9rem; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--accent);
  color: #06121a;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1000px) {
  .main-content { grid-template-columns: 1fr; }
  .preview-sidebar { position: static; }
  header h1 { font-size: 2.2rem; }
  .fixed-background-image { width: 240px; height: 240px; opacity: 0.25; }
}
@media (max-width: 560px) {
  .app-container { padding: 24px 14px; }
  .step-section { padding: 20px; }
  header h1 { font-size: 1.8rem; }
  .action-row { flex-direction: column; }
  .place-tabs { gap: 4px; }
  .place-tab-btn { padding: 6px 12px; font-size: 0.76rem; }
}