@charset "UTF-8";

/* ============================================================
   俳句・短歌作成ツール
   ・落ち着いた緑を主色にした、和風すぎないミニマルな配色
   ・左（作品作成）65% / 右（季語・ことば）35% の2カラム
   ・スマートフォンでは 作品作成 → 季語 → 言葉の提案 の1カラム
   ============================================================ */

:root {
  --ht-primary: #4f7d32;
  --ht-primary-dark: #3f6527;
  --ht-primary-soft: #eef3e9;
  --ht-primary-line: #cddcc0;
  --ht-bg: #faf9f5;
  --ht-card: #ffffff;
  --ht-border: #e4e4de;
  --ht-text: #252525;
  --ht-muted: #6f6f68;
  --ht-faint: #9a9a92;
  --ht-warm: #b8813a;
  --ht-paper: #fbf7ec;
  --ht-radius: 12px;
  --ht-shadow: 0 1px 2px rgba(37, 37, 37, 0.04);
}

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

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.compact-navbar { min-height: 54px; }
.compact-navbar .container { min-height: 54px; height: auto; }
.logo-link { text-decoration: none; }

.ht-main .container,
.ht-hero .container { max-width: 1280px; }

.ht-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ht-no-scroll { overflow: hidden; }

/* ---------- ヘッダー ---------- */
.ht-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #fdfcf8 0%, var(--ht-bg) 100%);
  border-bottom: 1px solid var(--ht-border);
}
.ht-hero-inner { position: relative; z-index: 1; padding: 2rem 24px 1.7rem; }
.ht-hero h1 {
  margin: 0;
  font-size: clamp(1.45rem, 3.4vw, 2.05rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ht-text);
}
.ht-hero p {
  margin: 0.5rem 0 0;
  color: var(--ht-muted);
  font-size: clamp(0.85rem, 1.6vw, 0.98rem);
  letter-spacing: 0.04em;
}
/* 装飾はUIより目立たせない */
.ht-hero-deco {
  position: absolute;
  top: -6px;
  right: -10px;
  width: min(340px, 46vw);
  opacity: 0.6;
  pointer-events: none;
}
.ht-hero-deco svg { display: block; width: 100%; height: auto; }

.tool-breadcrumb { padding: 0.85rem 0 0.2rem; }

/* ---------- 俳句 / 短歌 タブ ---------- */
.ht-modetabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-width: 720px;
  margin: 1rem 0 1.4rem;
  padding: 5px;
  border: 1px solid var(--ht-border);
  border-radius: 14px;
  background: #f3f2ec;
}
.ht-modetab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ht-muted);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.ht-modetab:hover { color: var(--ht-text); }
.ht-modetab.is-active {
  background: var(--ht-primary-soft);
  color: var(--ht-primary-dark);
  box-shadow: inset 0 -3px 0 var(--ht-primary);
}
.ht-modetab svg { display: block; flex: none; }

/* ---------- レイアウト ---------- */
.ht-layout {
  display: grid;
  grid-template-columns: minmax(0, 65fr) minmax(0, 35fr);
  gap: 1.25rem;
  align-items: start;
}
.ht-side { display: flex; flex-direction: column; gap: 1.25rem; }
/* グリッド項目の min-width は既定で auto のため、中身（textarea の既定幅など）が
   トラックを押し広げて画面が横スクロールする。0 を明示して抑える */
.ht-layout > *, .ht-side > * { min-width: 0; }

/* ---------- カード ---------- */
.ht-card {
  padding: 1.4rem 1.5rem 1.6rem;
  border: 1px solid var(--ht-border);
  border-radius: var(--ht-radius);
  background: var(--ht-card);
  box-shadow: var(--ht-shadow);
}
.ht-card-head { display: flex; align-items: center; gap: 0.7rem; }
.ht-card-icon { display: inline-flex; color: var(--ht-primary); }
.ht-card-icon svg { display: block; }
.ht-card-head h2 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.ht-card-sub {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.6rem 0 1rem;
  color: var(--ht-muted);
  font-size: 0.8rem;
}
.ht-card-sub-plain { display: block; line-height: 1.7; }
.ht-dot {
  width: 7px; height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--ht-primary);
}

