/* ============================================
   OMOCHI Common Styles
   読みやすさ改善版 - 2026-04-15
   ============================================ */

/* --- カラー変数 --- */
:root {
  --c-bg:        #F7F4EF;
  --c-surface:   #ffffff;
  --c-border:    #e8e0d4;
  --c-border-md: #d8d0c4;

  /* テキスト - 従来より全体的に濃く */
  --c-text:      #1a1714;   /* メインテキスト  旧:#2d2a25 */
  --c-text-sub:  #5a5248;   /* サブテキスト   旧:#a09880 */
  --c-text-hint: #7a7060;   /* ヒント・補足   旧:#a09880 */
  --c-text-mute: #8a8070;   /* ミュート       旧:#a09880 */

  /* アクセント */
  --c-accent:    #8B7355;
  --c-danger:    #8B3A2A;
  --c-success:   #3A6B2A;
  --c-info:      #2A4A6B;
}

/* --- リセット --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100vh;
  padding-bottom: 120px;
  -webkit-font-smoothing: antialiased;
}

/* --- ヘッダー --- */
.header {
  background: var(--c-surface);
  border-bottom: 0.5px solid var(--c-border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-logo img { height: 28px; width: auto; }
.header-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--c-text);
  flex: 1;
}
.header-spacer { flex: 1; }
.back-btn {
  background: none;
  border: none;
  font-size: 14px;
  color: var(--c-text-sub);
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
}

/* --- アバター --- */
.avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--c-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  border: none;
  font-family: inherit;
  flex-shrink: 0;
}

/* --- メインコンテンツ --- */
.main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

/* --- セクションラベル --- */
.section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-sub);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-left: 2px;
}

/* --- カード --- */
.card {
  background: var(--c-surface);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 0.5px solid var(--c-border);
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-sub);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- アプリカード --- */
.app-card {
  background: var(--c-surface);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-decoration: none;
  border: 0.5px solid var(--c-border);
  transition: all 0.15s;
}
.app-card:hover { transform: translateY(-1px); border-color: var(--c-border-md); }
.app-card.locked { opacity: 0.45; pointer-events: none; }
.app-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-info { flex: 1; }
.app-name {
  font-size: 16px;          /* 旧:14px */
  font-weight: 500;
  color: var(--c-text);     /* 旧:#2d2a25 */
  margin-bottom: 4px;
}
.app-desc {
  font-size: 12px;
  color: var(--c-text-hint); /* 旧:#a09880 */
  line-height: 1.6;          /* 旧:1.4 */
}
.app-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  margin-left: auto;
  flex-shrink: 0;
}
.badge-free   { background: #e8f0e8; color: #2a5a1a; }
.badge-pro    { background: #ede8f5; color: #4A2A8B; }
.badge-soon   { background: #f0ede8; color: var(--c-text-sub); }
.app-arrow    { color: #b8b0a4; font-size: 18px; margin-left: 4px; flex-shrink: 0; }

/* --- ナビゲーションタブ --- */
.nav-tabs {
  display: flex;
  background: var(--c-surface);
  border-bottom: 0.5px solid var(--c-border);
}
.nav-btn {
  flex: 1;
  padding: 12px 4px;
  font-size: 14px;           /* 旧:13px */
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  color: var(--c-text-sub);  /* 旧:#a09880 */
  font-family: inherit;
  transition: all 0.15s;
}
.nav-btn.active {
  color: var(--c-text);
  border-bottom-color: var(--c-text);
  font-weight: 500;
}

/* --- フォーム --- */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;           /* 旧:12px */
  color: var(--c-text-sub);  /* 旧:#7a7060 */
  margin-bottom: 5px;
  font-weight: 500;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0 12px;
  border: 0.5px solid var(--c-border-md);
  border-radius: 10px;
  font-size: 14px;
  color: var(--c-text);
  background: #faf8f5;
  font-family: inherit;
}
.field input { height: 44px; }
.field select { height: 44px; }
.field textarea { padding: 10px 12px; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--c-accent);
}

/* --- ボタン --- */
.btn-primary {
  width: 100%;
  height: 44px;
  background: var(--c-text);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary:hover { background: #4a4540; }
.btn-secondary {
  height: 40px;
  background: var(--c-surface);
  border: 0.5px solid var(--c-border-md);
  border-radius: 10px;
  font-size: 13px;
  color: var(--c-text);
  cursor: pointer;
  font-family: inherit;
  padding: 0 16px;
}
.btn-danger {
  background: none;
  border: 0.5px solid #e0c8c4;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--c-danger);
  cursor: pointer;
  font-family: inherit;
}

/* --- メッセージ --- */
.msg {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 8px;
  line-height: 1.6;
}
.msg.error   { background: #fdf0ed; color: var(--c-danger); }
.msg.success { background: #edf5e8; color: var(--c-success); }
.msg.info    { background: #edf2f8; color: var(--c-info); }

/* --- 店舗情報 --- */
.store-info {
  background: var(--c-surface);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 0.5px solid var(--c-border);
}
.store-info-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--c-text);
}
.store-info-id {
  font-size: 12px;
  color: var(--c-text-hint);
  margin-top: 3px;
  font-family: monospace;
}

/* --- タグ・バッジ --- */
.tag {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  display: inline-block;
}

/* --- 空状態 --- */
.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--c-text-sub);
  font-size: 14px;
  line-height: 1.8;
}

/* --- アップロードエリア --- */
.upload-area {
  border: 1.5px dashed var(--c-border-md);
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  background: #faf8f5;
  transition: all 0.15s;
}
.upload-area:hover { border-color: var(--c-accent); background: #f5f0e8; }
.upload-area p    { font-size: 14px; color: var(--c-text-sub); margin-top: 10px; }
.upload-area small { font-size: 12px; color: var(--c-text-hint); margin-top: 4px; display: block; }

/* --- 結果ボックス --- */
.result-box {
  background: #f5f0e8;
  border-radius: 10px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--c-text);      /* 旧:#4a4540 */
  white-space: pre-wrap;
  word-break: break-all;
}

/* --- スピナー --- */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--c-border);
  border-top-color: var(--c-text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- フッターナビ --- */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--c-surface);
  border-top: 0.5px solid var(--c-border);
  z-index: 99;
}
.footer-nav {
  display: flex;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}
.footer-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  padding: 6px 0;
}
.footer-label {
  font-size: 10px;
  color: var(--c-text-hint);
}
.footer-btn.active .footer-label {
  color: var(--c-text);
  font-weight: 500;
}
.footer-copy {
  text-align: center;
  padding: 10px 16px 8px;
  border-top: 0.5px solid #f0ede8;
}
.footer-copy-tagline {
  font-size: 11px;
  color: var(--c-text-hint);
  line-height: 1.6;
}
.footer-copy-cr {
  font-size: 10px;
  color: var(--c-text-mute);
  margin-top: 3px;
}

/* --- プロフィールドロワー --- */
.profile-label {
  font-size: 12px;
  color: var(--c-text-sub);
  margin-bottom: 3px;
}
.profile-value {
  font-size: 15px;
  color: var(--c-text);
  font-weight: 500;
}

/* --- リスト系 --- */
.list-date {
  font-size: 12px;
  color: var(--c-text-hint);
  margin-top: 4px;
}
.product-name {
  font-weight: 500;
  font-size: 15px;
  margin-bottom: 6px;
  color: var(--c-text);
}
.selected-label {
  font-size: 13px;
  color: var(--c-text-sub);
  margin-bottom: 10px;
  min-height: 20px;
}
