/* 全アプリ共通の土台。色・余白・角丸などのトークンはここで定義する。 */

:root {
  --bg: #faf9f7;
  --card: #ffffff;
  --text: #1c1b1a;
  --text-2: rgba(28, 27, 26, 0.6);
  --text-3: rgba(28, 27, 26, 0.35);
  --hairline: rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  --bar: rgba(250, 249, 247, 0.82);
  --field: #f2f1ef;
  --danger: #d9342b;

  --radius-card: 18px;
  --radius-control: 14px;
  --gutter: 20px;

  /* PC でアプリ全体を収める最大幅（画面が広くても中央に集める） */
  --desktop-max: 1280px;

  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
  --font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, "Hiragino Maru Gothic ProN", system-ui, sans-serif;

  --spring: cubic-bezier(0.34, 1.3, 0.64, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1a1a;
    --card: #2e2e2e;
    --text: #f2f2f2;
    --text-2: rgba(242, 242, 242, 0.6);
    --text-3: rgba(242, 242, 242, 0.32);
    --hairline: rgba(255, 255, 255, 0.08);
    --shadow: none;
    --bar: rgba(26, 26, 26, 0.82);
    --field: #3a3a3a;
    --danger: #ff5a4f;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
  /* ダブルタップでの拡大を無効化（スクロールとピンチ拡大は残す）。
     html だけに付けると、iPhone では SVG の上などで効かないことがあるので全要素に付ける */
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

.num {
  font-variant-numeric: tabular-nums;
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon.solid {
  fill: currentColor;
  stroke: none;
}

.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

/* 押し込みで少し縮む。タップの手応えを出す。 */
.pressable {
  transition: transform 0.25s var(--spring), opacity 0.2s;
}
.pressable:active {
  transform: scale(0.97);
  opacity: 0.9;
}