/* ---------- 入力欄 ---------- */
.ht-lines { display: flex; flex-direction: column; gap: 0.7rem; }
.ht-line {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--ht-border);
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ht-line:focus-within {
  border-color: var(--ht-primary);
  box-shadow: 0 0 0 3px rgba(79, 125, 50, 0.12);
}
.ht-line-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.95rem 0.4rem 0.95rem 1.05rem;
  border: 0;
  border-radius: 10px 0 0 10px;
  background: transparent;
  font-family: "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 1.18rem;
  letter-spacing: 0.06em;
}
.ht-line-input:focus { outline: none; }
.ht-line-input::placeholder {
  color: #b8b8b0;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

/* 音数表示：合っていれば緑、外れていても警告色は使わない */
.ht-mora {
  display: inline-flex;
  align-items: baseline;
  gap: 0.1rem;
  flex: none;
  padding: 0 1.05rem 0 0.5rem;
  color: var(--ht-faint);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: help;
}
.ht-mora b { font-size: 1.05rem; font-weight: 700; }
.ht-mora[data-status="matched"] { color: var(--ht-primary); }
.ht-mora[data-status="over"],
.ht-mora[data-status="under"] { color: var(--ht-warm); }
.ht-mora-check { margin-left: 0.25rem; font-size: 0.95rem; }
.ht-mora-sep, .ht-mora-target { color: var(--ht-faint); font-size: 0.85rem; }
.ht-mora[data-status="empty"] .ht-mora-target { font-size: 0.95rem; }
.ht-mora-approx { font-size: 0.72rem; letter-spacing: 0; }
.ht-mora.is-approx { border-bottom: 1px dotted currentColor; }

.ht-summary {
  margin: 0.85rem 0 0;
  color: var(--ht-muted);
  font-size: 0.8rem;
  line-height: 1.75;
}

/* ---------- 季語判定 ---------- */
.ht-kigo-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--ht-border);
  color: var(--ht-muted);
  font-size: 0.85rem;
}
.ht-kigo-icon { flex: none; color: var(--ht-primary); }
.ht-kigo-status.is-found .ht-kigo-item b {
  color: var(--ht-primary-dark);
  font-weight: 700;
}
.ht-kigo-slash { color: var(--ht-border); }
.ht-kigo-alt { color: var(--ht-muted); font-size: 0.78rem; font-weight: 400; }
.ht-kigo-none { color: var(--ht-faint); }
.ht-kigo-extra {
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--ht-border);
  border-radius: 999px;
  font-size: 0.74rem;
  cursor: help;
}
.ht-kigo-note {
  flex: 1 1 100%;
  color: var(--ht-faint);
  font-size: 0.74rem;
  line-height: 1.6;
}

/* ---------- ボタン ---------- */
.ht-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.1rem;
}
.ht-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--ht-border);
  border-radius: 10px;
  background: #fff;
  color: var(--ht-text);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.ht-btn:hover { border-color: var(--ht-primary-line); background: var(--ht-primary-soft); color: var(--ht-primary-dark); }
