/**
 * minto.tech 用語辞典（Glossary）スタイルシート
 * body.minto-glossary-archive（一覧）/ body.minto-glossary-single（個別）
 *
 * プレフィックス: mg-（minto glossary）
 * テーマカラー: #58ce91（minto.tech メイングリーン）
 */

/* ========== 変数 ========== */
.minto-glossary-archive, .minto-glossary-single, .mg-term {
  --mg-primary: #58ce91;
  --mg-primary-dark: #4bb37f;
  --mg-text: #2c3e50;
  --mg-muted: #7f8c8d;
  --mg-bg: #f8fafc;
  --mg-card: #ffffff;
  --mg-border: #e2e8f0;
  --mg-hover: #f0faf5;
  --mg-yellow-bg: #fff9e6;
  --mg-yellow-border: #f5d97c;
  --mg-yellow-label: #c08000;
}

/* ========== 個別用語ページ 投稿本文内のスタイル ========== */
.mg-term { font-family: inherit; line-height: 1.8; color: var(--mg-text); }
.mg-term * { box-sizing: border-box; }

.mg-term-header {
  background: linear-gradient(135deg, #58ce91 0%, #4bb37f 100%);
  color: white;
  padding: 28px 24px;
  border-radius: 12px;
  margin: 0 0 24px;
}
.mg-term-header h1,
.mg-term-title {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 8px !important;
  color: white !important;
  border: none !important;
  padding: 0 !important;
  background: none !important;
}
.mg-term-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 14px;
  opacity: 0.95;
}
.mg-term-meta strong { margin-right: 4px; opacity: 0.85; font-weight: 400; }
.mg-category-badge {
  display: inline-block;
  background: rgba(255,255,255,0.25);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
  color: white;
}

.mg-short-def {
  background: var(--mg-card);
  border-left: 4px solid var(--mg-primary);
  padding: 18px 22px;
  margin: 0 0 24px !important;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.mg-short-def-label {
  font-size: 12px;
  color: var(--mg-primary);
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}
.mg-short-def p { margin: 0 !important; }

.mg-term h2 {
  font-size: 20px !important;
  margin: 28px 0 14px !important;
  padding: 0 0 0 14px !important;
  border-left: 5px solid var(--mg-primary) !important;
  border-bottom: none !important;
  background: none !important;
  line-height: 1.4 !important;
  color: var(--mg-text) !important;
}

.mg-long-def {
  background: var(--mg-card);
  padding: 22px 26px;
  border-radius: 8px;
  border: 1px solid var(--mg-border);
}
.mg-long-def p {
  margin: 0 0 1em !important;
  line-height: 1.85;
}
.mg-long-def p:last-child { margin-bottom: 0 !important; }

.mg-example {
  background: var(--mg-yellow-bg);
  border: 1px solid var(--mg-yellow-border);
  padding: 18px 22px;
  border-radius: 8px;
  margin: 16px 0 24px !important;
}
.mg-example-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--mg-yellow-label);
  margin-bottom: 6px;
}
.mg-example p { margin: 0 !important; }

.mg-aliases {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px !important;
}
.mg-alias-tag {
  background: #eef5f0;
  color: #2a7b52;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
}

.mg-related-terms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin: 0 0 24px !important;
}
.mg-related-term {
  background: var(--mg-card) !important;
  border: 1px solid var(--mg-border);
  padding: 12px 16px;
  border-radius: 8px;
  text-decoration: none !important;
  color: var(--mg-text) !important;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  display: block;
}
.mg-related-term:hover {
  border-color: var(--mg-primary);
  background: var(--mg-hover) !important;
  transform: translateY(-1px);
  color: var(--mg-primary-dark) !important;
}
.mg-related-term::after { content: " ›"; color: var(--mg-primary); float: right; }
.mg-related-term.mg-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.mg-related-posts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 24px !important;
}
.mg-related-post {
  background: var(--mg-card) !important;
  border: 1px solid var(--mg-border);
  padding: 12px 18px;
  border-radius: 8px;
  text-decoration: none !important;
  color: var(--mg-text) !important;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s;
}
.mg-related-post:hover {
  border-color: var(--mg-primary);
  background: var(--mg-hover) !important;
  color: var(--mg-primary-dark) !important;
}
.mg-related-post::before {
  content: "📄";
  flex-shrink: 0;
}
.mg-loading, .mg-no-posts {
  color: var(--mg-muted);
  font-size: 13px;
  font-style: italic;
  padding: 10px 0;
}

