:root {
  --bg: #f5f7f9;
  --card: #ffffff;
  --primary: #5c4b48;
  --accent: #4a90e2;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --border: #dcdde1;
  --radius: 12px;
  --shadow: 0 8px 20px rgba(0,0,0,.06);
  --danger: #e74c3c;
  --success: #2ecc71;
}

* { box-sizing: border-box; }
body {
  margin: 0; padding: 1.5rem 1rem;
  font-family: "Inter", "Noto Sans JP", sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.5; display: flex; justify-content: center;
}

.container { width: 100%; max-width: 680px; }
header { text-align: center; margin-bottom: 1.5rem; }
h2 { margin: 0; font-size: 1.5rem; color: var(--primary); }

.seg { display: flex; gap: 4px; background: #edeff2; padding: 4px; border-radius: 12px; margin-bottom: 1.5rem; }
.seg button {
  flex: 1; padding: .6rem; border-radius: 10px; border: none;
  background: transparent; cursor: pointer; font-weight: 600; color: var(--text-light);
  transition: all .2s ease; font-size: 0.9rem;
}
.seg button.active { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}

.form-group { margin-bottom: 1rem; }
label { display: block; font-weight: 600; margin-bottom: .4rem; font-size: 0.85rem; color: var(--primary); }

input[type="text"], select {
  width: 100%; padding: .75rem; font-size: 1rem; border: 1px solid var(--border);
  border-radius: 8px; transition: all .2s; background: #fff;
  appearance: none; -webkit-appearance: none;
}
.select-wrapper { position: relative; }
.select-wrapper::after {
  content: "▼"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 0.7rem; color: var(--text-light); pointer-events: none;
}

input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74,144,226,.1); }

.row { display: flex; gap: 10px; }
.row > div { flex: 1; }

.btn-main {
  width: 100%; padding: .85rem; font-size: 1rem; font-weight: 700; border: none;
  border-radius: 8px; cursor: pointer; transition: all .2s;
  background: var(--accent); color: white; margin-bottom: 1rem;
}
.btn-main:hover { opacity: 0.9; transform: translateY(-1px); }

.result {
  display: none; animation: slideUp 0.3s ease-out;
  background: #fff; border-radius: var(--radius);
  padding: 1.5rem; margin-bottom: 1rem; border: 1px solid var(--border);
}
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.result h3 { margin: 0 0 1rem; font-size: 1rem; color: var(--primary); border-left: 4px solid var(--accent); padding-left: 0.8rem; }

.sim-conditions {
  background: #f8f9fa; border-radius: 8px; padding: 1rem; margin-bottom: 1.5rem; font-size: 0.85rem; border: 1px solid #eee;
}
.sim-conditions table { width: 100%; border-collapse: collapse; }
.sim-conditions th { text-align: left; color: var(--text-light); width: 40%; padding: 4px 0; font-weight: 400; }
.sim-conditions td { text-align: right; color: var(--primary); font-weight: 700; padding: 4px 0; }

.result ul { list-style: none; padding: 0; margin: 0; }
.result li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.8rem 0; border-bottom: 1px solid #f1f2f6;
}
.result li:last-child { border-bottom: none; }

.mall-info { display: flex; flex-direction: column; }
.mall-name { font-weight: 700; font-size: 1rem; display: flex; align-items: center; gap: 6px; }
.mall-sub { font-size: 0.75rem; color: var(--text-light); }

.price-box { text-align: right; }
.price-val { font-weight: 700; font-size: 1.1rem; color: var(--primary); }

.diff-badge {
  font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; font-weight: bold;
}
.diff-plus { background: #fff0f0; color: #d9534f; }
.diff-minus { background: #f0fdf4; color: #2ecc71; }
.diff-base { background: #f1f2f6; color: #7f8c8d; }

.error-msg { background: #fff5f5; color: #c0392b; padding: 1rem; border-radius: 8px; font-weight: bold; text-align: center; font-size: 0.9rem; border: 1px solid #feb2b2; }

.note { font-size: .75rem; color: #95a5a6; margin-top: 1rem; line-height: 1.4; }
.note-accent { color: #e67e22; font-weight: bold; }
.btn-toggle { background: none; border: 1px solid var(--border); color: var(--text-light); width: 100%; padding: 0.5rem; border-radius: 8px; cursor: pointer; font-size: 0.8rem; margin-top: 10px; }

.info-container { display: none; margin-top: 1rem; overflow-x: auto; border: 1px solid #eee; border-radius: 8px; background: white; padding: 1rem; }
.table-section { margin-bottom: 1.5rem; }
.table-section:last-child { margin-bottom: 0; }
.table-section h4 { font-size: 0.85rem; margin-bottom: 0.5rem; color: var(--primary); border-bottom: 1px solid #eee; padding-bottom: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 0.7rem; }
th, td { border: 1px solid #eee; padding: 6px 4px; text-align: center; }
th { background: #f9fafb; color: var(--text-light); font-weight: 600; }
.cell-disabled { background: #f5f5f5; color: #ccc; }
.cell-rakuten { background: #fff9f9; font-weight: bold; }
