/* TrendPort の色と操作の部品（正本は brand/DESIGN.md）。どの HTML も type.css のあとにこれを読む。
   <link rel="stylesheet" href="…/brand/type.css">
   <link rel="stylesheet" href="…/brand/ui.css">
   アプリが今使っている変数名（--bg・--surface・--text・--muted・--line・--accent・--accent-ink・--accent-soft）を
   ここでブランドの色に決めるので、各アプリは自分の :root の色の定義を消せば、そのまま全サイト同じ配色になる。 */

:root {
  color-scheme: light;               /* ダークモードは作らない（全サイトの見た目をそろえる） */

  /* 面と文字 */
  --bg: #F2F5FC;                     /* ページの地（青みの薄いグレー） */
  --surface: #FFFFFF;                /* カード・選択肢の地 */
  --text: #0B1F5C;                   /* 文字＝アイコンの紺 */
  --muted: #5B6787;                  /* 補足の文字（地の上で 5:1 以上） */
  --line: #DCE2F0;                   /* 罫線・選択肢の枠 */

  /* 押すもの＝青だけ */
  --accent: #2F6BFF;                 /* 次に進むボタン・選んだ選択肢 */
  --accent-ink: #FFFFFF;
  --accent-soft: #E6EDFF;            /* 押せる物の薄い地・選んだ選択肢の地（複数選択） */
  --accent-press: #1F55D9;           /* 押している間 */

  /* 目立たせるもの＝ミント（押せない）。白地の上の文字には使わない（読みにくい） */
  --highlight: #5EEAD4;
  --highlight-soft: #DCF7F2;

  /* ブランドの面（ヘッダー・シェア画像の枠・結果の見出し） */
  --brand-gradient: linear-gradient(135deg, #0B1F5C 0%, #2F6BFF 100%);

  /* 余白の段（brand/DESIGN.md 15。8の倍数だけを使う。半端な値を書かない） */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 16px; --sp-4: 24px;
  --sp-5: 32px; --sp-6: 48px; --sp-7: 64px; --sp-8: 96px;
  --gutter: 16px;                    /* 画面の左右の余白（スマホ）。PC は 24px 以上 */

  /* エラーだけ */
  --danger: #D93A3A;

  /* 形 */
  --radius: 16px;
  --radius-sm: 12px;
  --tap: 52px;                       /* 押せる物の高さの下限（指で押しやすい大きさ） */
  --shadow: 0 10px 30px rgba(11, 31, 92, .12);
}

body { background: var(--bg); color: var(--text); }

/* ── ボタン: 1画面に「次に進む」は1つだけ。青く塗ったものだけが主役 ── */
.tp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 24px; border-radius: 999px; border: 2px solid transparent;
  font: 700 16px/1 var(--tp-font-ja); letter-spacing: .04em; text-decoration: none; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); transition: background .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.tp-btn:active { background: var(--accent-press); transform: scale(.98); }
.tp-btn:focus-visible { outline: 3px solid var(--highlight); outline-offset: 2px; }
.tp-btn[disabled], .tp-btn[aria-disabled="true"] { background: #C9D2E6; color: #fff; cursor: not-allowed; transform: none; }
.tp-btn--sub { background: var(--surface); color: var(--text); border-color: var(--text); }        /* 2番目の操作（保存・やり直す） */
.tp-btn--sub:active { background: var(--accent-soft); }
.tp-btn--block { display: flex; width: 100%; }

/* ── 下のバー: 次に進むボタンを、スクロールしても画面の下に出しておく ── */
.tp-actionbar {
  position: sticky; bottom: 0; z-index: 20; display: grid; gap: 8px;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  background: rgba(242, 245, 252, .94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.tp-actionbar .tp-hint { text-align: center; font-size: 13px; color: var(--muted); margin: 0; }
.tp-actionbar--two { grid-template-columns: 1fr 1fr; }

/* ── 進みぐあい: 「いま何問目か・あと何問か」を上に出す ── */
.tp-progress { display: flex; align-items: center; gap: 16px; font: 700 14px/1 var(--tp-font-ja); color: var(--muted); }
.tp-progress .bar { flex: 1; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.tp-progress .bar i { display: block; height: 100%; width: var(--p, 0%); background: var(--accent); border-radius: inherit; transition: width .3s; }

/* ── 戻る ── */
.tp-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--muted); font: 700 14px/1 var(--tp-font-ja); cursor: pointer; text-decoration: none; }

/* ── 問いかけ: 何をすればいいかを1行で（動詞で終える） ── */
.tp-ask { margin: 0; font: 700 22px/1.45 var(--tp-font-ja); letter-spacing: .02em; }
.tp-ask + .tp-sub { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

/* ── 選択肢: 押せると分かる枠＋影、選んだら青く塗って ✓ を出す ── */
.tp-choices { display: grid; gap: 8px; margin-top: 16px; }
.tp-choices--2 { grid-template-columns: 1fr 1fr; }
.tp-choices--chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tp-choice {
  position: relative; display: flex; align-items: center; gap: 8px; min-height: var(--tap); width: 100%;
  padding: 16px 64px 16px 16px; border-radius: var(--radius-sm); border: 2px solid var(--line);
  background: var(--surface); color: var(--text); text-align: left; cursor: pointer;
  font: 700 16px/1.4 var(--tp-font-ja); box-shadow: 0 2px 0 var(--line); transition: border-color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.tp-choices--chips .tp-choice { width: auto; border-radius: 999px; padding: 8px 48px 8px 16px; }
.tp-choices--chips .tp-choice::after { width: 16px; height: 16px; right: 16px; }
.tp-choice::after {               /* 右の丸（選ぶ前は空、選んだら ✓） */
  content: ""; position: absolute; right: 16px; top: 50%; width: 24px; height: 24px; transform: translateY(-50%);
  border-radius: 50%; border: 2px solid var(--line); background: var(--surface);
}
.tp-choice:active { transform: translateY(1px); box-shadow: none; }
.tp-choice[aria-pressed="true"], .tp-choice[aria-checked="true"] {
  border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 2px 0 var(--accent);
}
.tp-choice[aria-pressed="true"]::after, .tp-choice[aria-checked="true"]::after {
  border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3 3 7-7' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat;
}
.tp-choice:focus-visible { outline: 3px solid var(--highlight); outline-offset: 2px; }
.tp-count { font: 700 13px/1 var(--tp-font-ja); color: var(--accent); }

/* ── 入力欄: 16px 未満だと iPhone で勝手に拡大されるので 16px 以上 ── */
.tp-input { width: 100%; min-height: var(--tap); padding: 0 16px; border-radius: var(--radius-sm); border: 2px solid var(--line); background: var(--surface); color: var(--text); font: 500 16px/1 var(--tp-font-ja); }
.tp-input:focus { outline: none; border-color: var(--accent); }

/* ── カード ── */
.tp-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); padding: 24px; }

/* ── 小さな目印（押せない）: ミント ── */
.tp-badge { display: inline-block; padding: 4px 8px; border-radius: 999px; background: var(--highlight-soft); color: var(--text); font: 700 12px/1.2 var(--tp-font-ja); }

/* ── ブランドのヘッダー（全サイト共通の上の帯） ── */
.tp-header { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 16px; background: var(--brand-gradient); color: #fff; }
.tp-header a { color: inherit; text-decoration: none; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
