/* kako_app/static/kako_app/style.css */
/* ---------------------------------------------------
 * KaTeX / プレーンテキストの改行(\n)をそのまま表示
 * --------------------------------------------------- */
/* .preserve-newlines { white-space: pre-wrap; } */

/* ---------------------------------------------------
 * トークン（色/レイアウト/タイポ）
 * --------------------------------------------------- */
:root {
  /* Bootstrapトークン上書き */
  --bs-primary: #2563eb;             /* Azure */
  --bs-secondary: #8b8fa3;
  --bs-success: #52c41a;
  --bs-border-radius: 14px;
  --bs-border-color: rgba(15,23,42,.55);

  /* アプリ専用トークン */
  --ink:#0b1220;
  --muted:#475569;
  --surface:#ffffff;
  --brand-1:#2563eb;
  --brand-2:#1d4ed8;
  --brand-3:#64748b;

  /* レイアウト */
  --sidebar-w: 240px;               /* PCサイドバー幅 */
  --sidebar-w-collapsed: 72px;      /* 折りたたみ時 */
  --rail-h:56px;                    /* モバイル下タブ高さ */
  --radius:14px;
  --card-gap: 1rem;
  --card-pad: 1.25rem;
  --card-radius: 18px;
  --progress-h: 10px;
  --btn-primary: #2563eb;
  --btn-primary-2: #1d4ed8;
  --btn-secondary: #f59e0b;
  --btn-secondary-2: #d97706;
  --badge-success-bg: #16a34a;
  --badge-warning-bg: #f59e0b;
  --badge-danger-bg: #ef4444;

  /* ユーザー設定系（JSから上書き） */
  --app-font-scale: 1;
  --app-lh: 1.6;
}

html {
  color-scheme: light !important;
}

body {
  background-color: #eff5ff;
  color: #0f172a;
}

h1, h2, h3, h4, h5 {
  letter-spacing: .01em;
}

.text-muted,
.exam-dashboard-note,
.category-meta,
.category-label {
  color: #64748b;
}

html {
  /* フォント倍率（JSで --app-font-scale を書き換え） */
  font-size: calc(16px * var(--app-font-scale, 1));
}

body {
  color: var(--ink);
  line-height: var(--app-line-height, var(--app-lh));
}

/* 行間が別CSSで上書きされるのを防ぐための補助 */
#main, .container, .content, .question-body {
  line-height: var(--app-lh);
}

/* 高コントラスト */




/* クリック領域拡大（Apple/Google推奨44px） */
body.hit-large a,
body.hit-large button,
body.hit-large .btn {
  padding: 0.75rem 1rem;
}

.pref-large-targets :where(
  .btn,
  .list-group-item-action,
  .sb-nav .link,
  .app-tabbar a,
  nav a.btn,
  a.list-group-item,
  [role="button"]
){
  min-height: 44px;
  padding-top: .75rem;
  padding-bottom: .75rem;
  display: inline-flex;
  align-items: center;
  line-height: 1.25;
}

.pref-large-targets .form-check-input {
  width: 1.25rem;
  height: 1.25rem;
}
.pref-large-targets .form-check {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ---------------------------------------------------
 * レイアウト：左サイドバー + コンテンツ
 * --------------------------------------------------- */
.shell{
  display:grid;
  grid-template-columns: var(--sidebar-w) minmax(0,1fr);
  min-height:100dvh;
}
@media (max-width: 991.98px){
  .shell{ grid-template-columns: 1fr; }
}

/* コンテンツ余白（モバイルは下タブ分だけ確保） */
main { padding-bottom: calc(var(--rail-h) + env(safe-area-inset-bottom)); }
@media (min-width: 992px){
  main { padding-bottom: 0; }
}

.kkt-main-frame{
  width: 100%;
  margin-inline: auto;
}

.kkt-main-frame--wide{
  padding-left: clamp(0.9rem, 2.4vw, 1.8rem);
  padding-right: clamp(0.9rem, 2.4vw, 1.8rem);
}

@media (min-width: 1200px){
  .kkt-main-frame--wide{
    max-width: 1360px;
  }
}

/* コンテンツ上の薄い区切り */


/* ---------------------------------------------------
 * サイドバー共通
 * --------------------------------------------------- */
.sidebar{
  border-right:2px solid var(--bs-border-color);
  background:var(--surface);
  position:sticky;
  top:0;
  height:100dvh;
  overflow:auto;
  width: var(--sidebar-w);
  transition: width 0.2s ease;
}
.sidebar .sb-head{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  height: 84px;
}
.sidebar .brand{
  display:flex;
  align-items:center;
  gap:.5rem;
  min-width:0;
  flex: 1 1 auto;
  overflow: hidden;
  padding-right: 8px;
  text-decoration:none;
  color:inherit;
}


.sb-text{
  font-weight: 700;
  letter-spacing: .02em;
}

/* brand-mark/ロゴ */


.brand-logo-full{ display:block; width: auto; height: auto; max-width: 100%; max-height: 80px; object-fit: contain; }


/* サイドバーの Nav */
.sb-nav .link,
.nav .nav-link.sb-nav-link{
  display:flex;
  align-items:center;
  gap:.625rem;
  padding:.5rem .75rem;
  border-radius: .625rem;
  color: var(--bs-primary);
  text-decoration: none;
}
.sb-nav .link:hover,
.nav .nav-link.sb-nav-link:hover{
  background: var(--bs-secondary-bg);
  color: var(--bs-primary-text-emphasis);
}
.sb-nav .link.active,
.sb-nav .link[aria-current="page"],
.nav .nav-link.sb-nav-link.active,
.nav .nav-link.sb-nav-link[aria-current="page"]{
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
  font-weight: 600;
}
.sb-nav .link.disabled{
  opacity:.5;
  pointer-events:none;
}

/* サイドバー フッター（挨拶＋ログイン/ログアウト＋©） */
.sb-footer {
  border-top: 1px solid var(--bs-border-color);
}

/* === サイドバー折りたたみ（PC, lg+） ============================== */
@media (min-width: 992px){
  body.sb-collapsed {
    --sidebar-w: var(--sidebar-w-collapsed);
  }

  body.sb-collapsed .sb-text,
  body.sb-collapsed .sb-sec {
    display: none !important;
  }

  body.sb-collapsed .sb-head .brand {
    display: none !important;
  }

  body.sb-collapsed .sb-nav .link {
    justify-content: center;
    gap: .25rem;
  }
  body.sb-collapsed .sb-nav .link i {
    font-size: 1.15rem;
  }

  /* 畳み時でも展開ボタンは常に右上に見えるよう固定 */
  body.sb-collapsed #btnCollapse{
    position: absolute;
    right: 8px;
    top: 16px;
    z-index: 3;
  }

  /* フッターも折りたたみ時は非表示 */
  body.sb-collapsed .sb-footer{
    display: none !important;
  }
}