/* 個別ページ パンくず（テーマが出すので上書きのみ） */
.minto-glossary-single .breadcrumb a:hover { color: var(--mg-primary); }

/* ========== アーカイブページ ========== */
.mg-archive {
  font-family: inherit;
  color: var(--mg-text);
  line-height: 1.8;
}
.mg-archive * { box-sizing: border-box; }

.mg-archive-header {
  text-align: center;
  padding: 30px 0 24px;
}
.mg-archive-title {
  font-size: 32px;
  margin: 0 0 6px !important;
  background: linear-gradient(135deg, #58ce91 0%, #4bb37f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.mg-archive-desc {
  color: var(--mg-muted);
  font-size: 14px;
  margin: 0 !important;
}

.mg-search-box {
  margin: 0 0 20px;
}
.mg-search-input {
  width: 100%;
  padding: 14px 20px;
  border: 2px solid var(--mg-border);
  border-radius: 50px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.mg-search-input:focus { border-color: var(--mg-primary); }

.mg-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.mg-category-tab {
  padding: 8px 16px;
  background: var(--mg-card);
  border: 1px solid var(--mg-border);
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  user-select: none;
}
.mg-category-tab:hover { border-color: var(--mg-primary); }
.mg-category-tab.mg-active {
  background: var(--mg-primary);
  color: white;
  border-color: var(--mg-primary);
}

.mg-kana-index {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 20px;
  padding: 10px;
  background: var(--mg-card);
  border: 1px solid var(--mg-border);
  border-radius: 8px;
  justify-content: center;
}
.mg-kana-btn {
  padding: 6px 10px;
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--mg-muted);
  transition: all 0.15s;
}
.mg-kana-btn:hover { color: var(--mg-primary-dark); background: var(--mg-hover); }
.mg-kana-btn.mg-active {
  color: var(--mg-primary-dark);
  background: var(--mg-hover);
  border-color: var(--mg-primary);
}
.mg-kana-btn.mg-disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.mg-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.mg-card {
  background: var(--mg-card);
  border: 1px solid var(--mg-border);
  border-radius: 10px;
  padding: 18px 20px;
  text-decoration: none !important;
  color: var(--mg-text) !important;
  display: block;
  transition: all 0.15s;
}
.mg-card:hover {
  border-color: var(--mg-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(88, 206, 145, 0.15);
  color: var(--mg-text) !important;
}
.mg-card-category {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--mg-primary-dark);
  background: var(--mg-hover);
  padding: 3px 10px;
  border-radius: 10px;
  margin-bottom: 8px;
}
.mg-card-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.3;
}
.mg-card-reading {
  font-size: 12px;
  color: var(--mg-muted);
  margin: 0 0 8px;
}
.mg-card-def {
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mg-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 20px;
  color: var(--mg-muted);
  font-size: 14px;
}
.mg-count {
  font-size: 13px;
  color: var(--mg-muted);
  margin: 0 0 12px;
}

/* =================================================
 * ウィジェット ①: トップページFV埋め込み（フル機能版）
 * ================================================= */
