:root {
  --bg: #f7f5f0;
  --card: #ffffff;
  --text: #2f2a24;
  --muted: #8a8278;
  --main: #6b8f71;
  --main-dark: #557a5b;
  --accent: #e9f1ea;
  --line: #e4ded4;
  --error: #c0392b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

.app-header {
  background: var(--main);
  color: #fff;
  text-align: center;
  padding: 14px 16px 12px;
}
.app-header .brand { margin: 0; font-size: 12px; letter-spacing: .15em; opacity: .85; }
.app-header h1 { margin: 2px 0 0; font-size: 18px; font-weight: 700; }

main { max-width: 480px; margin: 0 auto; padding: 20px 16px 40px; }

.view { display: flex; flex-direction: column; gap: 14px; }
.hidden { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.big { font-size: 48px; text-align: center; }
.error-text { color: var(--error); font-size: 14px; margin: 0; }
.description { margin: 0; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: 13px; font-weight: 700; }
.field input {
  font-size: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.btn-main, .btn-sub {
  width: 100%;
  font-size: 16px;
  font-weight: 700;
  padding: 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
}
.btn-main { background: var(--main); color: #fff; }
.btn-main:active { background: var(--main-dark); }
.btn-main:disabled { background: #c9c3b9; cursor: default; }
.btn-sub { background: transparent; color: var(--main-dark); border: 1px solid var(--main); }

.status-card {
  background: var(--card);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.hello { margin: 0 0 10px; font-weight: 700; }
.meter { display: flex; justify-content: center; gap: 10px; }
.dot {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--line);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.dot.on { background: var(--main); border-color: var(--main); color: #fff; }
.meter-text { margin: 10px 0 0; font-size: 14px; }

.notice {
  background: var(--accent);
  border-radius: 10px;
  padding: 14px;
  font-size: 14px;
}

.section-title { margin: 6px 0 0; font-weight: 700; }
.deadline { margin: 0; font-size: 13px; color: var(--muted); }

/* 商品カード（画像＋英字ロゴ＋説明。動きなし） */
.product-grid { display: flex; flex-direction: column; gap: 12px; }
.product {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: stretch;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.product.selected { border-color: var(--main); box-shadow: 0 0 0 1px var(--main); background: #fbfcfa; }
.product-img {
  flex: none;
  width: 96px; height: 120px;
  border-radius: 10px;
  object-fit: cover;
  background: #ece9e3;
}
.product-noimg {
  display: flex; align-items: center; justify-content: center;
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-size: 15px; letter-spacing: .12em; color: #7d766c;
  background: linear-gradient(160deg, #f1eee8, #e3ded5);
}
.product-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 2px 24px 2px 0; }
.product-en {
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-size: 17px; font-weight: 600; letter-spacing: .14em; line-height: 1.2;
  color: var(--text);
}
.product-name { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.product-catch { margin-top: 6px; font-size: 14px; font-weight: 700; line-height: 1.45; color: var(--main-dark); }
.product-desc { font-size: 12px; line-height: 1.6; color: #5e574e; }
.product-check {
  position: absolute; top: 12px; right: 12px;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: #fff;
}
.product.selected .product-check { border-color: var(--main); background: var(--main); }
.product.selected .product-check::after {
  content: "";
  position: absolute; left: 6px; top: 2.5px;
  width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* 申請ボタンを画面下に固定（商品が縦に長いため） */
#apply-btn { position: sticky; bottom: 12px; box-shadow: 0 4px 12px rgba(0,0,0,.12); }

.history ul { list-style: none; margin: 6px 0 0; padding: 0; }
.history li {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  align-items: center;
}
.badge {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  letter-spacing: .05em;
}
.badge.shipped { background: #efece6; color: var(--muted); }
.badge.planned { background: var(--accent); color: var(--main-dark); border: 1px solid var(--main); }

.test-tools {
  margin-top: 16px;
  padding: 12px;
  border: 1px dashed #c9c3b9;
  border-radius: 10px;
  text-align: center;
}
.test-tools p { margin: 0 0 8px; }

.confirm-card {
  background: var(--card);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
}
.confirm-img {
  display: flex; margin: 0 auto 12px;
  width: 140px; height: 140px;
  border-radius: 12px; object-fit: cover;
}
.confirm-product { margin: 0; font-size: 18px; font-weight: 700; color: var(--main-dark); }
.confirm-seq { margin: 2px 0 8px; font-size: 13px; color: var(--muted); }

.done-text { text-align: center; margin: 0; }
#done-timing { text-align: center; margin: 0; }

.spinner {
  width: 36px; height: 36px;
  margin: 40px auto 0;
  border: 4px solid var(--line);
  border-top-color: var(--main);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#view-loading, #view-sending { text-align: center; }
