  /* Reset Point: 2024-05-21 */
  /* Update Count: 0 */

/* ── スケルトンローディング ─────────────────────────────── */
.skeleton-wrap { padding: 10px 0; }
.skeleton-row { display: flex; gap: 10px; margin-bottom: 12px; }
.skeleton {
  background: linear-gradient(90deg, #e8edf2 25%, #f4f6f9 50%, #e8edf2 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  border-radius: 8px;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-btn     { height: 48px; flex: 1; border-radius: 30px; }
.skeleton-btn-sm  { height: 70px; flex: 1; border-radius: 10px; }
.skeleton-list-title { height: 18px; width: 40%; margin-bottom: 8px; border-radius: 4px; }
.skeleton-list-item  { height: 52px; width: 100%; margin-bottom: 8px; border-radius: 8px; }
  :root { 
    --main: #2c3e50; 
    --acc: #3498db; 
    --bg: #f4f6f9; 
    --danger: #e74c3c; 
    --success: #27ae60; 
    --resume: #e67e22;
    --card-bg: #ffffff;
    --text-color: #34495e;
  }
  
  body { 
    font-family: 'Noto Sans JP', sans-serif; 
    background: var(--bg); 
    margin: 0; 
    padding: 20px; 
    color: var(--text-color); 
  }
  
  .container { 
    max-width: 900px; 
    margin: 0 auto; 
    background: white; 
    padding: 20px; 
    border-radius: 15px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.05); 
    position: relative; 
    min-height: 80vh; 
  }
  
  /* Smart Design Components */
  
  .dashboard-header {
    text-align: center;
    margin-bottom: 25px;
  }
  .dashboard-header h3 {
    margin: 0 0 5px 0;
    color: var(--main);
    font-size: 1.5rem;
  }

  .smart-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #edf2f7;
    position: relative;
  }
  .card-label {
    font-size: 0.85rem;
    font-weight: bold;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
  }

  .chart-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
  }
  .chart-col {
    flex: 1;
    min-width: 300px; 
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    border: 1px solid #edf2f7;
  }
  .chart-label {
    text-align: center;
    font-weight: bold;
    color: var(--main);
    margin-bottom: 15px;
    font-size: 1rem;
  }

  .progress-track {
    background: #e9ecef;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
  }
  .progress-fill {
    background: linear-gradient(90deg, #3498db, #2980b9);
    height: 100%;
    width: 0%;
    transition: width 1s ease-out;
    border-radius: 6px;
  }
  .pass-line {
    position: absolute;
    left: 60%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e74c3c;
    z-index: 2;
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.5);
  }

  .tab-container-smart {
    display: flex;
    justify-content: center;
    background: #f1f3f5;
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 25px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
  .tab-btn-smart {
    flex: 1;
    text-align: center;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    color: #7f8c8d;
    border-radius: 10px;
    transition: all 0.2s;
  }
  .tab-btn-smart.active {
    background: white;
    color: var(--main);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  }

  /* 分析画面タブ */
  .analysis-tab-bar {
    display: flex;
    gap: 4px;
    background: #f1f3f5;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 12px;
  }
  .analysis-tab {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    font-size: 0.82rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 7px;
    color: #888;
    transition: all 0.2s;
    white-space: nowrap;
  }
  .analysis-tab.active {
    background: #fff;
    color: var(--main);
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  }
  .atab-content { animation: fadeIn 0.15s ease; }
  @keyframes fadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:translateY(0); } }

  /* レーダー期間タブ（科目タブ内） */
  .radar-period-tab {
    background: #f1f3f5;
    color: #888;
    border: none;
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
  }
  .radar-period-tab.active {
    background: #2c3e50;
    color: #fff;
  }

  /* 期間タブ（分析ヒーロー内） */
  .analysis-period-tab {
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.7);
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
  }
  .analysis-period-tab.active {
    background: #fff;
    color: #2c3e50;
  }

  /* 共通 */
  .app-title {
    text-align: center; 
    font-size: 1.4rem; 
    margin: 15px 0;
    font-weight: bold; 
    color: var(--main);
    letter-spacing: 0.05em;
  }
  .st-logo {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 1.8rem;
    background: linear-gradient(45deg, #3498db, #1abc9c); /* 青から緑へのグラデーション */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
  }
  .screen-header { display: flex; align-items: center; justify-content: space-between; min-height: 40px; margin-bottom: 10px; border-bottom: 1px solid #f0f0f0; }
  .nav-btn { background: #95a5a6; color: white; border: none; padding: 6px 14px; border-radius: 6px; font-weight: bold; font-size: 0.85rem; cursor: pointer; display: inline-flex; align-items: center; }
  .nav-btn:before { content: '◀ '; margin-right: 4px; }
  
  /* 認証画面 */
  #auth-screen { padding: 20px 10px; }
  .form-group { margin-bottom: 15px; text-align: left; }
  .form-group label { display: block; font-weight: bold; color: var(--main); margin-bottom: 5px; font-size: 0.9rem; }
  .form-group input { width: 100%; padding: 12px; font-size: 1rem; border: 1px solid #ccc; border-radius: 8px; box-sizing: border-box; }

  .btn-auth { width: 100%; padding: 14px; background: var(--acc); color: white; border: none; border-radius: 8px; font-weight: bold; font-size: 1.1rem; cursor: pointer; margin-top: 10px; box-shadow: 0 3px 0 #2980b9; }
  .btn-auth:active { transform: translateY(2px); box-shadow: none; }
  .btn-reg { background: var(--success); box-shadow: 0 3px 0 #1e8449; }

  .auth-switch-text { text-align: center; margin-top: 20px; font-size: 0.9rem; color: #7f8c8d; }
  .auth-switch-text span { color: var(--acc); text-decoration: underline; cursor: pointer; }
  
  .user-info-bar { 
    background: #fff; 
    padding: 12px 15px; 
    border-radius: 12px; 
    margin-bottom: 20px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    gap: 10px;
    font-size: 0.9rem; 
    color: var(--main); 
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #edf2f7;
    min-height: 50px;
  }
  
  .header-ctrl-wrapper {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-status {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  #display-user-name {
    font-weight: bold;
    color: var(--main);
    font-size: 1rem;
  }

  .badge-gray { background: #bdc3c7; color: white; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: bold; white-space: nowrap; }
  .badge-blue { background: #3498db; color: white; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: bold; white-space: nowrap; }
  
  .btn-login-header {
      background: #95a5a6; color: white; border: none; padding: 8px 16px; border-radius: 20px; 
      font-weight: bold; cursor: pointer; font-size: 0.85rem; box-shadow: none; white-space: nowrap;
      transition: transform 0.1s, background 0.2s;
      display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  }
  .btn-login-header:hover { opacity: 0.9; }
  .btn-login-header:active { transform: scale(0.96); }

  .btn-reg-header {
    background: var(--success) !important;
    box-shadow: 0 2px 5px rgba(39, 174, 96, 0.3) !important;
  }

  .btn-logout-header {
      background: #f1f3f5; border: 1px solid #e9ecef; color: #555; padding: 6px 12px; border-radius: 6px;
      cursor: pointer; font-size: 0.8rem; white-space: nowrap; font-weight: bold;
      transition: background 0.2s;
  }
  .btn-logout-header:hover { background: #e9ecef; }
  .btn-logout-danger { background: #fff0f0 !important; border-color: #f5c6c6 !important; color: #c0392b !important; }
  .btn-logout-danger:hover { background: #fde0e0 !important; }


  /* スマホ対応 */
  @media (max-width: 600px) {
    .smart-card {
      padding: 12px 10px;
      border-radius: 10px;
    }
    .header-ctrl-wrapper {
      flex-direction: column;
      align-items: stretch;
      gap: 15px;
    }
    .header-status {
      justify-content: center;
      width: 100%;
      padding-bottom: 8px;
      border-bottom: 1px dashed #eee;
    }
    .header-actions {
      justify-content: space-between;
      width: 100%;
    }
    .btn-login-header, .btn-logout-header {
      flex: 1;
      padding: 10px 2px;
      font-size: 0.8rem;
    }
  }

  /* インライン登録フォーム */
  #inline-register-form {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    background: #fffbe6; /* 淡い黄色に変更 */
    padding: 15px;
    border-radius: 10px;
    border: 2px dashed #ffe58f; /* 点線のボーダーを追加 */
    box-sizing: border-box; /* はみ出しによるレイアウト崩れを防止 */
  }
  .inline-reg-input {
    flex: 1;
    min-width: 150px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9rem;
  }
  .inline-reg-note {
    width: 100%;
    font-size: 0.8rem;
    color: #c09853; /* テキストカラーを調整 */
    text-align: center;
    font-weight: bold; /* 太字にして強調 */
  }

  .ad-banner { margin: 0 0 20px 0; background-color: #fffcf5; border: 2px dashed #f1c40f; border-radius: 8px; padding: 8px; display: flex; align-items: center; box-sizing: border-box; }
  .ad-banner a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #d35400; width: 100%; }
  .ad-image-wrapper { width: 60px; flex-shrink: 0; text-align: center; display: flex; align-items: center; justify-content: center; }
  .ad-banner img { max-height: 80px; width: auto; max-width: 100%; border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
  .ad-text { flex-grow: 1; text-align: left; min-width: 0; }
  .ad-link-text { font-size: 0.9rem; color: #2c3e50; font-weight: bold; display: block; line-height: 1.3; margin-bottom: 4px; }
  .ad-caption { font-size: 0.75rem; color: #7f8c8d; display: block; }

  .action-row { display: flex; gap: 10px; margin-bottom: 25px; }
  .btn-action { flex: 1; padding: 12px 5px; font-size: 0.85rem; border-radius: 8px; border: none; color: white; font-weight: bold; box-shadow: 0 2px 3px rgba(0,0,0,0.2); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; }
  .btn-action:active { transform: translateY(2px); box-shadow: none; }
  #analysis-btn { background: #9b59b6; } #weakness-btn { background: var(--danger); } #bookmark-start-btn { background: #f1c40f; text-shadow: 0 1px 1px rgba(0,0,0,0.1); }
  
  .menu-section-title { font-weight: bold; color: #2c3e50; margin: 30px 0 10px 0; border-left: 5px solid var(--acc); padding-left: 10px; font-size: 1.1rem; }
  .random-global-grid { display: flex; gap: 10px; }
  .rnd-btn-g { flex: 1; padding: 15px 5px; background: var(--success); font-size: 0.95rem; border: none; border-radius: 8px; color: white; font-weight: bold; cursor: pointer; box-shadow: 0 3px 0 #1e8449; }
  .rnd-btn-latest { flex: 1; padding: 15px 5px; background: #ff5722; font-size: 0.95rem; border: none; border-radius: 8px; color: white; font-weight: bold; cursor: pointer; box-shadow: 0 3px 0 #e64a19; }
  
  .cat-section-title { font-size: 1rem; font-weight: bold; color: #555; margin: 20px 0 10px 0; border-bottom: 2px solid #eee; padding-bottom: 5px; }
  .cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-bottom: 20px; }
  .cat-card { display: flex; align-items: center; justify-content: space-between; background: #f9f9f9; padding: 10px; border: 1px solid #eee; border-radius: 8px; }
  .cat-name { font-weight: bold; font-size: 0.9rem; color: #333; flex: 1; margin-right: 5px; }
  .cat-btns { display: flex; gap: 4px; }
  .cat-rnd-btn { padding: 8px 10px; font-size: 0.8rem; background: var(--acc); color: white; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; white-space: nowrap; }

  @media (max-width: 600px) {
    .action-row { flex-wrap: wrap; }
    .btn-action { flex: 0 0 calc(50% - 5px); } /* スマホは2列で折り返し */
    .cat-grid { grid-template-columns: 1fr 1fr; }
    .cat-card { flex-direction: column; align-items: stretch; text-align: center; padding: 8px; }
    .cat-name { margin-right: 0; margin-bottom: 8px; font-size: 0.85rem; height: 2.4em; display: flex; align-items: center; justify-content: center; }
    .cat-btns { justify-content: space-between; }
    .cat-rnd-btn { flex: 1; padding: 6px 0; font-size: 0.75rem; }
    .analysis-summary-block { flex-direction: column; }
    .analysis-left, .analysis-right { width: 100%; box-sizing: border-box; }
    .cat-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .mini-table { min-width: 100%; white-space: nowrap; }
  }

  .year-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .year-btn { padding: 12px; background: #34495e; color: white; border: none; border-radius: 8px; font-weight: bold; cursor: pointer; box-shadow: 0 3px 0 #2c3e50; }

  details, .start-section { display: none; }
  #quiz-screen, #summary-screen, #analysis-screen, #teacher-screen, #resume-area { display: none; }
  
  .btn-common { width: 100%; padding: 15px; font-size: 1rem; margin-bottom: 10px; background: var(--acc); border: none; border-radius: 8px; color: white; font-weight: bold; cursor: pointer; }

  #resume-btn {
    background-color: #fff8e1; 
    color: var(--resume); 
    border: 2px dashed var(--resume); 
    box-shadow: none; 
    font-size: 1.1rem;
    padding: 16px;
    margin-bottom: 25px;
    transition: background-color 0.2s;
  }
  #resume-btn:hover { background-color: #ffe0b2; }
  #resume-btn:active { background-color: #ffd54f; }

  #quiz-info-row { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding-bottom: 8px; margin-bottom: 6px; }
  #quiz-jump-bar { display: flex; gap: 6px; margin-bottom: 12px; }
  #quiz-jump-bar select { flex: 1; font-size: 0.78rem; padding: 4px 6px; border: 1px solid #d0dce8; border-radius: 6px; background: #f5f8fc; color: #445; cursor: pointer; min-width: 0; }
  #quiz-jump-bar select:focus { outline: none; border-color: #3498db; }
  #status-bar { display: flex; justify-content: flex-end; gap: 10px; font-weight: bold; color: #555; font-size: 0.85rem; }
  #quiz-screen .screen-header { border-bottom: none; margin-bottom: 0; }
  
  .badge-blue-quiz { background: #e3f2fd; color: #1565c0; padding: 4px 8px; border-radius: 4px; font-size: 0.85rem; font-weight: bold; }
  
  #bookmark-btn-meta { background: white; border: 1px solid #ccc; border-radius: 20px; padding: 4px 12px; font-size: 0.8rem; color: #95a5a6; font-weight: bold; cursor: pointer; white-space: nowrap; }
  #bookmark-btn-meta.active { color: #f1c40f; border-color: #f1c40f; background: #fff9db; }
  
  #question-text { font-size: 1.1rem; line-height: 1.8; white-space: pre-wrap; background: #eef2f5; padding: 15px; border-radius: 8px; margin-bottom: 20px; }
  .btn-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 20px; }
  .ans-btn { background: var(--acc); padding: 15px 0; font-size: 1.2rem; border: none; border-radius: 8px; color: white; font-weight: bold; cursor: pointer; }
  .ans-btn:disabled { background: #bdc3c7; cursor: not-allowed; }
  .q-correct-mark { background: #ffe066; color: inherit; border-radius: 3px; padding: 0 2px; font-weight: bold; }
  .q-user-answer-mark { font-size: 0.8em; color: #e74c3c; font-weight: bold; margin-left: 4px; }
  .q-stat { margin-top: 6px; font-size: 0.8rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .q-stat-bar-wrap { flex: 1; max-width: 80px; height: 6px; background: #e0e0e0; border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; }
  .q-stat-bar { height: 100%; border-radius: 3px; display: block; }
  .q-stat-label { color: inherit; opacity: 0.85; font-size: 0.78rem; }
  .q-stat-low { color: inherit; opacity: 0.5; font-size: 0.78rem; font-style: italic; }
  #ans-buttons-wrap { position: relative; }
  #next-overlay { display: none; position: absolute; inset: 0; width: 100%; border: none; border-radius: 8px; cursor: pointer; background: rgba(44,62,80,0.9); color: white; font-size: 1.15rem; font-weight: bold; align-items: center; justify-content: center; }
  
  #result-area { display: none; text-align: center; margin-bottom: 20px; padding: 15px; border-radius: 8px; font-weight: bold; font-size: 1.1rem;}
  .correct { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
  .incorrect { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

  /* 問題画像 */
  #image-area { margin-bottom: 12px; overflow: hidden; }
  #q-img { width: 100%; max-width: 100%; height: auto; display: block; border-radius: 4px; }
  @media (orientation: landscape) and (max-height: 600px) {
    #q-img { width: auto; max-width: 100%; max-height: 45vh; margin: 0 auto; }
  }

  /* アクションエリア（次へ・AIボタン） */
  #quiz-action-area { display: none; gap: 10px; margin-bottom: 15px; }

  #next-btn { flex: 2; padding: 12px; font-size: 1rem; font-weight: bold; color: white; background-color: var(--main); border: none; border-radius: 8px; cursor: pointer; box-shadow: 0 4px 0 #1a252f; display: block; width: auto; margin-bottom: 0; }
  #next-btn:active { transform: translateY(2px); box-shadow: none; }
  
  /* 類似問題エリア */
  #similar-area { margin-bottom: 20px; }

  .summary-content { text-align: center; margin-top: 20px; padding: 10px; }
  .score-card { background: #f8f9fa; border: 1px solid #eee; border-radius: 12px; padding: 20px; margin-bottom: 20px; }
  .score-large { font-size: 3.5rem; font-weight: bold; color: #e67e22; line-height: 1; margin-bottom: 10px; }
  .score-detail { font-size: 1.2rem; color: #555; margin-bottom: 5px; }
  #share-x-btn { background: #000; color: white; padding: 12px; border: none; border-radius: 8px; width: 100%; font-weight: bold; margin-bottom: 25px; cursor: pointer; display: flex; justify-content: center; gap: 8px; }

  /* ご意見掲示板 */
  .feedback-anon-row { display: flex; align-items: center; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
  .feedback-radio { display: flex; align-items: center; gap: 5px; font-size: 0.85rem; color: #444; cursor: pointer; }

  /* ── スレッド（折りたたみ式） */
  .feedback-thread { margin-bottom: 6px; border: 1px solid #e4eaf2; border-radius: 8px; overflow: hidden; cursor: pointer; background: #fff; transition: box-shadow 0.15s; }
  .feedback-thread:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.07); }

  /* ── 1行サマリー（常に表示） */
  .feedback-summary { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 0.88rem; }
  .feedback-summary-date { color: #bbb; flex-shrink: 0; }
  .feedback-post-name { font-weight: bold; color: #555; flex-shrink: 0; }
  .feedback-summary-preview { color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
  .feedback-has-reply { font-size: 0.75rem; color: #2980b9; font-weight: bold; flex-shrink: 0; border: 1px solid #aed3ee; border-radius: 4px; padding: 1px 5px; }
  .feedback-expand-icon { font-size: 0.65rem; color: #ccc; transition: transform 0.2s; display: inline-block; flex-shrink: 0; }
  .feedback-thread.expanded .feedback-expand-icon { transform: rotate(180deg); }
  .feedback-thread.expanded .feedback-summary { border-bottom: 1px solid #eee; background: #f8fafc; }

  /* ── 展開時の詳細エリア */
  .feedback-detail { display: none; padding: 12px 14px; }
  .feedback-thread.expanded .feedback-detail { display: block; }

  /* ── ユーザー投稿本文（展開後） */
  .feedback-post-meta { font-size: 0.78rem; color: #999; margin-bottom: 6px; }
  .feedback-post-body { font-size: 0.93rem; white-space: pre-wrap; color: #2c3e50; line-height: 1.6; }

  /* ── 管理者返信 */
  .feedback-reply-block { margin-top: 10px; padding: 10px 12px; background: #eaf4fd; border-left: 3px solid #3498db; border-radius: 0 6px 6px 0; }
  .feedback-reply-label { font-size: 0.75rem; font-weight: bold; color: #2980b9; margin-bottom: 4px; }
  .feedback-reply-body { font-size: 0.9rem; white-space: pre-wrap; color: #2c3e50; line-height: 1.6; }

  /* ── ユーザーコメント（管理者返答後） */
  .feedback-comments { margin-top: 10px; border-top: 1px solid #eee; padding-top: 8px; }
  .feedback-comment-item { font-size: 0.85rem; padding: 5px 0; border-bottom: 1px solid #f5f5f5; color: #444; }
  .feedback-comment-name { font-weight: bold; color: #555; margin-right: 6px; }
  .feedback-comment-date { font-size: 0.75rem; color: #bbb; margin-right: 8px; }
  .feedback-comment-input { margin-top: 8px; display: flex; gap: 6px; }
  .feedback-comment-input textarea { flex: 1; border: 1px solid #ddd; border-radius: 6px; padding: 6px 8px; font-size: 0.85rem; resize: none; height: 50px; font-family: inherit; }
  .feedback-comment-input button { padding: 0 14px; background: #3498db; color: #fff; border: none; border-radius: 6px; font-size: 0.85rem; cursor: pointer; flex-shrink: 0; }
  .feedback-comment-input button:hover { background: #2980b9; }

  .analysis-summary-block { display: flex; gap: 10px; margin-bottom: 20px; align-items: stretch; }
  .analysis-left { flex: 1; background: #fff; padding: 10px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); text-align: center; display: flex; flex-direction: column; justify-content: center; }
  .analysis-right { flex: 1; background: #fff; padding: 10px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); height: 160px; }
  .percent-val { font-size: 2.2rem; font-weight: bold; color: var(--acc); }
  
  .tab-container { display: flex; justify-content: center; margin-bottom: 10px; border-bottom: 2px solid #eee; }
  .tab-btn { padding: 10px 20px; cursor: pointer; font-weight: bold; color: #7f8c8d; border-bottom: 3px solid transparent; flex: 1; text-align: center; }
  .tab-active { color: #e67e22; border-bottom: 3px solid #e67e22; }
  
  .ranking-table, .mini-table, .student-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-bottom: 20px; }
  th, td { padding: 8px; border-bottom: 1px solid #eee; text-align: left; }
  th { background: #f9f9f9; color: #555; font-size: 0.8rem; }
  .rank-cell { font-weight: bold; text-align: center; width: 40px; }
  .cat-table-only { border: 1px solid #eee; border-radius: 8px; padding: 5px; margin-bottom: 15px; }
  .good-rate { color: #27ae60; font-weight: bold; } .bad-rate { color: #e74c3c; font-weight: bold; }
  
  .result-detail-table { width: 100%; font-size: 0.85rem; border-collapse: collapse; margin-top: 10px; }
  .result-detail-table th, .result-detail-table td { border-bottom: 1px solid #eee; padding: 8px 4px; text-align: left; }
  .result-detail-table th { background: #f1f2f6; color: #555; }
  
  #teacher-login-btn { background: #7f8c8d; color: white; padding: 5px 10px; border:none; border-radius:4px; margin-top:20px; cursor:pointer;}
  
  .btn-admin { 
    background: transparent; 
    color: #ecf0f1;
    padding: 5px 10px; 
    border: none; 
    margin-left: 10px; 
    cursor: pointer; 
    font-size: 0.8rem;
    transition: color 0.3s;
  }
  .btn-admin:hover { color: #bdc3c7; }

  #retry-btn { margin-top: 20px; }

  .loader-container { text-align: center; margin-top: 30px; padding: 20px; }
  .loader { border: 5px solid #f3f3f3; border-top: 5px solid #3498db; border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 0 auto 10px auto; }
  @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
  .loading-text { color: #7f8c8d; font-size: 0.9rem; font-weight: bold; animation: blink 1.5s infinite; }
  @keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

  /* ニュースティッカー */
  .news-ticker-wrap {
    width: 100%;
    overflow: hidden;
    background: #fff8e1;
    border: 1px solid #ffe0b2;
    border-radius: 6px;
    padding: 6px 0;
    margin-top: 5px;
    margin-bottom: 10px;
    position: relative;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #5d4037;
    cursor: pointer;
  }
  .news-ticker-icon {
    background: #fff8e1;
    padding: 0 8px;
    z-index: 2;
    font-weight: bold;
    color: #e67e22;
    flex-shrink: 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    font-size: 0.8rem;
  }
  .news-ticker-flow {
    flex-grow: 1;
    overflow: hidden;
    white-space: nowrap;
  }
  .news-ticker-content {
    display: inline-block;
    padding-left: 100%;
    animation: ticker-scroll 20s linear infinite;
  }
  @keyframes ticker-scroll {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
  }
  .news-ticker-item {
    display: inline-block;
    margin-right: 30px;
  }
  .news-click-hint {
    padding: 0 8px;
    font-size: 0.7rem;
    font-weight: bold;
    color: #e67e22;
    background: #fff8e1;
    z-index: 2;
    flex-shrink: 0;
    box-shadow: -2px 0 5px rgba(0,0,0,0.05);
    animation: blink-hint 1.5s infinite ease-in-out;
  }
  @keyframes blink-hint {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
  }
  /* お知らせ展開エリア */
  .news-ticker-wrap.expanded {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
    margin-bottom: 0;
  }
  #news-expand-area {
    background: #fff;
    border: 1px solid #ffe0b2;
    border-top: 1px dashed #ffe0b2;
    border-radius: 0 0 6px 6px;
    padding: 10px 15px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: #5d4037;
    animation: fadeIn 0.2s;
  }
  .news-expand-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
  }
  .news-expand-item:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
  .news-detail-content {
    margin-top: 5px;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #555;
    white-space: pre-wrap;
    line-height: 1.5;
  }

  /* ★追加：マイ単語帳コンテナ */
  .wb-category-block {
    margin-bottom: 15px;
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #eee;
  }
  /* 大分類見出し */
  .wb-group-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #2c3e50;
    margin-top: 15px;
    margin-bottom: 10px;
    border-bottom: 3px solid #3498db;
    padding-bottom: 5px;
    display: inline-block;
  }
  .wb-cat-title {
    font-size: 1.0rem;
    font-weight: bold;
    color: var(--main);
    border-left: 5px solid var(--acc);
    padding-left: 10px;
    margin-bottom: 12px;
  }
  .wb-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  /* 単語チップ（未登録状態） */
  .word-chip {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    background-color: #f8f9fa;
    color: #b0b0b0; /* 薄いグレー */
    border: 1px solid #eee;
  }
  
  .word-chip:hover {
    background-color: #e2e6ea;
  }
  
  .print-checkbox { display: none; }

  /* 単語チップ（登録済み状態） */
  .word-chip.active {
    background-color: #3498db; /* 濃い青 */
    color: white;
    border-color: #2980b9;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
    transform: translateY(-1px);
  }
  
  /* 問題文中のキーワードリンク */
  .keyword-link {
    border-bottom: 1px dotted #3498db;
    color: #2980b9;
    font-weight: normal; /* 太字を解除 */
    cursor: pointer;
    transition: background 0.2s;
  }
  .keyword-link:hover {
    background-color: rgba(0,0,0,0.05); /* ホバー時のみ薄く背景色 */
    color: #2980b9;
  }

  /* 最新3年分チャレンジボタン用スタイル */
  .btn-large-challenge {
    background-color: #ff5722;
    color: white;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    margin: 10px 0;
  }
  .btn-large-challenge:hover { transform: translateY(-2px); box-shadow: 0 6px 8px rgba(0,0,0,0.15); }
  .btn-large-challenge:disabled { background-color: #ccc; cursor: not-allowed; transform: none; }

  /* 習得リスト用 */
  .teacher-select { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; background: #fff; font-size: 0.9rem; margin-bottom: 10px; }

  /* 習得リスト - 年度セクション */
  .mastery-grid-container { padding: 5px 0; display: flex; flex-direction: column; gap: 6px; }
  .mastery-year-section { border: 1px solid #e8e8e8; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
  .mastery-year-header { padding: 7px 12px 6px; background: #f8f9fa; border-bottom: 1px solid #efefef; cursor: pointer; user-select: none; }
  .mastery-year-header:hover { background: #f0f2f5; }
  .mastery-year-header-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
  .mastery-year-toggle { font-size: 0.65rem; color: #aaa; transition: transform 0.2s; flex-shrink: 0; }
  .mastery-year-section.open .mastery-year-toggle { transform: rotate(90deg); }
  .mastery-year-title { font-weight: bold; color: #2c3e50; font-size: 0.92rem; }
  .mastery-year-stats { display: flex; gap: 10px; font-size: 0.75rem; flex-wrap: wrap; flex: 1; }
  .stat-mastered { color: #27ae60; font-weight: 600; }
  .stat-review { color: #c0392b; font-weight: 600; }
  .stat-unplayed { color: #95a5a6; }
  .mastery-year-bar { height: 5px; background: #e9ecef; border-radius: 3px; overflow: hidden; display: flex; }
  .bar-mastered { background: #27ae60; height: 100%; }
  .bar-review { background: #e74c3c; height: 100%; }

  /* 科目行（2カラムグリッド） */
  .mastery-subjects-body { display: none; }
  .mastery-year-section.open .mastery-subjects-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); align-items: start; }
  .mastery-subject-row { display: flex; align-items: flex-start; padding: 3px 6px; border-bottom: 1px solid #f4f4f4; gap: 3px; min-height: 22px; }
  .mastery-subject-row:last-child { border-bottom: none; }
  .mastery-subject-name { font-size: 0.66rem; font-weight: 600; color: #34495e; width: 80px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 2px; }
  .mastery-subject-count { font-size: 0.63rem; color: #7f8c8d; width: 26px; flex-shrink: 0; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; padding-top: 2px; }
  .mastery-chips-area { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; flex: 1; }

  .mastery-chip {
    width: 20px; height: 17px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 3px;
    font-size: 0.60rem; font-weight: bold;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.1s, box-shadow 0.1s;
    position: relative;
  }
  .mastery-chip:hover { transform: scale(1.25); box-shadow: 0 2px 6px rgba(0,0,0,0.18); z-index: 1; }
  .mastery-chip:active { transform: scale(0.92); }

  .chip-unplayed { background: #f1f2f6; color: #bdc3c7; border-color: #e0e0e0; }
  .chip-review { background: #fadbd8; color: #c0392b; border-color: #e6b0aa; }
  .chip-mastered { background: #d4efdf; color: #27ae60; border-color: #a9dfbf; }

  /* 要復習リスト用 */
  .review-list-container { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 12px; 
    margin-top: 15px; 
    padding-top: 15px; 
    border-top: 1px dashed #eee; 
  }
  .review-list-title {
    grid-column: 1 / -1;
    font-size: 0.9rem;
    font-weight: bold;
    color: #c0392b;
    margin-bottom: 5px;
  }
  .review-card { 
    background: #fff; border-left: 5px solid #ccc; 
    padding: 12px; border-radius: 6px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
    cursor: pointer; transition: all 0.2s;
    height: 100%; box-sizing: border-box; display: flex; flex-direction: column; justify-content: space-between;
  }
  .review-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(231, 76, 60, 0.15); background: #fff; }
  .review-header { display: flex; justify-content: space-between; font-size: 0.8rem; color: #7f8c8d; margin-bottom: 5px; }
  .review-body { font-size: 0.75rem; color: #2c3e50; font-weight: normal; line-height: 1.4; margin: 5px 0; }
  .review-footer { margin-top: 5px; font-size: 0.8rem; text-align: right; color: #e74c3c; display: flex; justify-content: space-between; align-items: center; }
  
  .review-subject-badge {
    color: white; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: bold;
  }

  /* 印刷用スタイル */
  @media print {
    body { background: white; padding: 0; margin: 0; color: black; }
    .container { box-shadow: none; border: none; width: 100%; max-width: 100%; padding: 0; margin: 0; min-height: 0; }
    .screen-header, .dashboard-header p, .btn-common, .nav-btn, .section-divider, .teacher-select, #print-btn, #print-btn-wb, #mastery-filters, #mastery-legend { display: none !important; }
    /* 該当件数表示も消す */
    .score-card > div[style*="text-align:right"] { display: none !important; }
    .score-card { border: none; padding: 0; margin: 0; box-shadow: none; }
    .mastery-year-section { break-inside: auto; page-break-inside: auto; border: 1px solid #ccc; margin-bottom: 10px; box-shadow: none; }
    .mastery-year-header { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .mastery-subject-row { border-bottom: 1px solid #eee; }
    .mastery-chip { border: 1px solid #ccc; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .mastery-year-bar { display: none; }
    .review-card { border: 1px solid #ccc; border-left: 5px solid #e74c3c; box-shadow: none; break-inside: avoid; page-break-inside: avoid; }
    .dashboard-header h3 { font-size: 1.2rem; text-align: left; margin: 0 0 10px 0; }
    /* マイ単語帳用 */
    .wb-category-block { break-inside: avoid; page-break-inside: avoid; border: 1px solid #ccc; box-shadow: none; margin-bottom: 10px; }
    .word-chip { border: 1px solid #ccc; -webkit-print-color-adjust: exact; print-color-adjust: exact; display: inline-flex; align-items: center; }
    .print-checkbox { display: inline-block; width: 10px; height: 10px; border: 1px solid #555; background: #fff; margin-right: 6px; border-radius: 2px; }
    .wb-guide-container { display: none; }
  }

  /* マイ単語帳フィルタボタン */
  .filter-btn-container { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 15px; padding: 10px; border: 1px solid #eee; border-radius: 12px; background: #fff; }
  .filter-description { width: 100%; font-size: 0.8rem; color: #95a5a6; margin-bottom: 5px; }
  .filter-btn { padding: 4px 10px; border: 1px solid #f0f0f0; background: #fff; border-radius: 15px; font-size: 0.75rem; cursor: pointer; color: #bdc3c7; transition: all 0.2s; white-space: nowrap; font-weight: bold; }
  .filter-btn-container.all-selected .filter-btn:not(.active) { border-color: #bdc3c7; }
  .filter-btn.has-items { background-color: #eaf2f8; color: #3498db; border-color: #d6eaf8; }
  .filter-btn:hover { background: #f9f9f9; color: #95a5a6; }
  .filter-btn.active { background: #7f8c8d; color: white; border-color: #7f8c8d; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }

  /* マイ単語帳ガイド */
  .wb-guide-container { display: flex; justify-content: center; gap: 15px; margin-bottom: 25px; }
  .wb-guide-box { flex: 1; max-width: 180px; background: #fff; border: 1px solid #eee; border-radius: 12px; padding: 10px; display: flex; align-items: center; gap: 10px; box-shadow: 0 2px 6px rgba(0,0,0,0.03); transition: transform 0.2s; }
  .wb-guide-box:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
  .wb-guide-icon-circle { width: 32px; height: 32px; background: #f0f4f8; color: #3498db; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
  .wb-guide-text { font-size: 0.8rem; font-weight: bold; color: #555; line-height: 1.3; }

  /* トースト通知の小型化 */
  div.swal2-popup.swal2-toast.small-toast {
    padding: 8px 12px !important;
    width: auto !important;
    max-width: 280px !important;
    display: flex !important;
    align-items: center !important;
  }
  div.swal2-popup.swal2-toast.small-toast .swal2-title {
    font-size: 0.85rem !important;
    margin: 0 !important;
  }
  div.swal2-popup.swal2-toast.small-toast .swal2-icon {
    transform: scale(0.6) !important; /* アイコン全体を縮小 */
    margin: 0 5px 0 0 !important;
  }

  /* チームチャット */
  .chat-timeline {
    max-height: 250px;
    overflow-y: auto;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
  }
  .chat-msg { margin-bottom: 8px; }
  .chat-msg-header { font-size: 0.7rem; color: #999; margin-bottom: 2px; margin-left: 4px; }
  .chat-bubble {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
  }
  .chat-msg.me { text-align: right; }
  .chat-msg.me .chat-msg-header { margin-right: 4px; }
  .chat-msg.me .chat-bubble { background: #dbf3fa; border-color: #bce0fd; }
  
  .chat-actions { display: flex; gap: 5px; flex-wrap: wrap; }
  .chat-stamp-btn {
    flex: 1; padding: 8px; font-size: 0.85rem; background: #fff; border: 1px solid #ccc; border-radius: 20px; cursor: pointer; white-space: nowrap; font-weight: bold; color: #555; transition: background 0.2s;
  }
  .chat-stamp-btn:hover { background: #f0f0f0; }
  .chat-stamp-btn:active { transform: translateY(2px); }

  /* 招待通知 */
  .invite-notification {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 10px;
  }
  .invite-notification button { border: none; padding: 5px 12px; border-radius: 4px; cursor: pointer; font-weight: bold; font-size: 0.85rem; color: white; }
  .btn-invite-accept { background: #28a745; }
  .btn-invite-decline { background: #e74c3c; }

  /* システムメッセージ */
  .chat-msg.system { text-align: center; margin: 8px 0; }
  .chat-system-text { font-size: 0.75rem; color: #95a5a6; background: #f0f0f0; padding: 2px 8px; border-radius: 10px; display: inline-block; }

  /* 管理画面レイアウト */
  .admin-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
  }
  .admin-sidebar {
    width: 200px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
    flex-shrink: 0;
  }
  .admin-tab {
    padding: 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-weight: bold;
    color: #7f8c8d;
    transition: background 0.2s;
  }
  .admin-tab:hover { background: #e9ecef; }
  .admin-tab.active { background: #3498db; color: white; }
  .admin-content { flex: 1; min-width: 0; }
  .admin-panel { animation: fadeIn 0.3s; }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

  @media (max-width: 600px) {
    .admin-container { flex-direction: column; }
    .admin-sidebar { width: 100%; display: flex; overflow-x: auto; }
    .admin-tab { flex: 1; text-align: center; white-space: nowrap; padding: 10px; font-size: 0.85rem; }

    /* ご意見掲示板：スマホで2行レイアウト */
    .feedback-summary { flex-wrap: wrap; }
    .feedback-summary-preview { width: 100%; white-space: normal; overflow: visible; text-overflow: unset; flex: none; font-size: 0.82rem; margin-top: 2px; }
    .feedback-expand-icon { margin-left: auto; }
  }

  /* Google検索ボタン */
  .btn-google-search {
    background: #fff;
    color: #5f6368;
    border: 1px solid #dadce0;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: normal;
    margin-top: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s;
    display: inline-flex; align-items: center; gap: 5px;
  }
  .btn-google-search:hover { background: #f8f9fa; box-shadow: 0 2px 5px rgba(0,0,0,0.15); color: #202124; }

  /* サバイバルモードボタン */
  .btn-survival {
    width: 100%;
    padding: 10px;
    font-size: 0.95rem;
    background: #78909c; /* 落ち着いたブルーグレー */
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: background 0.2s;
  }
  .btn-survival:hover { background: #607d8b; }
  .btn-survival:active { transform: translateY(1px); }

  /* サバイバルモード用オーバーレイ */
  #survival-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    animation: fadeIn 0.3s;
  }
  .survival-msg {
    font-size: 3rem;
    font-weight: bold;
    color: #e74c3c;
    text-shadow: 0 0 10px #000;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }
  @keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
  }

  /* AIアドバイス用ス１タイル */
  #ai-advice-content strong {
    color: #e67e22;
    background: linear-gradient(transparent 70%, #ffe0b2 70%);
  }

  /* 類似問題ボタン */
  .btn-similar {
    margin-top: 15px;
    background: #fff;
    border: 2px solid #3498db;
    color: #3498db;
    padding: 10px 16px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 8px;
  }
  .btn-similar:hover { background: #eaf2f8; transform: translateY(-2px); }
  .btn-similar:disabled { border-color: #bdc3c7; color: #bdc3c7; background: #f9f9f9; cursor: default; transform: none; }

  /* AI解説ボタン */
  /* 解説エリア */
  .expl-header { font-size: 0.78rem; font-weight: bold; color: #e67e22; margin-bottom: 6px; display: flex; align-items: center; gap: 4px; }
  .expl-body { font-size: 0.88rem; color: #444; line-height: 1.75; }
  .expl-body p { margin: 0 0 8px; }
  .expl-body ul { margin: 4px 0 8px; padding-left: 18px; }
  .expl-body li { margin-bottom: 3px; }
  .expl-section { font-weight: bold; color: #2c3e50; margin: 10px 0 4px; font-size: 0.9rem; }
  .expl-choice { margin-bottom: 4px; }
  .expl-num { font-weight: bold; color: #7f8c8d; min-width: 18px; display: inline-block; }
  .expl-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; margin: 8px 0; }
  .expl-table th { background: #f1f3f5; padding: 5px 8px; border: 1px solid #ddd; font-weight: bold; text-align: left; }
  .expl-table td { padding: 5px 8px; border: 1px solid #ddd; }
  .expl-keyword { color: #e74c3c; font-weight: bold; background: linear-gradient(transparent 65%, #ffccbc 65%); }

  /* フィードバックエリア */
  .feedback-container {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #eee;
    text-align: right;
    animation: fadeIn 0.5s;
  }
  .btn-feedback {
    background: #fff;
    border: 1px solid #ddd;
    color: #7f8c8d;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    cursor: pointer;
    margin-left: 5px;
    transition: all 0.2s;
  }
  .btn-feedback:hover {
    background: #f9f9f9;
    color: #555;
    border-color: #ccc;
  }
  .btn-feedback.active {
    background: #e3f2fd;
    color: #3498db;
    border-color: #3498db;
  }

  /* バッジ関連 */
  .badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
  }
  .badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 50%;
    font-size: 0.85rem;
    cursor: help;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  }
  .badge-profile-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f9f9f9;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #eee;
    margin-bottom: 5px;
  }
  .badge-profile-icon {
    font-size: 1.5rem;
  }
  .badge-profile-info {
    display: flex;
    flex-direction: column;
  }
  .badge-profile-name {
    font-weight: bold;
    font-size: 0.9rem;
    color: #2c3e50;
  }
  .badge-profile-desc {
    font-size: 0.75rem;
    color: #7f8c8d;
  }

  /* バッジ一覧画面 */
  .badge-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 20px;
    align-items: start;
  }
  .badge-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    box-sizing: border-box;
  }
  .badge-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
  .badge-card.locked {
    background: #f5f5f5;
    opacity: 0.45;
    filter: grayscale(80%);
  }
  .badge-card-icon { font-size: 2rem; margin-bottom: 6px; line-height: 1; }
  .badge-card-label { font-weight: bold; font-size: 0.72rem; color: #2c3e50; margin-bottom: 6px; line-height: 1.3; }
  .badge-status {
    font-size: 0.62rem; font-weight: bold; padding: 2px 6px; border-radius: 8px;
  }
  .status-earned { background: #d4efdf; color: #27ae60; }
  .status-locked { background: #ecf0f1; color: #95a5a6; }

  /* バッジ獲得演出 */
  #badge-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
    animation: fadeIn 0.3s;
  }
  .badge-award-container {
    text-align: center;
    animation: popInBounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    padding: 20px;
  }
  .badge-award-icon {
    font-size: 6rem;
    margin: 15px 0;
    filter: drop-shadow(0 0 20px rgba(255,215,0,0.6));
    animation: iconPulse 2s infinite;
  }
  .badge-award-title {
    color: #f1c40f; font-size: 1.2rem; font-weight: bold; margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 0.1em;
  }
  .badge-award-name {
    color: #fff; font-size: 2rem; font-weight: bold; margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  }
  .badge-award-desc {
    color: #ddd; font-size: 1rem;
  }
  @keyframes popInBounce {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
  }
  @keyframes iconPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
  }

  /* リアクション機能 */
  .reaction-area {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
    justify-content: inherit; /* 親のalignに合わせる */
  }
  .chat-msg.system .reaction-area { justify-content: center; margin-top: 2px; }
  .chat-msg.me .reaction-area { justify-content: flex-end; }
  
  .reaction-chip {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex; align-items: center; gap: 4px;
    user-select: none; transition: all 0.2s; color: #555;
  }
  .reaction-chip:hover { background: #f5f5f5; }
  .reaction-chip.active { background: #e3f2fd; border-color: #90caf9; color: #1976d2; }
  
  .reaction-add-btn {
    background: transparent; border: none; cursor: pointer;
    font-size: 1rem; padding: 0 4px; opacity: 0.4;
    transition: opacity 0.2s, transform 0.1s; line-height: 1;
  }
  .reaction-add-btn:hover { opacity: 1; transform: scale(1.2); }

  /* タイムマネジメントバー */
  #time-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #ecf0f1;
    z-index: 9999;
    display: none;
  }
  #time-bar-fill {
    height: 100%;
    width: 100%;
    background: #27ae60;
    transition: background 0.2s linear;
  }
  @keyframes blink-bar {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
  }
  .time-bar-blink {
    animation: blink-bar 0.8s infinite ease-in-out;
  }

  /* チーム編集ボタン */
  .btn-edit-team {
    font-size: 0.7rem;
    padding: 2px 8px;
    margin-left: 6px;
    background: #fff;
    border: 1px solid #3498db;
    color: #3498db;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
  }
  .btn-edit-team:hover {
    background: #e3f2fd;
  }

  /* 新アプリ紹介バナー */
  .new-app-banner {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.3);
  }
  .new-app-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
  }
  .new-app-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: #f1c40f;
    color: #d35400;
    font-size: 0.6rem;
    font-weight: bold;
    padding: 1px 6px;
    border-bottom-right-radius: 6px;
  }
  .new-app-content { flex: 1; padding-left: 5px; display: flex; flex-direction: column; justify-content: center; }
  .new-app-title { font-size: 0.95rem; font-weight: bold; margin-bottom: 2px; display: flex; align-items: center; gap: 5px; }
  .new-app-desc { font-size: 0.75rem; opacity: 0.9; line-height: 1.2; font-weight: normal; }
  .new-app-arrow { font-size: 1.0rem; font-weight: bold; padding-left: 8px; opacity: 0.8; }
  /* スマホ調整 */
  @media (max-width: 600px) { .new-app-title { font-size: 0.9rem; } .new-app-desc { font-size: 0.7rem; } }

  /* ── お知らせBox ── */
  .inbox-section-title { font-size: 0.85rem; font-weight: bold; color: #7f8c8d; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid #eee; }
  .inbox-empty { color: #bbb; font-size: 0.85rem; padding: 10px 0; }
  .inbox-date { font-size: 0.78rem; color: #bbb; flex-shrink: 0; margin-right: 6px; }

  .inbox-news-item { display: flex; align-items: baseline; gap: 6px; padding: 8px 0; border-bottom: 1px solid #f5f5f5; }
  .inbox-news-text { font-size: 0.9rem; color: #2c3e50; line-height: 1.5; white-space: pre-wrap; }

  .inbox-post-item { background: #fff; border: 1px solid #e4eaf2; border-radius: 8px; padding: 12px 14px; margin-bottom: 8px; }
  .inbox-post-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
  .inbox-post-preview { font-size: 0.88rem; color: #555; line-height: 1.5; }
  .inbox-status { font-size: 0.72rem; font-weight: bold; padding: 2px 7px; border-radius: 10px; }
  .inbox-status.pending { background: #fff3cd; color: #856404; }
  .inbox-status.replied { background: #d1ecf1; color: #0c5460; }
  .inbox-status.visible { background: #d4edda; color: #155724; }

  .inbox-reply-block { margin-top: 10px; padding: 10px 12px; background: #eaf4fd; border-left: 3px solid #3498db; border-radius: 0 6px 6px 0; }
  .inbox-reply-label { font-size: 0.75rem; font-weight: bold; color: #2980b9; margin-bottom: 4px; }
  .inbox-reply-body { font-size: 0.88rem; white-space: pre-wrap; color: #2c3e50; line-height: 1.6; }

  .inbox-comment-list { margin-top: 8px; border-top: 1px solid #eee; padding-top: 6px; }
  .inbox-comment-item { font-size: 0.82rem; color: #555; padding: 4px 0; border-bottom: 1px solid #f5f5f5; }
  .inbox-comment-name { font-weight: bold; color: #555; margin-right: 5px; }

  /* コメント匿名ラジオ */
  .fc-anon-row { display: flex; gap: 12px; margin-bottom: 6px; }