.mg-hero {
  position: relative;
  padding: 48px 32px 40px;
  margin: 0 auto 32px;
  background:
    radial-gradient(circle at 20% 0%, rgba(88,206,145,0.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 100%, rgba(75,179,127,0.12) 0%, transparent 40%),
    linear-gradient(135deg, #ffffff 0%, #f8fbf9 100%);
  border: 1px solid #e6f2eb;
  border-radius: 20px;
  overflow: hidden;
  --mg-primary: #58ce91;
  --mg-primary-dark: #4bb37f;
  --mg-text: #2c3e50;
  --mg-muted: #7f8c8d;
  --mg-card: #ffffff;
  --mg-border: #e2e8f0;
  --mg-hover: #f0faf5;
}
.mg-hero * { box-sizing: border-box; }
.mg-hero::before {
  content: "";
  position: absolute;
  top: -50%; left: -10%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(88,206,145,0.08), transparent 70%);
  pointer-events: none;
}
.mg-hero-head {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
}
.mg-hero-badge {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(88,206,145,0.12);
  color: #2a7b52;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}
.mg-hero-title {
  font-size: 28px !important;
  font-weight: 800 !important;
  margin: 0 0 8px !important;
  color: #1a3a2a !important;
  border: none !important;
  padding: 0 !important;
  background: none !important;
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.mg-hero-title em {
  font-style: normal;
  background: linear-gradient(135deg, #58ce91 0%, #4bb37f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.mg-hero-subtitle {
  color: var(--mg-muted);
  font-size: 14px;
  margin: 0;
}
.mg-hero-search {
  position: relative;
  max-width: 560px;
  margin: 0 auto 28px;
}
.mg-hero-search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mg-primary-dark);
  font-size: 18px;
  pointer-events: none;
}
.mg-hero-search input {
  width: 100%;
  padding: 16px 20px 16px 50px;
  border: 2px solid var(--mg-border);
  border-radius: 50px;
  font-size: 15px;
  outline: none;
  background: white;
  transition: all 0.2s;
  font-family: inherit;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.mg-hero-search input:focus {
  border-color: var(--mg-primary);
  box-shadow: 0 4px 20px rgba(88,206,145,0.2);
}
.mg-hero-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: white;
  border: 1px solid var(--mg-border);
  border-radius: 14px;
  max-height: 360px;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  z-index: 100;
  display: none;
}
.mg-hero-search-results.mg-open { display: block; }
.mg-hero-search-item {
  display: block;
  padding: 12px 20px;
  text-decoration: none !important;
  color: var(--mg-text) !important;
  border-bottom: 1px solid #f1f5f3;
  font-size: 14px;
  transition: background 0.1s;
}
.mg-hero-search-item:last-child { border-bottom: none; }
.mg-hero-search-item:hover { background: var(--mg-hover); }
.mg-hero-search-item strong { font-weight: 700; }
.mg-hero-search-item .mg-sub {
  display: block;
  font-size: 12px;
  color: var(--mg-muted);
  margin-top: 2px;
}

.mg-hero-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 28px;
}
.mg-hero-cat {
  padding: 7px 14px;
  background: white;
  border: 1px solid var(--mg-border);
  border-radius: 50px;
  text-decoration: none !important;
  color: var(--mg-text) !important;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mg-hero-cat:hover {
  border-color: var(--mg-primary);
  background: var(--mg-hover);
  transform: translateY(-1px);
  color: var(--mg-primary-dark) !important;
}
.mg-hero-cat .mg-cat-icon {
  width: 18px; height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.mg-hero-cat .mg-cat-count {
  font-size: 11px;
  color: var(--mg-muted);
  margin-left: 2px;
}

.mg-hero-popular-label {
  text-align: center;
  font-size: 12px;
  color: var(--mg-muted);
  letter-spacing: 0.1em;
  margin: 0 0 14px;
  font-weight: 600;
}
.mg-hero-popular {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.mg-hero-pop-card {
  background: white;
  border: 1px solid var(--mg-border);
  border-radius: 10px;
  padding: 12px 14px;
  text-decoration: none !important;
  color: var(--mg-text) !important;
  transition: all 0.15s;
  display: block;
}
.mg-hero-pop-card:hover {
  border-color: var(--mg-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(88,206,145,0.15);
  color: var(--mg-text) !important;
}
.mg-hero-pop-card .mg-pop-cat {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--mg-primary-dark);
  background: var(--mg-hover);
  padding: 2px 8px;
  border-radius: 8px;
  margin-bottom: 4px;
}
.mg-hero-pop-card .mg-pop-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 2px;
  line-height: 1.3;
}
.mg-hero-pop-card .mg-pop-def {
  font-size: 11px;
  color: var(--mg-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.mg-hero-cta {
  text-align: center;
  margin-top: 6px;
}
.mg-hero-cta a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: linear-gradient(135deg, #58ce91 0%, #4bb37f 100%);
  color: white !important;
  text-decoration: none !important;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(88,206,145,0.3);
}
.mg-hero-cta a:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(88,206,145,0.4);
  color: white !important;
}

/* =================================================
 * ウィジェット ②: サイドバー
 * ================================================= */
.mg-sidebar {
  background: white;
  border: 1px solid #e6f2eb;
  border-radius: 12px;
  padding: 18px 18px 16px;
  margin-bottom: 20px;
  --mg-primary: #58ce91;
  --mg-primary-dark: #4bb37f;
  --mg-muted: #7f8c8d;
  --mg-border: #e2e8f0;
  --mg-hover: #f0faf5;
}
.mg-sidebar * { box-sizing: border-box; }
.mg-sidebar-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--mg-primary);
}
.mg-sidebar-title {
  font-size: 14px !important;
  font-weight: 700 !important;
  margin: 0 !important;
  color: #1a3a2a !important;
  border: none !important;
  padding: 0 !important;
  background: none !important;
}
.mg-sidebar-icon {
  width: 22px; height: 22px;
  background: linear-gradient(135deg, #58ce91 0%, #4bb37f 100%);
  color: white;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
}
.mg-sidebar-search {
  position: relative;
  margin-bottom: 12px;
}
.mg-sidebar-search input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border: 1px solid var(--mg-border);
  border-radius: 50px;
  font-size: 13px;
  outline: none;
  background: #f8fbfa;
  font-family: inherit;
}
.mg-sidebar-search input:focus {
  border-color: var(--mg-primary);
  background: white;
}
.mg-sidebar-search::before {
  content: "🔍";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  pointer-events: none;
}
.mg-sidebar-results {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: white;
  border: 1px solid var(--mg-border);
  border-radius: 10px;
  margin-top: 4px;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  z-index: 50;
  display: none;
}
.mg-sidebar-results.mg-open { display: block; }
.mg-sidebar-results a {
  display: block;
  padding: 8px 14px;
  text-decoration: none !important;
  color: #2c3e50 !important;
  border-bottom: 1px solid #f1f5f3;
  font-size: 12px;
}
.mg-sidebar-results a:hover { background: var(--mg-hover); }

.mg-sidebar-pop-label {
  font-size: 10px;
  color: var(--mg-muted);
  font-weight: 600;
  letter-spacing: 0.08em;
  margin: 6px 0 6px;
}
.mg-sidebar-pop {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.mg-sidebar-pop a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  font-size: 12px;
  text-decoration: none !important;
  color: #2c3e50 !important;
  border-radius: 6px;
  transition: background 0.1s;
}
.mg-sidebar-pop a:hover {
  background: var(--mg-hover);
  color: var(--mg-primary-dark) !important;
}
.mg-sidebar-pop .mg-num {
  font-size: 10px;
  color: var(--mg-muted);
  min-width: 18px;
  font-weight: 600;
}
.mg-sidebar-all {
  display: block;
  text-align: center;
  padding: 8px;
  background: var(--mg-hover);
  color: var(--mg-primary-dark) !important;
  text-decoration: none !important;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
}
.mg-sidebar-all:hover {
  background: var(--mg-primary);
  color: white !important;
}

/* =================================================
 * ウィジェット ③: 記事下
 * ================================================= */
.mg-inline {
  margin: 32px 0 24px;
  padding: 0;
  --mg-primary: #58ce91;
  --mg-primary-dark: #4bb37f;
  --mg-muted: #7f8c8d;
  --mg-border: #e2e8f0;
  --mg-hover: #f0faf5;
}
.mg-inline * { box-sizing: border-box; }

.mg-inline-matched {
  background: linear-gradient(135deg, #f8fbfa 0%, #f0faf5 100%);
  border: 1px solid #d8eee3;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 14px;
}
.mg-inline-matched-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.mg-inline-matched-title {
  font-size: 14px !important;
  font-weight: 700 !important;
  margin: 0 !important;
  color: #1a3a2a !important;
  border: none !important;
  padding: 0 !important;
  background: none !important;
}
.mg-inline-matched-sub {
  font-size: 11px;
  color: var(--mg-muted);
  margin: 0;
}
.mg-inline-matched-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.mg-inline-matched-item {
  background: white !important;
  border: 1px solid var(--mg-border);
  border-radius: 8px;
  padding: 10px 14px;
  text-decoration: none !important;
  color: #2c3e50 !important;
  transition: all 0.15s;
  display: block;
}
.mg-inline-matched-item:hover {
  border-color: var(--mg-primary);
  background: white !important;
  transform: translateY(-1px);
  color: var(--mg-primary-dark) !important;
  box-shadow: 0 3px 8px rgba(88,206,145,0.12);
}
.mg-inline-matched-item .mg-mi-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
}
.mg-inline-matched-item .mg-mi-def {
  display: block;
  font-size: 11px;
  color: var(--mg-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mg-inline-search {
  background: white;
  border: 1px dashed var(--mg-border);
  border-radius: 12px;
  padding: 14px 18px;
  text-align: center;
}
.mg-inline-search-label {
  font-size: 12px;
  color: var(--mg-muted);
  margin: 0 0 8px;
}
.mg-inline-search-box {
  position: relative;
  max-width: 400px;
  margin: 0 auto;
}
.mg-inline-search-box input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 1px solid var(--mg-border);
  border-radius: 50px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}
.mg-inline-search-box input:focus { border-color: var(--mg-primary); }
.mg-inline-search-box::before {
  content: "🔍";
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  pointer-events: none;
}
.mg-inline-search-results {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: white;
  border: 1px solid var(--mg-border);
  border-radius: 10px;
  margin-top: 4px;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  z-index: 40;
  display: none;
  text-align: left;
}
.mg-inline-search-results.mg-open { display: block; }
.mg-inline-search-results a {
  display: block;
  padding: 8px 14px;
  text-decoration: none !important;
  color: #2c3e50 !important;
  border-bottom: 1px solid #f1f5f3;
  font-size: 12px;
}
.mg-inline-search-results a:hover { background: var(--mg-hover); }

/* =================================================
 * ウィジェット ④: フローティング右下（PCのみ）
 * ================================================= */
.mg-fab-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  --mg-primary: #58ce91;
  --mg-primary-dark: #4bb37f;
  --mg-muted: #7f8c8d;
  --mg-border: #e2e8f0;
  --mg-hover: #f0faf5;
}
.mg-fab-wrap * { box-sizing: border-box; }
.mg-fab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #58ce91 0%, #4bb37f 100%);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(88,206,145,0.35);
  transition: all 0.2s;
}
.mg-fab-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88,206,145,0.45);
}
.mg-fab-btn .mg-fab-icon {
  width: 22px; height: 22px;
  background: white;
  color: var(--mg-primary-dark);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 13px;
}