.ht-btn:focus-visible { outline: 2px solid var(--ht-primary); outline-offset: 2px; }
.ht-btn svg { display: block; flex: none; }
.ht-btn-primary {
  border-color: var(--ht-primary);
  background: var(--ht-primary);
  color: #fff;
  padding-inline: 1.5rem;
}
.ht-btn-primary:hover { border-color: var(--ht-primary-dark); background: var(--ht-primary-dark); color: #fff; }
.ht-btn-quiet {
  margin-left: auto;
  border-color: transparent;
  color: var(--ht-faint);
  font-weight: 500;
}
.ht-btn-quiet:hover { border-color: var(--ht-border); background: #f7f6f1; color: var(--ht-muted); }
.ht-btn-wide { width: 100%; margin-top: 0.9rem; }
.ht-btn[disabled] { opacity: 0.6; cursor: default; }
.ht-btn.is-loading svg { animation: ht-spin 1s linear infinite; }
@keyframes ht-spin { to { transform: rotate(360deg); } }

/* ---------- 推敲パネル ---------- */
.ht-refine {
  margin-top: 1.1rem;
  padding: 1.1rem 1.2rem 1.2rem;
  border: 1px solid var(--ht-primary-line);
  border-radius: var(--ht-radius);
  background: #fbfcf9;
}
.ht-refine[hidden] { display: none; }
.ht-refine-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.ht-refine-head h3 { margin: 0; font-size: 0.98rem; font-weight: 700; }
.ht-refine-close {
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ht-faint);
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.25rem 0.45rem;
}
.ht-refine-close:hover { background: #eef0e9; color: var(--ht-text); }
.ht-refine-lead, .ht-refine-loading, .ht-refine-empty {
  margin: 0.5rem 0 0;
  color: var(--ht-muted);
  font-size: 0.8rem;
  line-height: 1.7;
}
.ht-refine-line { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid #e9ece3; }
.ht-refine-line:first-of-type { border-top: 0; }
.ht-refine-line-head { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; }
.ht-refine-no {
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--ht-primary-soft);
  color: var(--ht-primary-dark);
  font-size: 0.72rem;
  font-weight: 700;
}
.ht-refine-text {
  font-family: "Noto Serif JP", "Yu Mincho", serif;
  font-size: 0.98rem;
  letter-spacing: 0.04em;
}
.ht-refine-undo {
  margin-left: auto;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--ht-border);
  border-radius: 999px;
  background: #fff;
  color: var(--ht-muted);
  font-size: 0.74rem;
}
.ht-refine-undo:hover { border-color: var(--ht-primary-line); color: var(--ht-primary-dark); }
.ht-refine-hint { margin: 0.45rem 0 0; color: var(--ht-muted); font-size: 0.78rem; line-height: 1.7; }
.ht-refine-line .ht-chips { margin-top: 0.5rem; }

/* 現在の音数と、あと何音か */
.ht-refine-count {
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--ht-border);
  border-radius: 999px;
  background: #fff;
  color: var(--ht-muted);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ht-refine-count[data-state="match"] { border-color: var(--ht-primary-line); color: var(--ht-primary-dark); }
.ht-refine-message { margin: 0.5rem 0 0; color: var(--ht-text); font-size: 0.83rem; line-height: 1.7; }
.ht-refine-ok { color: var(--ht-primary-dark); font-weight: 700; }
.ht-refine-basis {
  display: inline-block;
  margin-top: 0.35rem;
  color: var(--ht-faint);
  font-size: 0.72rem;
  cursor: help;
}
.ht-refine-group {
  margin: 0.75rem 0 0;
  color: var(--ht-muted);
  font-size: 0.76rem;
  font-weight: 700;
}
.ht-refine-none { margin: 0.6rem 0 0; color: var(--ht-faint); font-size: 0.78rem; line-height: 1.7; }

/* ---------- 言葉の提案：候補の根拠と、候補が無いときの案内 ---------- */
.ht-suggest-basis {
  margin: 0 0 0.55rem;
  color: var(--ht-primary-dark);
  font-size: 0.76rem;
  font-weight: 700;
}
.ht-suggest-basis[hidden] { display: none; }
.ht-suggest-empty {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px dashed var(--ht-border);
  border-radius: 10px;
  background: #fbfcf9;
}
.ht-suggest-empty p { margin: 0; color: var(--ht-muted); font-size: 0.78rem; line-height: 1.75; }
.ht-suggest-empty-title { color: var(--ht-text) !important; font-weight: 700; margin-bottom: 0.3rem !important; }
.ht-suggest-example { margin-top: 0.4rem !important; color: var(--ht-faint) !important; }
.ht-suggest-page { width: 100%; margin: 0.15rem 0 0; color: var(--ht-faint); font-size: 0.72rem; }

/* ---------- 縦書きプレビュー ---------- */
.ht-preview { margin-top: 1.4rem; }
.ht-preview-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
  color: var(--ht-muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.ht-preview-head svg { display: block; flex: none; }

.ht-paper {
  display: flex;
  /* 縦書きは右の行から左へ。RTL にしておくと行が溢れたときも
     スクロール開始位置が右端（＝1行目）になる */
  direction: rtl;
  flex-direction: row;
  justify-content: flex-start;
  gap: 0.55rem;
  height: 232px;
  padding: 1.4rem 1.7rem;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid #e8e0cf;
  border-radius: 10px;
  /* 和紙の地合い（細かな斑点）＋ごく薄い桜の枝。装飾は作品より目立たせない */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23c2a49e' stroke-width='2' opacity='.32'%3E%3Cpath d='M114 6C94 20 80 42 72 68'/%3E%3Cpath d='M98 18c-6 8-8 16-6 24'/%3E%3Cpath d='M82 42c-8 6-11 14-10 22'/%3E%3C/g%3E%3Cg fill='%23e0b6bc' opacity='.4'%3E%3Ccircle cx='106' cy='14' r='7'/%3E%3Ccircle cx='92' cy='32' r='5.5'/%3E%3Ccircle cx='76' cy='56' r='6'/%3E%3Ccircle cx='114' cy='38' r='4.5'/%3E%3Ccircle cx='86' cy='76' r='4'/%3E%3C/g%3E%3C/svg%3E")
      right 12px bottom 8px / 92px auto no-repeat,
    radial-gradient(circle at 18% 30%, rgba(198, 176, 132, 0.10) 0 1px, transparent 1.6px) 0 0 / 46px 46px repeat,
    radial-gradient(circle at 62% 68%, rgba(198, 176, 132, 0.09) 0 1px, transparent 1.6px) 0 0 / 62px 62px repeat,
    radial-gradient(circle at 84% 18%, rgba(198, 176, 132, 0.08) 0 1px, transparent 1.6px) 0 0 / 78px 78px repeat,
    linear-gradient(135deg, #fdfaf2 0%, var(--ht-paper) 100%) 0 0 / cover no-repeat;
  -webkit-overflow-scrolling: touch;
}
.ht-paper-line {
  margin: 0;
  direction: ltr; /* 行の中の文字順は通常どおり */
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", "MS Mincho", serif;
  font-size: 1.32rem;
  line-height: 1.9;
  letter-spacing: 0.22em;
  color: #23201c;
  /* 長すぎる行は切り捨てず、隣の列へ折り返す */
  white-space: normal;
}
.ht-paper-hint {
  margin: auto;
  color: #b9ad93;
  font-size: 0.82rem;
  writing-mode: horizontal-tb;
}

/* 拡大表示 */
.ht-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(37, 37, 37, 0.45);
}
.ht-modal[hidden] { display: none; }
.ht-modal-box {
  width: min(880px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 1.1rem 1.3rem 1.5rem;
  border-radius: 14px;
  background: var(--ht-card);
  box-shadow: 0 18px 44px rgba(37, 37, 37, 0.22);
}
.ht-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.9rem; }
.ht-modal-head h2 { margin: 0; font-size: 1rem; font-weight: 700; }
.ht-modal-close {
  border: 1px solid var(--ht-border);
  border-radius: 8px;
  background: #fff;
  color: var(--ht-muted);
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.3rem 0.6rem;
}
.ht-modal-close:hover { border-color: var(--ht-primary-line); color: var(--ht-primary-dark); }
/* 拡大表示は「完成した1作品」として見せるので中央に置く。
   行が増えて溢れるときは safe が先頭側の見切れを防ぐ */
.ht-paper-large {
  height: min(64vh, 460px);
  padding: 2rem 2.2rem;
  gap: 0.9rem;
  justify-content: center;
  justify-content: safe center;
  background-size: 140px auto, 46px 46px, 62px 62px, 78px 78px, cover;
}
.ht-paper-large .ht-paper-line { font-size: clamp(1.5rem, 3.4vw, 2.1rem); letter-spacing: 0.26em; }

/* ---------- 季節タブ・チップ ---------- */
.ht-seasons { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.9rem 0 0.9rem; }
.ht-season {
  padding: 0.45rem 1rem;
  border: 1px solid var(--ht-border);
  border-radius: 999px;
  background: #fff;
  color: var(--ht-muted);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.15s;
}
.ht-season:hover { border-color: var(--ht-primary-line); color: var(--ht-primary-dark); }
.ht-season.is-active {
  border-color: var(--ht-primary);
  background: var(--ht-primary);
  color: #fff;
}

.ht-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
  padding: 0 0.85rem;
  border: 1px solid var(--ht-border);
  border-radius: 9px;
  background: #fdfdfb;
  color: var(--ht-faint);
}
.ht-search:focus-within { border-color: var(--ht-primary); box-shadow: 0 0 0 3px rgba(79, 125, 50, 0.1); }
.ht-search svg { flex: none; }
.ht-search input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.6rem 0;
  border: 0;
  background: transparent;
  font-size: 0.88rem;
  color: var(--ht-text);
}
.ht-search input:focus { outline: none; }

