:root {
  --primary: #1e3a5f;
  --primary-light: #2d5a8e;
  --accent: #4a90d9;
  --accent2: #f5a623;
  --bg: #f4f7fb;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --muted: #6b7280;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(30,58,95,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
}

/* ===== HEADER ===== */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 32px 24px;
  text-align: center;
}
.header-logo {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  opacity: 0.7;
  margin-bottom: 8px;
}
.header-title { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.header-sub { font-size: 13px; opacity: 0.8; }

/* ===== PROGRESS ===== */
.progress-wrap {
  background: var(--card-bg);
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}
.progress-label {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  flex: 1;
  cursor: default;
  transition: color 0.3s;
}
.progress-label.active { color: var(--accent); font-weight: 700; }
.progress-label.done { color: var(--primary); }

.progress-bar {
  background: var(--border);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
}
.progress-fill {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
}
.progress-text {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* ===== MAIN ===== */
.main { max-width: 760px; margin: 0 auto; padding: 32px 16px 80px; }

/* ===== STEP ===== */
.step { display: none; animation: fadeIn 0.3s ease; }
.step.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.badge {
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 700;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-header h2 { font-size: 20px; font-weight: 700; color: var(--primary); }

/* ===== CARD ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* ===== FORM ===== */
.form-group { margin-bottom: 20px; }
.form-group:last-child { margin-bottom: 0; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label { display: block; font-size: 13px; font-weight: 600; color: var(--primary); margin-bottom: 6px; }
.req { background: #ef4444; color: white; font-size: 10px; padding: 2px 6px; border-radius: 4px; margin-left: 6px; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fafcff;
  transition: border-color 0.2s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  background: white;
}
textarea { resize: vertical; }

/* Radio & Checkbox */
.radio-group, .check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
.check-group.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.rl, .cl {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
  background: #fafcff;
}
.rl:hover, .cl:hover { border-color: var(--accent); background: #f0f7ff; }
.rl input, .cl input { accent-color: var(--accent); }

/* Palette */
.hint { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 4px; }

.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.palette-card {
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}
.palette-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.palette-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74,144,217,0.3); }

.palette-strip {
  display: flex;
  height: 40px;
}
.palette-strip span { display: block; }
.palette-strip .c1 { flex: 7; }
.palette-strip .c2 { flex: 2; }
.palette-strip .c3 { flex: 1; }

.palette-info {
  padding: 8px 10px;
  background: white;
}
.palette-name { font-size: 12px; font-weight: 700; color: var(--primary); }
.palette-desc { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* HP exists toggle */
.js-hp-exists { display: none; }

/* ===== COMPLETE ===== */
.complete-box {
  margin-top: 24px;
  background: linear-gradient(135deg, #f0f7ff, #e8f5e9);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.complete-msg { font-size: 15px; line-height: 1.8; margin-bottom: 20px; color: var(--primary); }
.dl-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.btn-next {
  background: var(--primary);
  color: white;
}
.btn-next:hover { background: var(--primary-light); transform: translateY(-1px); }

.btn-prev {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
}
.btn-prev:hover { border-color: var(--primary); color: var(--primary); }

.btn-pdf { background: #ef4444; color: white; }
.btn-pdf:hover { background: #dc2626; }
.btn-svg { background: var(--primary); color: white; }
.btn-svg:hover { background: var(--primary-light); }

/* ===== NAV ===== */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding: 0 4px;
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--muted);
}

/* ===== PRINT VIEW ===== */
#printView { display: none; }

@media print {
  @page { size: A4; margin: 10mm; }
  .app { display: none !important; }
  #printView {
    display: block !important;
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', sans-serif;
    font-size: 11px;
    color: #1a1a2e;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .pv-header {
    background: var(--primary, #1e3a5f);
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 12px;
  }
  .pv-header h1 { font-size: 16px; margin-bottom: 2px; }
  .pv-header p { font-size: 11px; opacity: 0.8; }
  .pv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .pv-section { break-inside: avoid; margin-bottom: 8px; }
  .pv-section-title {
    background: var(--primary, #1e3a5f);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 3px;
    margin-bottom: 4px;
  }
  .pv-row { display: flex; gap: 4px; margin-bottom: 3px; font-size: 10px; }
  .pv-label { color: #6b7280; flex-shrink: 0; width: 72px; }
  .pv-val { color: #1a1a2e; flex: 1; word-break: break-all; }
  .pv-colors {
    margin-top: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    break-inside: avoid;
  }
  .pv-colors-title { font-size: 10px; font-weight: bold; color: #1a1a2e; margin-bottom: 6px; }
  .pv-color-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
  .pv-swatch { width: 40px; height: 14px; border-radius: 3px; display: inline-block; }
  .pv-color-info { font-size: 10px; color: #1a1a2e; }
  .pv-footer { text-align: right; font-size: 9px; color: #9ca3af; margin-top: 8px; }
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .check-group.grid2 { grid-template-columns: 1fr; }
  .header-title { font-size: 18px; }
}