/* data-collapsed / .is-collapsed を使う古い実装も一応ケア */
.sidebar[data-collapsed="true"] .sb-footer,
.sidebar.is-collapsed .sb-footer {
  display: none !important;
}

/* 旧ミニロゴ・旧 brand-mark を完全に無効化 */
.sidebar .brand-logo-mini,
.sidebar .brand-mark { display: none !important; }

/* ---------------------------------------------------
 * モバイル・ドロワー（< lg）
 * --------------------------------------------------- */
@media (max-width: 991.98px){
  .sidebar{
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: min(86vw, 320px);
    max-width: 92vw;
    transform: translateX(-100%);
    transition: transform .2s ease-in-out;
    z-index: 1040;
    border-right: 2px solid var(--bs-border-color);
    background: var(--surface, #fff);
  }
  body.mobile-nav-open .sidebar{
    transform: translateX(0);
  }

  /* 背景ブロッカー */
  .drawer-backdrop{
    position: fixed; inset: 0;
    background: rgba(0,0,0,.25);
    backdrop-filter: blur(1px);
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
    z-index: 1035;
  }
  body.mobile-nav-open .drawer-backdrop{
    opacity: 1;
    pointer-events: auto;
  }

  /* モバイルでは折り畳み無効化（テキストは常に表示） */
  body.sb-collapsed .sb-text,
  body.sb-collapsed .sb-sec {
    display: initial !important;
  }

  /* グリッドは1カラム */
  .shell{ grid-template-columns: 1fr; }

  /* main 直下の最初の container（ハンバーガーが入っているやつ）の上余白調整 */
  #main > .container:first-child {
    padding-top: 0.75rem;
  }
  #btnSidebarOpen {
    margin-top: 0;
  }

  /* ポータルTOPの余白調整 */
  body.bg-kkt-soft #main > .container.my-4 {
    margin-top: 0;
  }
  body.bg-kkt-soft #main > .container.my-4 > .container {
    padding-top: 0;
  }

  body.kkt-exam-wide #main > .kkt-main-frame--wide {
    padding-left: clamp(0.75rem, 2vw, 1.4rem);
    padding-right: clamp(0.75rem, 2vw, 1.4rem);
  }

  body.has-exam-mobile-header #main > .container:first-child {
    display: none !important;
  }

}

.kkt-exam-mobile-header{
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.kkt-exam-mobile-header__menu,
.kkt-exam-mobile-header__balance{
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}

.kkt-exam-mobile-header__menu{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 14px;
}

.kkt-exam-mobile-header__nav{
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.kkt-exam-mobile-header__nav::-webkit-scrollbar{
  display: none;
}

.kkt-exam-mobile-header__link{
  min-height: 44px;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.82);
  color: #334155;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.kkt-exam-mobile-header__link.is-active{
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(37,99,235,.22);
}

.exam-subnav{
  gap: 0.65rem;
}

.exam-subnav .nav-link{
  min-height: 44px;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.82);
  color: #334155;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.exam-subnav .nav-link.active,
.exam-subnav .show > .nav-link{
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(37,99,235,.22);
}

@media (max-width: 575.98px){
  .kkt-exam-mobile-header{
    gap: 0.5rem;
  }

  .kkt-exam-mobile-header__menu,
  .kkt-exam-mobile-header__balance{
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .kkt-exam-mobile-header__link{
    min-height: 40px;
    padding: 0.5rem 0.75rem;
    font-size: 0.88rem;
  }
}

/* ハンバーガー/クローズ/折りたたみボタンのタップ領域 */
#btnSidebarOpen,
#btnSidebarClose,
#btnCollapse{
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  min-height: 40px;
}

/* ---------------------------------------------------
 * タブバー（モバイル）
 * --------------------------------------------------- */
.app-tabbar{
  position: fixed; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(4,1fr);
  background: var(--bs-body-bg);
  border-top: 2px solid var(--bs-border-color);
  height: var(--rail-h);
  z-index: 1030;
}
.app-tabbar a{
  text-align:center;
  padding:.35rem 0;
  text-decoration:none;
  color: var(--bs-body-color);
  font-size:.85rem;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:.15rem;
}
.app-tabbar i{ font-size:1.1rem; }
.app-tabbar span{ line-height:1; }
.app-tabbar a[aria-current="page"]{
  font-weight:600;
  border-top: 2px solid currentColor;
}

/* ---------------------------------------------------
 * カード/パネル（汎用）
 * --------------------------------------------------- */
.tile, .feature{
  background: #fff;
  border: 2px solid var(--bs-border-color);
  border-radius: var(--radius);
}
.tile{
  padding: 18px;
  position: relative;
}
.tile::before{
  content:"";
  position:absolute;
  left:0; top:0; bottom:0;
  width:4px;
  background: var(--brand-1);
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
}
.card {
  border-radius: var(--card-radius);
  border-color: rgba(15,23,42,.08);
}
.card-header{
  background: transparent;
  border-bottom: 1px solid rgba(15,23,42,.08);
}

.card-body {
  padding: var(--card-pad);
}

.card + .card,
.card + section,
section + .card {
  margin-top: var(--card-gap);
}

.section-title{
  font-weight:600;
  margin-top:1rem;
  margin-bottom:.5rem;
  opacity:.85;
}
.badge-subtle{
  background: var(--bs-secondary-bg);
  color: var(--bs-body-color);
}

/* ---------------------------------------------------
 * その他 汎用
 * --------------------------------------------------- */
.choice-item{ cursor: pointer; user-select: none; }

.link.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.badge {
  border-radius: 9999px;
  transition: all 0.2s ease;
}
.badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}