.ht-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ht-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 38px;
  padding: 0.42rem 0.95rem;
  border: 1px solid var(--ht-primary-line);
  border-radius: 999px;
  background: #fff;
  color: var(--ht-text);
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ht-chip:hover { background: var(--ht-primary-soft); border-color: var(--ht-primary); color: var(--ht-primary-dark); }
.ht-chip:focus-visible { outline: 2px solid var(--ht-primary); outline-offset: 2px; }
.ht-chip-season, .ht-chip-mora {
  color: var(--ht-faint);
  font-size: 0.7rem;
}
.ht-chip-alt { border-color: var(--ht-border); }

.ht-more {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.55rem;
  border: 1px dashed var(--ht-border);
  border-radius: 9px;
  background: transparent;
  color: var(--ht-muted);
  font-size: 0.8rem;
}
.ht-more:hover { border-color: var(--ht-primary-line); color: var(--ht-primary-dark); }
.ht-more[hidden] { display: none; }

.ht-note { margin: 0.8rem 0 0; color: var(--ht-faint); font-size: 0.74rem; line-height: 1.7; }
.ht-empty { margin: 0.2rem 0; color: var(--ht-faint); font-size: 0.8rem; line-height: 1.7; }

/* ---------- 言葉の提案 ---------- */
.ht-scene {
  width: 100%;
  min-height: 74px;
  margin-bottom: 0.9rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--ht-border);
  border-radius: 10px;
  background: #fbfcf9;
  font-size: 0.92rem;
  line-height: 1.7;
  resize: vertical;
  min-width: 0; /* textarea の既定幅（cols=20）でカードを広げない */
}
.ht-scene::placeholder { color: #b0b6a6; }
.ht-scene:focus { outline: none; border-color: var(--ht-primary); box-shadow: 0 0 0 3px rgba(79, 125, 50, 0.1); }

/* ---------- 補足コンテンツ ---------- */
.trust-badges { margin-top: 1.6rem; }
.ht-section { padding: 2.6rem 0 0; }
.ht-section h2 { margin: 0 0 1.1rem; font-size: clamp(1.2rem, 2.5vw, 1.55rem); }
.ht-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.ht-grid article { padding: 1.15rem; border: 1px solid var(--ht-border); border-radius: var(--ht-radius); background: #fff; }
.ht-grid article > span { color: var(--ht-primary); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; }
.ht-grid h3 { margin: 0.35rem 0 0.45rem; font-size: 1rem; }
.ht-grid p { margin: 0; color: var(--ht-muted); font-size: 0.84rem; line-height: 1.8; }

.ht-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding: 0; list-style: none; counter-reset: steps; }
.ht-steps li {
  position: relative;
  padding: 0.9rem 1rem 0.9rem 3rem;
  counter-increment: steps;
  border: 1px solid var(--ht-border);
  border-left: 3px solid var(--ht-primary);
  border-radius: 0 var(--ht-radius) var(--ht-radius) 0;
  background: #fff;
}
.ht-steps li::before {
  position: absolute;
  top: 0.9rem; left: 0.8rem;
  display: grid;
  width: 25px; height: 25px;
  place-items: center;
  border-radius: 50%;
  background: var(--ht-primary);
  color: #fff;
  content: counter(steps);
  font-size: 0.74rem;
  font-weight: 800;
}
.ht-steps strong, .ht-steps span { display: block; }
.ht-steps strong { font-size: 0.92rem; }
.ht-steps span { margin-top: 0.3rem; color: var(--ht-muted); font-size: 0.79rem; line-height: 1.7; }

.ht-related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
.ht-related a {
  display: flex;
  min-height: 86px;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
  border: 1px solid var(--ht-border);
  border-radius: var(--ht-radius);
  background: #fff;
  color: var(--ht-text);
  text-decoration: none;
}
.ht-related a:hover { border-color: var(--ht-primary-line); background: #fbfcf9; }
.ht-related span { margin-top: 0.35rem; color: var(--ht-muted); font-size: 0.78rem; }

.ht-outro { padding-bottom: 3rem; }

/* ---------- Toast ---------- */
.ht-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 90;
  transform: translateX(-50%);
  padding: 0.7rem 1.15rem;
  border-radius: 10px;
  background: rgba(37, 37, 37, 0.92);
  color: #fff;
  font-size: 0.85rem;
  box-shadow: 0 8px 24px rgba(37, 37, 37, 0.22);
}
.ht-toast[hidden] { display: none; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 1024px) {
  .ht-layout { grid-template-columns: minmax(0, 1fr); }
  .ht-steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .compact-navbar .nav-menu { display: none; }
  .ht-hero-inner { padding: 1.5rem 20px 1.3rem; }
  .ht-hero-deco { width: 52vw; opacity: 0.45; }
  .ht-main .container, .ht-hero .container { padding: 0 16px; }

  .ht-modetabs { margin: 0.8rem 0 1.1rem; }
  .ht-modetab { padding: 0.8rem 0.5rem; font-size: 0.95rem; }

  .ht-card { padding: 1.15rem 1.05rem 1.3rem; }
  .ht-line-input { padding: 0.9rem 0.3rem 0.9rem 0.9rem; font-size: 1.1rem; }
  .ht-mora { padding-right: 0.85rem; }

  .ht-actions { gap: 0.5rem; }
  .ht-actions .ht-btn { flex: 1 1 calc(50% - 0.25rem); }
  .ht-actions .ht-btn-primary { flex-basis: 100%; }
  .ht-btn-quiet { flex: 0 0 auto; margin-left: auto; }

  .ht-paper { height: 210px; padding: 1.1rem 1.2rem; }
  .ht-paper-line { font-size: 1.2rem; }
  .ht-paper-large { height: 58vh; padding: 1.3rem; }

  .ht-steps, .ht-related { grid-template-columns: 1fr; }
  .ht-modal { padding: 0.75rem; }
  .ht-modal-box { padding: 0.9rem 1rem 1.2rem; }
}

/* 端末の設定で動きを抑えている場合はアニメーションを止める */
@media (prefers-reduced-motion: reduce) {
  .ht-btn.is-loading svg { animation: none; }
  * { scroll-behavior: auto !important; }
}

/* ---------- 印刷 ---------- */
@media print {
  .navbar, .site-footer, .ht-hero-deco, .ht-modetabs, .ht-actions,
  .ht-refine, .ht-side, .ht-section, .trust-badges, .tool-breadcrumb,
  .ht-toast, .ht-modal { display: none !important; }
  .ht-layout { grid-template-columns: 1fr; }
  .ht-card { border: 0; box-shadow: none; }
  .ht-paper { height: 320px; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