.mg-fab-panel {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  width: 340px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.18);
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  pointer-events: none;
  transition: all 0.2s ease-out;
}
.mg-fab-panel.mg-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.mg-fab-header {
  background: linear-gradient(135deg, #58ce91 0%, #4bb37f 100%);
  color: white;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mg-fab-header-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mg-fab-header .mg-fab-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  width: 24px; height: 24px;
  opacity: 0.8;
}
.mg-fab-header .mg-fab-close:hover { opacity: 1; }

.mg-fab-body {
  padding: 14px 16px 16px;
}
.mg-fab-hint {
  font-size: 11px;
  color: var(--mg-muted);
  margin: 0 0 8px;
}
.mg-fab-search {
  position: relative;
  margin-bottom: 10px;
}
.mg-fab-search input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 1px solid var(--mg-border);
  border-radius: 50px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}
.mg-fab-search input:focus {
  border-color: var(--mg-primary);
  box-shadow: 0 0 0 3px rgba(88,206,145,0.15);
}
.mg-fab-search::before {
  content: "🔍";
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  pointer-events: none;
}
.mg-fab-results {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid #f1f5f3;
  border-radius: 10px;
  background: #fbfdfc;
}
.mg-fab-results a {
  display: block;
  padding: 10px 14px;
  text-decoration: none !important;
  color: #2c3e50 !important;
  border-bottom: 1px solid #f1f5f3;
  font-size: 13px;
  transition: background 0.1s;
}
.mg-fab-results a:last-child { border-bottom: none; }
.mg-fab-results a:hover { background: var(--mg-hover); }
.mg-fab-results a strong { font-weight: 700; }
.mg-fab-results a .mg-sub {
  display: block;
  font-size: 11px;
  color: var(--mg-muted);
  margin-top: 2px;
}
.mg-fab-empty {
  padding: 20px;
  text-align: center;
  color: var(--mg-muted);
  font-size: 12px;
}
.mg-fab-footer {
  padding: 10px 16px;
  background: #f8fbfa;
  border-top: 1px solid #eef5f0;
  text-align: center;
}
.mg-fab-footer a {
  font-size: 12px;
  color: var(--mg-primary-dark) !important;
  font-weight: 600;
  text-decoration: none !important;
}
.mg-fab-footer a:hover { text-decoration: underline !important; }

/* フローティングはスマホ非表示（上様指示） */
@media (max-width: 768px) {
  .mg-fab-wrap { display: none !important; }
}

/* ========== レスポンシブ ========== */
@media (max-width: 600px) {
  .mg-term-header { padding: 22px 18px; }
  .mg-term-header h1, .mg-term-title { font-size: 26px; }
  .mg-short-def, .mg-long-def, .mg-example { padding: 16px 18px; }
  .mg-cards-grid { grid-template-columns: 1fr; }
  .mg-archive-title { font-size: 26px; }
  .mg-hero { padding: 32px 20px 28px; }
  .mg-hero-title { font-size: 22px !important; }
  .mg-hero-popular { grid-template-columns: 1fr 1fr; }
  .mg-inline-matched-list { grid-template-columns: 1fr; }
}