/* List group active item */
.list-group-item.active {
  background-color: #e0edff !important;
  color: #0d47a1 !important;
  font-weight: 600;
}

/* Toast をモーダルより前に */
.toast-container{ z-index: 1090; }
.pwa-toast{
  width: min(640px, calc(100vw - 28px));
  border: 1px solid rgba(15,23,42,.1);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 14px 30px rgba(15,23,42,.12);
}
.pwa-toast .toast-body{
  padding: 14px 16px;
  display: grid !important;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
}
.pwa-toast-text{
  display:flex;
  flex-direction:column;
  gap:3px;
}
.pwa-toast-title{
  font-weight: 700;
  font-size: 1rem;
  color: #0f172a;
}
.pwa-toast-sub{
  font-size: 0.84rem;
  color: #475569;
}
.pwa-toast-actions{
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.pwa-install-btn{
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
  min-width: 132px;
  justify-content: center;
  padding: .52rem .95rem;
  font-weight: 700;
  border-radius: 12px;
  color: #1f2937;
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
  border: 0;
  box-shadow: 0 8px 16px rgba(245,158,11,.28);
}
.pwa-install-btn:hover{
  filter: brightness(1.02);
  transform: translateY(-1px);
}
.pwa-install-btn i{ font-size: 1rem; }
.pwa-close-btn{
  opacity: .7;
}
.pwa-close-btn:hover{
  opacity: 1;
}
@media (max-width: 575.98px){
  .pwa-toast .toast-body{
    grid-template-columns: 1fr;
  }
  .pwa-toast-actions{
    justify-content: flex-end;
  }
}

/* KaTeX 大きめモード */


/* ================================
 * Add to Home (A2HS) guide page
 * ================================ */
.a2hs-wrap { max-width: 920px; margin: 0 auto; }

.a2hs-hero { display:flex; gap:12px; flex-wrap:wrap; margin:16px 0 24px; }

.a2hs-divider { height:1px; background: var(--bs-border-color); margin:24px 0; }

.a2hs-tabs { display:flex; gap:8px; flex-wrap:wrap; margin:8px 0 12px; }
.a2hs-tab {
  border:1px solid var(--bs-border-color);
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  padding:6px 12px;
  border-radius:999px;
  cursor:pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.a2hs-tab:hover { background: var(--bs-secondary-bg); }
.a2hs-tab.active {
  background: var(--bs-body-color);
  color: var(--bs-body-bg);
  border-color: var(--bs-body-color);
}

.a2hs-pane { /* 個別スクショ/説明ブロック用の余白微調整 */
  margin-top: .5rem;
}

.a2hs-shot {
  background: var(--bs-secondary-bg);
  border:1px dashed var(--bs-border-color);
  color: var(--bs-secondary-color);
  padding:10px;
  border-radius:10px;
  margin:8px 0;
}

.a2hs-hint {
  background: var(--bs-secondary-bg);
  border:1px solid var(--bs-border-color);
  border-radius:10px;
  padding:12px;
  margin:10px 0;
}

.a2hs-toplink { position:fixed; right:16px; bottom:16px; z-index: 10; }

.a2hs-muted { color: var(--bs-secondary-color); }

/* ===== Hero (イメージ寄せ) ===== */





/* ===== Info callout ===== */




/* ===== Exam tiles (カード) ===== */












/* 色味（slugでざっくり出し分け。増えたら追記） */




/* ================================
 * Kakotre ポータルTOP（/）専用スタイル
 * ================================ */

/* ページ全体の淡いブルー背景（body に .bg-kkt-soft が付く想定） */


/* 「資格を選択してください」のカード */
.kkt-selector-card {
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

/* 資格カード（2x2 グリッド） */
.kkt-exam-card {
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out;
}

.kkt-exam-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.10);
}

/* カード左側の丸いアイコン */
.kkt-exam-icon {
  width: 44px;
  height: 44px;
  aspect-ratio: 1 / 1;
  flex: 0 0 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #0f172a;
}

.kkt-exam-icon i {
  line-height: 1;
}

/* 試験ごとの色分け（必要に応じて増やせる） */
.kkt-exam-icon--blue {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.kkt-exam-icon--green {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.kkt-exam-icon--purple {
  background: rgba(129, 140, 248, 0.16);
  color: #4f46e5;
}

/* 「演習を始める」ボタン（濃紺フル幅） */
.kkt-exam-btn,
.kkt-exam-btn.btn {
  background-color: #020617;
  border-color: #020617;
  color: #ffffff;
  font-weight: 600;
  padding-block: 0.7rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.kkt-exam-btn:hover,
.kkt-exam-btn:focus-visible {
  background-color: #020617;
  border-color: #020617;
  filter: brightness(1.05);
  color: #ffffff;
}

/* 下部の説明テキスト */
.kkt-portal-footer {
  max-width: 640px;
  margin-inline: auto;
}

/* ================================
 * /exam/<slug>/ ランディング専用
 * ================================ */

/* ヒーロー */






/* タブ */






/* 科目パネル */

.kkt-exam-panel .card-body{
  padding:1.25rem 1.25rem 1.6rem;
}
@media (min-width:992px){
  .kkt-exam-panel .card-body{
    padding:1.75rem 1.75rem 2rem;
  }
}

/* 科目カード（大きな長方形） */













/* 先頭科目を「選択中」風に */




/* 出題数バー（セレクト風） */


/* 下のモードカード */












/* 年度ピル */


/* 疑似セレクトボックス風 */


/* 年度サマリー */



/* 年度クイックアクセス */


/* 弱点タブのアラート */


/* 時間制限モードカード */


/* 今日のおすすめバナー */


/* 連続日数パネル */


/* スピードクイズ用パネル */





/* 既存ボタン色のバリエーション */



/* ======================================================
 * Question List Page (exam)
 * ====================================================== */

/* ベースレイアウト */


/* タブ */








/* 出題モードカード */
.kkt-qfilter-card{
  position:relative;
  border-radius:20px;
  overflow:hidden;
  background:rgba(255,255,255,.96);
}
.kkt-qfilter-bar{
  position:absolute;
  inset:0 0 auto 0;
  height:4px;
  background:linear-gradient(90deg,#2563eb,#4f46e5);
}
.kkt-qfilter-title{
  font-weight:700;
}

/* ラベル */
.kkt-qfilter-label{
  font-size:.9rem;
  font-weight:600;
  margin-bottom:.5rem;
}

/* グリッド */
.kkt-qfilter-grid{
  display:flex;
  flex-direction:column;
  gap:1.5rem;
  margin-top:1rem;
}
@media (min-width: 768px){
  .kkt-qfilter-grid{
    gap:1.75rem;
  }
}
.kkt-qfilter-block{
  /* 個別ブロック用 */
}

/* 科目チップ */
.kkt-chip-subject,
.kkt-chip-mode,
.kkt-chip-order{
  width:100%;
  border-radius:999px;
  border:2px solid #dbeafe;
  background:#fff;
  padding:.6rem .5rem;
  font-size:.9rem;
  font-weight:500;
  color:#334155;
  text-align:center;
  transition: all .18s ease;
}
.kkt-chip-subject:hover,
.kkt-chip-mode:hover,
.kkt-chip-order:hover{
  transform: translateY(-1px);
  box-shadow:0 6px 14px rgba(15,23,42,.08);
}

.kkt-chip-subject.is-active,
.kkt-chip-mode.is-active,
.kkt-chip-order.is-active{
  color:#fff;
  border-color:transparent;
  box-shadow:0 10px 24px rgba(37,99,235,.35);
}

/* 科目別カラー */
.kkt-chip-subject-all.is-active{
  background:linear-gradient(135deg,#6b7280,#4b5563);
}
.kkt-chip-subject-theory.is-active{
  background:linear-gradient(135deg,#f97373,#fb7185);
}
.kkt-chip-subject-power.is-active{
  background:linear-gradient(135deg,#60a5fa,#3b82f6);
}
.kkt-chip-subject-machine.is-active{
  background:linear-gradient(135deg,#4ade80,#22c55e);
}
.kkt-chip-subject-law.is-active{
  background:linear-gradient(135deg,#a78bfa,#8b5cf6);
}

/* モード/順序のアクティブ */
.kkt-chip-mode.is-active,
.kkt-chip-order.is-active{
  background:linear-gradient(135deg,#2563eb,#4f46e5);
}

/* ボタン系 */
.kkt-btn-main{
  border-radius:999px;
  padding:.55rem 1.4rem;
}
.kkt-btn-gradient{
  border-radius:999px;
  padding:.55rem 1.4rem;
  background:linear-gradient(135deg,#22c55e,#16a34a);
  border-color:transparent;
}
.kkt-btn-gradient:hover{
  filter:brightness(1.05);
}

.btn-primary {
  background: linear-gradient(135deg, var(--btn-primary), var(--btn-primary-2));
  border-color: transparent;
}
.btn-primary:hover,
.btn-primary:focus-visible {
  filter: brightness(1.05);
}
.btn-warning,
.btn-outline-warning {
  --bs-btn-color: #92400e;
  --bs-btn-border-color: var(--btn-secondary);
  --bs-btn-hover-bg: var(--btn-secondary);
  --bs-btn-hover-border-color: var(--btn-secondary);
  --bs-btn-hover-color: #fff;
}

/* 該当件数バッジ */
.kkt-qfilter-count{
  background:linear-gradient(135deg,var(--btn-primary),var(--btn-primary-2));
  color:#fff;
  padding:.4rem 1.2rem;
  font-weight:600;
}

/* 進捗カード */
.kkt-qprogress-card{
  position:relative;
  border-radius:20px;
  background:rgba(255,255,255,.96);
}
.kkt-qprogress-bar-top{
  position:absolute;
  inset:0 0 auto 0;
  height:4px;
  background:linear-gradient(90deg,#22c55e,#10b981);
}
.kkt-dot-emerald{
  display:inline-block;
  width:7px; height:7px;
  border-radius:999px;
  background:linear-gradient(135deg,#22c55e,#10b981);
}

.kkt-qprogress-percent{
  background:linear-gradient(135deg,#2563eb,#4f46e5);
  color:#fff;
  padding:.3rem .9rem;
  font-weight:600;
}

/* 進捗バー本体 */
.kkt-progress-rail{
  position:relative;
  width:100%;
  height:var(--progress-h);
  border-radius:999px;
  background:linear-gradient(90deg,#e5e7eb,#f1f5f9);
  overflow:hidden;
}
.kkt-progress-fill{
  height:100%;
}
.kkt-progress-fill-correct{
  background:linear-gradient(90deg,#22c55e,#16a34a);
}
.kkt-progress-fill-incorrect{
  background:linear-gradient(90deg,#f97373,#ef4444);
}

/* 進捗ラベル */
.kkt-progress-pill{
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  padding:.35rem .9rem;
  border-radius:999px;
  border:1px solid #e5e7eb;
  background:#f9fafb;
}
.kkt-progress-pill-correct{
  border-color:#bbf7d0;
  background:linear-gradient(90deg,#ecfdf3,#dcfce7);
  color:#15803d;
}
.kkt-progress-pill-incorrect{
  border-color:#fecaca;
  background:linear-gradient(90deg,#fef2f2,#fee2e2);
  color:#b91c1c;
}
.kkt-progress-pill-unanswered{
  color:#374151;
}

.kkt-progress-dot{
  width:8px; height:8px;
  border-radius:999px;
}
.kkt-progress-dot-correct{
  background:linear-gradient(135deg,#22c55e,#16a34a);
}
.kkt-progress-dot-incorrect{
  background:linear-gradient(135deg,#f97373,#ef4444);
}
.kkt-progress-dot-unanswered{
  background:linear-gradient(135deg,#9ca3af,#6b7280);
}

/* 個別カード */





/* ステータス丸 */



/* ブックマーク */
.kkt-qcard-bookmark{
  position:absolute;
  right:1.2rem;
  top:1rem;
  width:44px; height:44px;
  border-radius:999px;
  border:0;
  background:linear-gradient(135deg,#f9fafb,#e5e7eb);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 10px 22px rgba(15,23,42,.12);
  color:#9ca3af;
}

.kkt-qcard-review-toggle{
  position:absolute;
  right:1.2rem;
  top:4.05rem;
  width:40px;
  height:40px;
  border-radius:999px;
  border:1px solid #fca5a5;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 8px 18px rgba(15,23,42,.10);
  color:#dc2626;
}
.kkt-qcard-review-toggle:hover{
  background:#fff1f2;
  color:#b91c1c;
}



/* 本文位置調整 */
.kkt-qcard-body{
  padding-top:2.75rem;
  padding-left:5rem;
}

/* バッジ */
.kkt-badge-question{
  border-radius:999px;
  padding:.25rem .9rem;
  background:linear-gradient(135deg,#0f172a,#020617);
  color:#fff;
}
.kkt-badge-subject{
  border-radius:999px;
  padding:.25rem .8rem;
  border:0;
}




.kkt-badge-meta{
  border-radius:999px;
  padding:.25rem .8rem;
  background:#f9fafb;
  border:1px solid #e5e7eb;
  color:#4b5563;
}


/* 問題を解くボタン */
.kkt-btn-question{
  border-radius:999px;
  padding:.35rem 1.1rem;
  background:linear-gradient(135deg,#2563eb,#4f46e5);
  border-color:transparent;
}

.kkt-btn-question:hover{
  filter:brightness(1.05);
}

/* =====================================================
 * 問題リストページ（/exam/<slug>/questions/）
 * 整理・統合版
 * ===================================================== */

/* ページ設定 */

@media (min-width: 992px) {
  .kkt-question-page { padding-top: 2.5rem; }
}

/* 見出しエリア */




/* ---------------------------------------------------
 * フィルター / 進捗カード共通
 * --------------------------------------------------- */
.kkt-ql-filters.card,
.kkt-ql-progress.card {
  border-radius: 20px;
  border: none;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .12);
  overflow: hidden;
}

/* カードヘッダー共通 */
.kkt-ql-filters .card-header,
.kkt-ql-progress .card-header {
  border-bottom: 1px solid rgba(148, 163, 184, .25);
  padding: 1rem 1.25rem;
}
.kkt-ql-filters .card-header { background: linear-gradient(135deg, #eef2ff, #eff6ff); }
.kkt-ql-progress .card-header { background: linear-gradient(135deg, #ecfdf5, #eff6ff); }

.kkt-ql-filters .card-title {
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand-1), #4f46e5);
  -webkit-background-clip: text;
  color: transparent;
  margin-bottom: .1rem;
}

/* フィルターピル (Pills) */




/* ピル色定義（科目別） */
.kkt-chip-subject-all.is-active { background: linear-gradient(135deg, #6b7280, #4b5563); }
.kkt-chip-subject-theory.is-active { background: linear-gradient(135deg, #f97373, #fb7185); }
.kkt-chip-subject-power.is-active { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.kkt-chip-subject-machine.is-active { background: linear-gradient(135deg, #34d399, #10b981); }
.kkt-chip-subject-law.is-active { background: linear-gradient(135deg, #a78bfa, #6366f1); }

/* モード・順序 */
.kkt-chip-mode.is-active,
.kkt-chip-order.is-active {
  background: linear-gradient(135deg, var(--brand-1), #4f46e5);
}

/* 結果表示・ボタンエリア */





/* ---------------------------------------------------
 * 問題カード (Question Card)
 * --------------------------------------------------- */


.kkt-ql-card.card {
  position: relative;
  border-radius: 18px;
  border: none;
  overflow: hidden;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 14px 36px rgba(15, 23, 42, .18);
  cursor: pointer;
  transition: box-shadow .16s ease, transform .12s ease;
}
.kkt-ql-card.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 46px rgba(15, 23, 42, .26);
}

/* 左側のカラー帯（アクセント） */
.kkt-ql-card::before {
  content: "";
  position: absolute;
  inset-block: 0;
  left: 0;
  width: 5px;
  /* Default (All/Unknown) */
  background: linear-gradient(to bottom, #60a5fa, #4f46e5);
  box-shadow: 0 0 18px rgba(59, 130, 246, .6);
}
.kkt-ql-card[data-subject="theory"]::before { background: linear-gradient(to bottom, #f97373, #fb7185); }
.kkt-ql-card[data-subject="power"]::before { background: linear-gradient(to bottom, #60a5fa, #3b82f6); }
.kkt-ql-card[data-subject="machine"]::before { background: linear-gradient(to bottom, #34d399, #10b981); }
.kkt-ql-card[data-subject="law"]::before { background: linear-gradient(to bottom, #a78bfa, #6366f1); }

.kkt-ql-card .card-body {
  padding: 1.1rem 4.75rem 1.2rem 1.6rem;
}

/* カード内メタ情報 */



/* 科目タグ */






.kkt-ql-question-text {
  margin: 0 0 .7rem;
  color: var(--ink);
  font-size: .9rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.kkt-ql-question-text .katex {
  font-size: 1em;
}
.kkt-ql-question-text .katex-display {
  margin: 0;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}

/* カードフッター（履歴 + ボタン） */
.kkt-ql-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
@media (max-width: 767.98px) {
  .kkt-ql-card .card-body {
    padding-right: 4.25rem;
  }
  .kkt-ql-question-text {
    -webkit-line-clamp: 2;
  }
  .kkt-ql-card-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .kkt-ql-card-btn {
    width: 100%;
  }
}

/* ---------------------------------------------------
 * 履歴ボックス (History Box) - 統合版
 * --------------------------------------------------- */
.kkt-ql-history {
  display: flex;
  align-items: center;
  gap: .45rem;
}
.kkt-ql-history-label {
  font-size: .78rem;
  color: var(--muted);
}
.kkt-ql-history-items {
  display: flex;
  gap: .4rem;
}
.kkt-ql-history-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .12rem;
  min-width: 26px;
}
.kkt-ql-history-box {
  width: 18px;
  height: 18px;
  border-radius: .4rem;
  background: linear-gradient(135deg, #e5e7eb, #d1d5db);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .2);
}



.kkt-ql-history-date {
  font-size: .62rem;
  line-height: 1;
  color: #9ca3af;
}

/* ブックマークボタン (FAB) */



/* style.css */

/* 登録済み（ON）の状態 */


/* ホバー時の挙動 */


/* ================================
 * 進捗バー共通スタイル
 * ================================ */


/* バー全体の土台 */
.kkt-progress-rail {
  position: relative;
  width: 100%;
  height: var(--progress-h);
  border-radius: 999px;
  background: #e5e7eb; /* 薄いグレーのベース */
  overflow: hidden;
  display: flex;      /* 子を横並びにする */
}

/* 共通のバー要素 */
.kkt-progress-fill {
  height: 100%;
  display: flex;               /* 中央配置用 */
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 0.68rem;          /* ちょっと小さめの文字 */
  color: #ffffff;              /* 白文字 */
  white-space: nowrap;
}

/* 正解 = 緑 */
.kkt-progress-fill-correct {
  background: #22c55e;
}

/* 不正解 = 赤 */
.kkt-progress-fill-incorrect {
  background: #ef4444;
}

/* 未回答 = グレー */
.kkt-progress-fill-unanswered {
  background: #9ca3af;
}

/* ラベル（%）用: 必要なら微調整用にクラスを分けておく */
.kkt-progress-label {
  padding-inline: 4px; /* 文字がギリギリになりすぎないように */
}

.badge.text-bg-success { background-color: var(--badge-success-bg) !important; }
.badge.text-bg-warning { background-color: var(--badge-warning-bg) !important; }
.badge.text-bg-danger { background-color: var(--badge-danger-bg) !important; }

  /* 正解・不正解の色（薄めのトーン） */
  .choice-item.choice-correct {
    background-color: #dcfce7; /* 薄いグリーン */
    border-color: #bbf7d0;
  }

  .choice-item.choice-incorrect {
    background-color: #fee2e2; /* 薄いレッド */
    border-color: #fecaca;
  }


/* 選択肢番号用（CSSカウンタ） */
#choices {
  counter-reset: choice;
}

#choices .choice-item {
  position: relative;
  padding-left: 2.5rem; /* 番号分の余白を空ける */
}

#choices .choice-item::before {
  counter-increment: choice;
  content: "（" counter(choice) "）";
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: #000000; /* text-muted 相当 */
}
/* 番号のスタイル（CSSカウンターの代わり） */
.choice-num {
  font-weight: bold;
  margin-right: 1rem;
  min-width: 1.5rem; /* 番号の幅を固定してズレを防ぐ */
  text-align: right;
  flex-shrink: 0;    /* 番号が潰れないようにする */
}

/* 表形式のアイテム（均等幅） */

/* スマホなどで狭すぎる場合の対策 */
.table-cell-content {
  word-break: break-all;
}

/* 既存のCSSカウンター（もしあれば）を無効化 */
#choices {
  counter-reset: none;
}
.choice-item::before {
  content: none !important; /* 既存の自動採番を消す */
}


/* ▼▼▼ 修正箇所1：ボックス（セル）の内側の余白を詰める ▼▼▼ */
  

  /* ▼▼▼ 修正箇所2：行全体の余白も少し詰める（お好みで） ▼▼▼ */
  .choice-item {
    /* Bootstrapの標準(0.5rem 1rem)より少し上下を詰める */
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
  }

/* Restored unused rules */
body.hc {
  --bs-body-color: #111;
  --bs-body-bg: #fff;
  --bs-border-color: #000;
}

.hc { letter-spacing: 0.02em; }

.hc .link, .hc a { text-decoration: underline; }

.pref-large-targets .sb-nav .link {
  gap: .5rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.content-top{
  border-bottom: 2px solid var(--bs-border-color);
  background: var(--surface);
}

.sb-sec { padding: 8px 12px; }

.brand-mark{
  display:block;
  inline-size:28px;
  block-size:28px;
  background:none !important;
  border-radius:8px;
  object-fit:contain;
}

.brand-logo{
  display:block;
  height:64px;
  width:auto;
}

.brand-logo-mini{ max-width: 28px; height: 28px; display:none; }

.bg-primary-subtle {
  background-color: #e8f0ff !important;
}

.math-lg .katex { font-size: 1.2em; }

.portal-hero{
  border-radius: 16px;
  background: linear-gradient(135deg, #eff4ff, #f6f9ff);
  padding: clamp(18px, 3.5vw, 28px);
  position: relative; overflow: hidden;
}

.portal-hero::after{
  content:"";
  position:absolute;
  right:-60px; top:-60px;
  width:300px; height:300px; border-radius:50%;
  background: radial-gradient(closest-side, rgba(59,130,246,.12), transparent 70%);
}

.portal-hero__title{
  margin:0 0 .25rem 0;
  font-weight:800;
  font-size: clamp(20px, 3vw, 28px);
  letter-spacing:.02em;
}

.portal-hero__lead{ margin:0; color:var(--bs-secondary-color); }

.info-callout{
  border-radius:16px; background:#fff;
  border:1px solid var(--bs-border-color);
  padding: clamp(14px, 2.4vw, 20px);
}

.info-callout__title{ font-weight:700; margin-bottom:.25rem; }

.info-callout__lead{ font-size:.95rem; }

.exam-tile{
  display:flex; flex-direction:column; gap:14px;
  border:1px solid var(--bs-border-color);
  background:#fff; border-radius:18px;
  padding:18px;
  box-shadow: 0 2px 8px rgba(0,0,0,.03);
  transition: box-shadow .12s ease, transform .08s ease;
}

.exam-tile:hover{ box-shadow:0 8px 24px rgba(0,0,0,.06); transform: translateY(-2px); }

.exam-tile__head{ display:flex; align-items:center; gap:14px; }

.exam-tile__icon{
  width:48px; height:48px; border-radius:12px; flex:0 0 auto;
  display:grid; place-items:center; font-size:1.25rem;
  background: var(--tone-bg, rgba(0,0,0,.06));
  color: var(--tone-fg, #0f172a);
}

.exam-tile__title{ font-weight:700; line-height:1.2; }

.exam-tile__desc{ margin-top:2px; }

.exam-tile__cta{ margin-top:4px; }

.btn-cta{
  --btn-bg:#0b0b16; --btn-fg:#fff;
  background:var(--btn-bg); color:var(--btn-fg);
  border-radius:10px; padding:.6rem 1rem;
  border:1px solid #0b0b16;
}

.btn-cta:hover{ filter: brightness(1.08); color:#fff; }

[data-slug^="denken"] .exam-tile__icon{
  --tone-bg: rgba(37,99,235,.12);
  --tone-fg:#2563eb;
}

[data-slug*="kouji"] .exam-tile__icon,
[data-slug^="denkikouji"] .exam-tile__icon{
  --tone-bg: rgba(255,138,52,.16);
  --tone-fg:#e95d0f;
}

[data-slug*="boiler"] .exam-tile__icon{
  --tone-bg: rgba(16,185,129,.16);
  --tone-fg:#0f766e;
}

.bg-kkt-soft {
  background-color: #eff5ff;
}

.kkt-exam-hero{
  max-width: 780px;
  margin-inline:auto;
}

.kkt-exam-hero-icon{
  width:52px; height:52px;
  border-radius:999px;
  background:#e4edff;
  color:#2563eb;
  display:grid; place-items:center;
  box-shadow:0 4px 12px rgba(37,99,235,.18);
}

.kkt-exam-hero-icon i{ font-size:1.4rem; }

.kkt-exam-hero-title{
  font-size:clamp(1.25rem,3.4vw,1.6rem);
  font-weight:700;
}

.kkt-exam-hero-lead{ font-size:.9rem; }

.kkt-exam-tabs{
  max-width:960px;
  margin-inline:auto;
}

.kkt-exam-tabs-inner{
  background:#e8edf8;
  border-radius:999px;
  padding:3px;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:3px;
}

.kkt-exam-tab{
  border:0;
  border-radius:999px;
  padding:.5rem .25rem;
  font-size:.9rem;
  background:transparent;
  color:#4b5563;
  cursor:default;
  white-space:nowrap;
}

.kkt-exam-tab.is-active{
  background:#fff;
  color:#111827;
  font-weight:600;
  box-shadow:0 4px 10px rgba(15,23,42,.12);
}

.kkt-exam-tab[disabled]{ opacity:.6; }

.kkt-exam-panel{
  border-radius:24px;
}

.kkt-subject-card{
  display:block;
  border-radius:18px;
  background:#fff;
  border:1px solid rgba(148,163,184,.6);
  transition:background-color .12s ease,
           box-shadow .12s ease,
           transform .08s ease;
}

.kkt-subject-card-inner{
  display:flex;
  align-items:center;
  gap:.75rem;
  padding:.8rem 1rem;
}

.kkt-subject-card-dot-wrap{
  flex:0 0 auto;
}

.kkt-subject-card-dot{
  width:32px; height:32px;
  border-radius:999px;
  background:#0b1020;
}

.kkt-subject-card-dot--primary{ background:#0b0b19; }

.kkt-subject-card-dot--green{ background:#22c55e; }

.kkt-subject-card-dot--purple{ background:#a855f7; }

.kkt-subject-card-dot--orange{ background:#fb923c; }

.kkt-subject-card-label{
  font-size:.9rem;
  color:#111827;
}

.kkt-subject-card:hover{
  background:#f4f7ff;
  box-shadow:0 6px 18px rgba(15,23,42,.12);
  transform:translateY(-1px);
}

.kkt-subject-card--active{
  background:#050515;
  border-color:#050515;
  box-shadow:0 10px 26px rgba(15,23,42,.45);
}

.kkt-subject-card--active .kkt-subject-card-dot{
  background:#fff;
}

.kkt-subject-card--active .kkt-subject-card-label{
  color:#fff;
}

.kkt-question-count{
  border-radius:999px;
  background:#eef2ff;
  padding:.55rem .9rem;
}

.kkt-mode-card{
  border-radius:18px;
  border:none;
  box-shadow:0 4px 14px rgba(15,23,42,.12);
}

.kkt-mode-icon{
  width:32px; height:32px;
  border-radius:999px;
  display:grid; place-items:center;
  color:#fff;
  font-size:1.1rem;
}

.kkt-mode-icon--blue{ background:#2563eb; }

.kkt-mode-icon--green{ background:#22c55e; }

.kkt-mode-icon--purple{ background:#a855f7; }

.kkt-mode-icon--red{ background:#ef4444; }

.kkt-mode-btn{
  border-radius:999px;
  background:#050515;
  color:#fff;
  border:1px solid #050515;
}

.kkt-mode-btn:hover{
  color:#fff;
  filter:brightness(1.05);
}

.kkt-mode-btn[disabled]{
  opacity:.6;
  cursor:default;
}

.kkt-mode-btn--secondary{
  background:#9ca3af;
  border-color:#9ca3af;
}

.kkt-year-pill{
  font-size:.8rem;
  padding-inline:.75rem;
}

.kkt-select-faux{
  border-radius:999px;
  background:#f4f5fb;
  border:1px solid rgba(148,163,184,.5);
  padding:.55rem .9rem;
}

.kkt-year-summary{
  border-radius:16px;
  background:#eef2ff;
  padding:.75rem .9rem;
}

.kkt-year-summary--accent{
  background:#fff7e6;
}

.kkt-year-quick-btn{
  border-radius:16px;
  border:1px solid rgba(148,163,184,.5);
  background:#fff;
  padding:.6rem .4rem;
  font-size:.85rem;
}

.kkt-weak-alert{
  border-radius:16px;
  border:none;
  background:#fff7e6;
}

.kkt-time-mode-card{
  border-radius:16px;
  border:1px solid rgba(148,163,184,.5);
  background:#f8fafc;
  padding:.75rem .9rem;
}

.kkt-today-banner{
  border-radius:16px;
  background:#f4e0ff;
  padding:.9rem 1rem;
}

.kkt-streak-panel{
  border-radius:16px;
  background:#eef2ff;
  padding:1rem 1.1rem;
}

.kkt-speed-panel{
  border-radius:16px;
  padding:.9rem 1rem;
  background:#f8fafc;
}

.kkt-speed-panel--you{ background:#fff7ed; }

.kkt-speed-panel--best{ background:#e0f2fe; }

.kkt-speed-panel--rank{ background:#f5f3ff; }

.kkt-mode-btn--orange{
  background:#f97316;
  border-color:#f97316;
}

.kkt-mode-btn--primary{
  background:#050515;
  border-color:#050515;
}

.kkt-qpage{
  max-width: 1120px;
}

.kkt-qpage-header{
  display:flex;
  justify-content:center;
}

.kkt-qpage-tabs{
  display:inline-flex;
  align-items:center;
  gap:.25rem;
  padding:4px;
  border-radius:999px;
  background:#fff;
  border:1px solid rgba(148,163,184,.4);
}

.kkt-qpage-tab{
  border:0;
  background:transparent;
  padding:.55rem 1.6rem;
  border-radius:999px;
  font-size:.9rem;
  font-weight:500;
  color:#64748b;
  display:flex;
  align-items:center;
  gap:.35rem;
  cursor:pointer;
}

.kkt-qpage-tab:hover{
  background:#f1f5f9;
}

.kkt-qpage-tab.is-active{
  background:linear-gradient(135deg,#2563eb,#4f46e5);
  color:#fff;
  box-shadow:0 10px 30px rgba(37,99,235,.35);
}

.kkt-qcard{
  position:relative;
  border-radius:18px;
  background:rgba(255,255,255,.96);
  overflow:hidden;
}

.kkt-qcard-accent{
  position:absolute;
  inset:0 auto 0 0;
  width:4px;
}

.kkt-qcard-accent-theory{
  background:linear-gradient(to bottom,#f97373,#fb7185);
}

.kkt-qcard-accent-power{
  background:linear-gradient(to bottom,#60a5fa,#3b82f6);
}

.kkt-qcard-status{
  position:absolute;
  left:1.2rem;
  top:1rem;
  z-index:2;
}

.kkt-qstatus-circle{
  width:52px; height:52px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 10px 22px rgba(15,23,42,.18);
}

.kkt-qcard-review-toggle-on{
  border-color:#86efac;
  color:#16a34a;
}

.kkt-qcard-review-toggle-on:hover{
  background:#f0fdf4;
  color:#15803d;
}

.kkt-badge-theory{
  background:linear-gradient(135deg,#f97373,#fb7185);
  color:#fff;
}

.kkt-badge-power{
  background:linear-gradient(135deg,#60a5fa,#3b82f6);
  color:#fff;
}

.kkt-badge-machine{
  background:linear-gradient(135deg,#34d399,#10b981);
  color:#fff;
}

.kkt-badge-law{
  background:linear-gradient(135deg,#a78bfa,#6366f1);
  color:#fff;
}

.kkt-badge-meta-blue{
  border-color:#bfdbfe;
  background:linear-gradient(135deg,#eff6ff,#dbeafe);
  color:#1d4ed8;
}

.kkt-btn-question-power{
  background:linear-gradient(135deg,#60a5fa,#3b82f6);
}

.kkt-question-page {
  min-height: 100vh;
  background: radial-gradient(circle at top, #e0edff 0, #eff5ff 46%, #e9efff 100%);
  padding-block: 1.5rem 3.5rem;
}

.kkt-question-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
}

.kkt-question-heading-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--ink);
}

.kkt-question-heading-sub {
  margin: 0;
  font-size: .85rem;
  color: var(--muted);
}

.kkt-ql-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .45rem .9rem;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, .6);
  background: #fff;
  color: #1f2933;
  font-size: .8rem;
  line-height: 1.2;
  cursor: pointer;
  transition: all .16s ease;
  white-space: nowrap;
}

.kkt-ql-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, .12);
  border-color: var(--brand-1);
}

.kkt-ql-pill.is-active {
  background: linear-gradient(135deg, var(--brand-1), #4f46e5);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 25px rgba(37, 99, 235, .35);
}

.kkt-ql-result-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: 1rem;
  padding-top: .75rem;
  border-top: 1px solid rgba(148, 163, 184, .4);
  font-size: .85rem;
  color: var(--muted);
}

.kkt-ql-result-count {
  min-width: 80px;
  padding: .35rem 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-1), #4f46e5);
  color: #fff;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 10px 25px rgba(37, 99, 235, .38);
}

.kkt-ql-primary-btn {
  border-radius: 999px;
  padding-inline: 1.6rem;
  box-shadow: 0 14px 30px rgba(37, 99, 235, .35);
  background: linear-gradient(135deg, var(--brand-1), #4f46e5);
  border: none;
  color: #fff;
}

.kkt-ql-primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(37, 99, 235, .45);
  color: #fff;
}

.kkt-ql-list {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.kkt-ql-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem .5rem;
  margin-bottom: .5rem;
}

.kkt-ql-badge-q {
  padding: .2rem .7rem;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
}

.kkt-ql-tag-subject {
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .78rem;
  border: none;
  color: #fff;
}

.kkt-ql-tag-subject-theory { background: linear-gradient(135deg, #f97373, #fb7185); }

.kkt-ql-tag-subject-power { background: linear-gradient(135deg, #60a5fa, #3b82f6); }

.kkt-ql-tag-subject-machine { background: linear-gradient(135deg, #34d399, #10b981); }

.kkt-ql-tag-subject-law { background: linear-gradient(135deg, #a78bfa, #6366f1); }

.kkt-ql-history-box--correct { background: linear-gradient(135deg, #22c55e, #16a34a); }

.kkt-ql-history-box--incorrect { background: linear-gradient(135deg, #f97373, #ef4444); }

.kkt-ql-fab {
  position: absolute;
  top: .65rem;
  right: .75rem;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 25px rgba(15, 23, 42, .2);
  color: #9ca3af;
  border: none;
  cursor: pointer;
}

.kkt-ql-fab.is-on {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #f59e0b;
}

.kkt-qcard-bookmark-on {
  /* 文字色を濃い黄色（アンバー）に */
  color: #d97706 !important;

  /* 背景を薄い黄色にして強調（お好みで） */
  background-color: #fffbeb !important;

  /* ボーダーも少し色をつける（お好みで） */
  border: 1px solid #fcd34d;
}

.kkt-qcard-bookmark-on:hover {
  color: #b45309 !important; /* さらに濃く */
  background-color: #fef3c7 !important;
}

.table-cell {
  flex: 1;           /* 全ての列を均等な幅にする */
  text-align: center;
  padding: 0 0.25rem;
}

.table-cell {
    flex: 1;
    text-align: center;

    /* 以前は 0.25rem でしたが、ここを小さくします */
    /* 上下 2px, 左右 4px くらいがコンパクトでおすすめです */
    padding: 0px 4px;

    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: #fff;
    margin: 0 2px;

    /* 文字の上下中央揃えを確実にするための設定 */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5em; /* 最低限の高さを確保（数式が見切れるのを防ぐ） */
  }
