/* 全ページ共通の部品 */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.75;
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ink); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-jp); font-weight: 700; line-height: 1.4; margin: 0; letter-spacing: 0.01em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }
.muted { color: var(--muted); }
.num { font-family: var(--font-en); font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }

/* 資料の「英字イタリックの小見出し」 */
.kicker { display: block; font-family: var(--font-en); font-style: italic; font-weight: 500; color: var(--wine); font-size: 22px; line-height: 1.2; letter-spacing: 0.005em; margin-bottom: 6px; }
/* 資料の「COMPANY」「FULL-CUSTOM MODELING」などの英字ラベル */
.caps { font-family: var(--font-en); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--wine); font-size: 15px; line-height: 1.3; }

.on-night { background: var(--night); color: var(--night-ink); }

/* ---- ロゴ ---- */
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; white-space: nowrap; }
.wordmark .mark { width: 30px; height: 30px; border-radius: 2px; background: var(--night); position: relative; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.wordmark .mark::before { /* 回答の行 */
  content: ""; position: absolute; left: 7px; right: 7px; top: 8px; height: 1.5px; background: var(--night-ink); opacity: .55;
  box-shadow: 0 6px 0 var(--night-ink), 0 12px 0 var(--night-ink);
}
.wordmark .mark::after { /* 自社名に引かれた下線 */
  content: ""; position: absolute; left: 7px; width: 11px; top: 16.5px; height: 2px; background: #c25a49;
}
.wordmark .name { display: flex; flex-direction: column; line-height: 1; }
.wordmark .name small { font-family: var(--font-en); font-weight: 700; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--taupe); margin-bottom: 2px; }
.wordmark .name span, .wordmark .name { font-family: var(--font-en); }
.wordmark .name { font-style: italic; font-weight: 600; font-size: 21px; letter-spacing: 0; }
.wordmark .name small { font-style: normal; }
.on-night .wordmark .mark { background: var(--night-ink); }
.on-night .wordmark .mark::before { background: var(--night); box-shadow: 0 6px 0 var(--night), 0 12px 0 var(--night); }
.on-night .wordmark .name small { color: var(--night-muted); }

/* ---- 言及箇所のマーク ---- */
mark, .hl {
  background: linear-gradient(to top, var(--wine) 0 2px, transparent 2px);
  color: var(--wine);
  padding: 0 .06em 1px;
  font-weight: 700;
}
mark.hl-comp { background: none; color: inherit; font-weight: 700; padding: 0; }

/* ---- ボタン ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--action); color: var(--action-ink); border: 0; border-radius: var(--r-sm);
  padding: 10px 20px; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1.4; letter-spacing: .03em;
  transition: background-color .15s, transform .15s;
}
.btn:hover { background: color-mix(in srgb, var(--action) 86%, var(--wine)); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.small { padding: 6px 14px; font-size: 13px; }
.btn.large { padding: 15px 30px; font-size: 15.5px; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.light { background: var(--night-ink); color: var(--night); }
.btn.danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1px currentColor; }
.link { background: none; border: 0; padding: 0; color: var(--ink); cursor: pointer; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; width: 34px; height: 34px; border-radius: var(--r-sm); flex: none; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ---- 入力 ---- */
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; min-width: 0; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 9px 11px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--ink) 25%, transparent); border-color: var(--ink); }
textarea { resize: vertical; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
label.check { flex-direction: row; align-items: center; gap: 8px; }
label.inline { flex-direction: row; align-items: center; gap: 8px; white-space: nowrap; }
label.inline select { width: auto; max-width: 100%; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--ink); }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.form-error { font-size: 13px; color: var(--bad); min-height: 1.4em; }

/* ---- バッジ ---- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 2px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; line-height: 1.7; }
.badge.good { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good); }
.badge.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.badge.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.badge.marker { background: var(--wine-soft); color: var(--wine); }
.badge.demo { background: var(--sand); color: var(--wine); }

/* ---- トースト ---- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--night); color: var(--night-ink); padding: 11px 18px; border-radius: var(--r-md); font-size: 13px; max-width: calc(100% - 32px); z-index: 100; box-shadow: var(--shadow-pop); border-left: 3px solid var(--wine); }
.toast[data-kind="error"] { background: var(--bad); color: #fff; border-left-color: rgba(255,255,255,.5); }

/* ---- ダイアログ ---- */
dialog { border: 0; border-radius: var(--r-lg); padding: 0; width: min(560px, calc(100% - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); border-top: 3px solid var(--night); }
dialog::backdrop { background: rgba(13, 31, 66, .5); }
.dialog-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.dialog-body h2 { font-size: 19px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
