/* ガーランド・パーティー飾りメーカー（三角旗をA4面付け印刷）
   ticket-maker / medal と同じ「単一SVGシート→印刷／PNG」方式。プレフィックス gl- */

/* ============ レイアウト ============ */
.gl-layout {
  display: flex;
  gap: 28px;
  max-width: 1120px;
  margin: 18px auto 40px;
  padding: 0 4px;
  align-items: flex-start;
}

/* --- フォーム --- */
.gl-form {
  width: 380px;
  flex-shrink: 0;
  text-align: left;
}
.gl-form .fs-title {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  margin: 20px 0 8px;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--accent, #2a9d8f);
}
.gl-form .fs-title:first-child {
  margin-top: 0;
}
.gl-form input[type='text'] {
  box-sizing: border-box;
  width: 100%;
  font-size: 16px;
  color: #333;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
}
.gl-hint {
  font-size: 11.5px;
  color: #888;
  margin: 6px 0 0;
  line-height: 1.6;
}

.gl-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.gl-preset {
  border: 1px solid #dbe3ea;
  background: #f8fafc;
  color: #475569;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
}
.gl-preset:hover {
  background: #eef2f7;
  border-color: var(--accent, #2a9d8f);
}

/* 形・配色のチップ */
.gl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.gl-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.gl-chips input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.gl-chip:hover {
  background: #f1f5f9;
}
.gl-chip:has(input:checked) {
  border-color: var(--accent, #2a9d8f);
  background: var(--accent, #2a9d8f);
  color: #fff;
}
.gl-shape-ic {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.gl-dots {
  display: inline-flex;
  gap: 2px;
}
.gl-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.18);
  display: inline-block;
}

.gl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin-top: 6px;
}
.gl-row label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-size: 13.5px;
  color: #333;
  cursor: pointer;
}

.gl-count {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid #cfe8e3;
  background: #f2fbf9;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: #1f6f64;
  line-height: 1.6;
}
.gl-warn {
  display: block;
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid #f0b429;
  background: #fff8e6;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #8a5a00;
  line-height: 1.5;
}
.gl-warn[hidden] {
  display: none;
}

/* 組み立ての図解 */
.gl-howto {
  margin-top: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fbfdff;
  padding: 12px 14px 8px;
}
.gl-howto-title {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  margin: 0 0 6px;
}
.gl-howto svg {
  width: 100%;
  height: auto;
  display: block;
}

/* --- プレビュー側 --- */
.gl-preview {
  flex: 1;
  min-width: 0;
  position: sticky;
  top: 16px;
  align-self: flex-start;
  text-align: center;
}
.gl-btn-row {
  display: flex;
  gap: 10px;
}
.gl-print-btn,
.gl-png-btn {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.gl-print-btn {
  background: var(--accent, #2a9d8f);
  color: #fff;
}
.gl-png-btn {
  background: #fff;
  color: var(--accent, #2a9d8f);
  border: 2px solid var(--accent, #2a9d8f);
  padding: 12px;
}
.gl-print-btn:hover,
.gl-png-btn:hover {
  opacity: 0.82;
}
.gl-scale-warn {
  display: block;
  margin: 8px 0 4px;
  padding: 8px 10px;
  border: 1px solid #f0b429;
  background: #fff8e6;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #8a5a00;
  line-height: 1.5;
  text-align: left;
}
.gl-print-note {
  font-size: 12px;
  color: #888;
  margin: 4px 0 10px;
  line-height: 1.5;
}
.gl-sheet-info {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin: 0 0 8px;
  min-height: 1.2em;
}
.gl-caption {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
}

/* A4シート */
.gl-sheet-box {
  overflow: hidden;
  border-radius: 4px;
}
.gl-sheet-box + .gl-sheet-box {
  margin-top: 16px;
}
.gl-sheet {
  width: 210mm;
  height: 297mm;
  background: #fff;
  box-sizing: border-box;
  position: relative;
  transform-origin: top left;
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
}
.gl-sheet svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ============ レスポンシブ ============ */
@media (max-width: 940px) {
  .gl-layout {
    flex-direction: column;
  }
  .gl-form {
    width: 100%;
  }
  .gl-preview {
    position: static;
    width: 100%;
  }
}

/* ============ 印刷：シートだけをA4いっぱいに ============ */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }
  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    height: auto !important;
  }
  body > *:not(.container) {
    display: none !important;
  }
  .container {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: auto !important;
  }
  .container > *:not(.gl-layout) {
    display: none !important;
  }
  .gl-layout {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
  }
  .gl-layout > *:not(.gl-preview) {
    display: none !important;
  }
  .gl-preview {
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
  }
  .gl-preview > *:not(.gl-sheet-wrap) {
    display: none !important;
  }
  .gl-sheet-box {
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    border-radius: 0 !important;
    break-after: page;
    page-break-after: always;
  }
  .gl-sheet-box:last-child {
    break-after: auto;
    page-break-after: auto;
  }
  .gl-sheet {
    transform: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    width: 210mm !important;
    height: 296mm !important;
    overflow: hidden !important;
  }
}
