:root {
  --bg: #0f1220;
  --card: #171a2b;
  --text: #f2f4ff;
  --muted: #a7add6;
  --accent: #7aa2ff;
  --error: #ff6b6b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container { max-width: 1100px; margin: 0 auto; padding: 18px; }
h1, h2, h3 { margin: 0 0 10px; }
.muted { color: var(--muted);}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.full { grid-column: 1 / -1; }

.card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px;
}

.form { display: grid; gap: 12px; }
input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: var(--text);
}
button {
  padding: 10px 12px;
  border-radius: 10px;
  border: 0;
  background: var(--accent);
  color: #0b1020;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 8px; /* 下に余白 */
}
.error {
  margin-top: 12px;
  color: var(--text);
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.35);
  padding: 10px 12px;
  border-radius: 10px;
}
.blueprint {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .full { grid-column: auto; }
}

.code-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.code_selector{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 0 5px;
}

.copy-btn{
  padding: 10px 12px;
  border-radius: 10px;
  border: 0;
  background: var(--accent);
  color: #0b1020;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* トースト */
/* トースト（右上） */
.toast{
  position: fixed;
  right: 16px;
  top: 16px;          /* ← bottom ではなく top */
  /* bottom: 16px;    ← これは削除 */

  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(11,16,32,0.92);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);

  opacity: 0;
  transform: translateY(-8px); /* 上からスッと出る感じに */
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.show{
  opacity: 1;
  transform: translateY(0);
}

/* ===== Toggle Switch ===== */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.toggle-label {
  color: var(--muted);
  font-size: 14px;
}

/* アクセシブルに隠す */
.toggle input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.toggle-track {
  width: 52px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.15);
  position: relative;
  display: inline-block;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}

.toggle-thumb {
  width: 24px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255,255,255,0.90);
  position: absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  transition: left .18s ease, background .18s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

/* ON */
.toggle input[type="checkbox"]:checked + .toggle-track {
  background: color-mix(in srgb, var(--accent) 55%, rgba(255,255,255,0.10));
  border-color: rgba(122,162,255,0.65);
}
.toggle input[type="checkbox"]:checked + .toggle-track .toggle-thumb {
  left: 23px;
  background: #fff;
}

/* フォーカス（キーボード操作） */
.toggle input[type="checkbox"]:focus-visible + .toggle-track {
  outline: 2px solid rgba(122,162,255,0.85);
  outline-offset: 3px;
}

/* 無効状態 */
.toggle input[type="checkbox"]:disabled + .toggle-track {
  opacity: .5;
  cursor: not-allowed;
}

.chartBox {
  height: 300px;   /* ここが重要 */
}

/* モダンselect */
.select-wrap{
  position: relative;
  display: inline-block;
  min-width: 280px; /* お好みで */
}

/* 矢印（SVG） */
.select-wrap::after{
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.85;
  background-repeat: no-repeat;
  background-size: 18px 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%23a78bfa' d='M5.3 7.7a1 1 0 0 1 1.4 0L10 11l3.3-3.3a1 1 0 1 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 0-1.4z'/%3E%3C/svg%3E");
}

.select-modern{
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  width: 100%;
  padding: 10px 42px 10px 12px; /* 右は矢印分余白 */
  border-radius: 12px;


  backdrop-filter: blur(8px);

  background: rgba(15, 23, 42, 0.55);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.25);

  font-size: 14px;
  line-height: 1.2;

  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  transition: border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}

.select-modern:hover{
  border-color: rgba(99, 102, 241, 0.55); /* indigo */
}

.select-modern:focus{
  outline: none;
  border-color: rgba(99, 102, 241, 0.75);
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.10),
    0 0 0 4px rgba(99, 102, 241, 0.18); /* フォーカスリング */
}

.select-modern:active{
  transform: translateY(1px);
}

/* 無効化時 */
.select-modern:disabled{
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

label[for="blueprintSelector"]{
  white-space: nowrap; /* 折り返し禁止 */
  flex-shrink: 0;      /* flexで潰されない */
}