/* =============================================
   新サービス観測ボード — style.css
   ============================================= */

/* --- CSS Variables --- */
:root {
  --bg-base: #F6F4EF;
  --bg-sidebar: #F1EEE7;
  --bg-elevated: #FBFAF7;
  --bg-white: #ffffff;

  --text-primary: #1E1C18;
  --text-secondary: #3a362f;
  --text-weak: #6f6a60;
  --text-meta: #97928a;
  --text-faintest: #c2bcb0;

  --border-normal: #E5E0D3;
  --border-strong: #d5cebe;

  --accent: #4a6b8a;
  --accent-light: #e8eef4;
  --accent-hover: #3a5a79;

  --font-base: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --font-mono: 'Courier New', Courier, monospace;

  --sidebar-width: 220px;
  --content-max: min(1120px, calc(100vw - var(--sidebar-width) - 80px));
  --radius: 4px;
  --radius-sm: 3px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-base);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

/* =============================================
   Layout
   ============================================= */

.layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-normal);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border-normal);
}

.sidebar-brand h1 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.4;
  letter-spacing: 0.02em;
}

/* --- Sidebar Nav --- */
.sidebar-nav {
  padding: 12px 0;
  flex: 1;
}

.sidebar-nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-faintest);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 16px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 16px;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.1s;
  font-size: 13px;
  color: var(--text-weak);
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: rgba(0,0,0,0.04);
  color: var(--text-secondary);
}

.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 500;
}

.nav-item-label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.nav-item.active .nav-dot {
  opacity: 1;
}

.nav-count {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-meta);
  background: rgba(0,0,0,0.05);
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}

.nav-item.active .nav-count {
  background: var(--accent-light);
  color: var(--accent);
}

/* --- メンバー別フィルタ --- */
.nav-item-member {
  padding-left: 30px;
  font-size: 12px;
}

.nav-dot-member {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--mc, var(--text-meta));
  opacity: 0.5;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.nav-item-member:hover .nav-dot-member {
  opacity: 0.8;
}

.nav-item-member.active {
  color: var(--mc, var(--accent));
  background: var(--accent-light);
  font-weight: 500;
}

.nav-item-member.active .nav-dot-member {
  opacity: 1;
  background: var(--mc, var(--accent));
}

@media (max-width: 820px) {
  .nav-item-member {
    padding-left: 12px;
    font-size: 11.5px;
  }
}

/* --- Sidebar Utilities --- */
.sidebar-utils {
  padding: 8px 0 4px;
  border-top: 1px solid var(--border-normal);
}

.util-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  font-size: 12px;
  color: var(--text-weak);
  cursor: pointer;
  transition: color 0.1s, background 0.1s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.util-item:hover {
  color: var(--text-secondary);
  background: rgba(0,0,0,0.03);
}

.util-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.6;
}

/* Spinner for fetch */
.fetch-spinner {
  display: none;
  width: 10px;
  height: 10px;
  border: 2px solid var(--border-normal);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.fetching .fetch-spinner {
  display: inline-block;
}

.fetching .util-icon {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Sidebar Footer --- */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-normal);
}

.sidebar-meta {
  font-size: 10px;
  color: var(--text-faintest);
  line-height: 1.8;
  font-family: var(--font-mono);
}

/* =============================================
   Main
   ============================================= */

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.main-inner {
  width: 100%;
  max-width: var(--content-max);
  padding: 32px 40px 80px;
}

/* --- Direct-child layout (ai_candidates / member_interest_diagnosis 等 .main-inner なし) --- */
.main > .main-header {
  padding: 32px 40px 14px;
  max-width: var(--content-max);
  width: 100%;
}

.main > .main-content {
  padding: 0 40px 80px;
  max-width: var(--content-max);
  width: 100%;
}

/* --- Main Header --- */
.main-header {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-normal);
}

.main-header-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.main-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.main-count {
  font-size: 12px;
  color: var(--text-meta);
  font-family: var(--font-mono);
}

.main-subtitle {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* =============================================
   Article List
   ============================================= */

.article-list {
  display: flex;
  flex-direction: column;
}

/* --- Article Row --- */
.article-row {
  padding: 24px 0;
  border-bottom: 1px solid var(--border-normal);
  position: relative;
}

.article-row:first-child {
  border-top: none;
}

.article-row.is-read .article-title {
  font-weight: 400;
  color: var(--text-weak);
}

.article-row.is-read .article-desc {
  color: var(--text-faintest);
}

.article-row.is-hidden {
  opacity: 0.55;
}

/* --- Article Meta --- */
.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

.article-row.is-read .unread-dot,
.article-row.is-hidden .unread-dot {
  background: transparent;
}

.article-date {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-meta);
  letter-spacing: 0.02em;
}

.article-source {
  font-size: 11px;
  color: var(--text-meta);
}

.article-source::before {
  content: '·';
  margin-right: 6px;
  color: var(--border-strong);
}

.hidden-badge {
  display: none;
  font-size: 10px;
  color: var(--text-meta);
  background: var(--border-normal);
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 2px;
}

.article-row.is-hidden .hidden-badge {
  display: inline-block;
}

/* --- Article Body --- */
.article-body {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.article-content {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* --- Title --- */
.article-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.55;
  margin-bottom: 8px;
  display: block;
  cursor: pointer;
  transition: color 0.12s;
}

.article-title:hover {
  color: var(--accent);
}

/* --- Desc --- */
.article-desc {
  font-size: 13.5px;
  color: var(--text-weak);
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Thumbnail --- */
.article-thumb {
  width: 200px;
  height: 150px;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border-normal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-no-img {
  font-size: 11px;
  color: var(--text-weak);
  opacity: 0.5;
  user-select: none;
}

.article-thumb svg {
  width: 28px;
  height: 28px;
  opacity: 0.3;
}

/* --- Article Actions --- */
.article-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
}

.btn-memo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-meta);
  padding: 6px 14px;
  min-height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-normal);
  background: var(--bg-sidebar);
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  font-family: inherit;
}

.btn-memo:hover {
  background: var(--bg-sidebar);
  color: var(--text-secondary);
  border-color: var(--border-normal);
}

.btn-memo.has-memo {
  color: var(--accent);
}

.btn-memo svg {
  width: 12px;
  height: 12px;
  opacity: 0.7;
}

.btn-menu {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--text-meta);
  font-size: 15px;
  letter-spacing: 1px;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
  flex-shrink: 0;
}

.btn-menu:hover {
  background: var(--bg-sidebar);
  border-color: var(--border-normal);
  color: var(--text-secondary);
}

/* =============================================
   Dropdown Menu
   ============================================= */

.dropdown-wrap {
  position: relative;
  display: inline-block;
  margin-left: auto;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  min-width: 160px;
  z-index: 100;
  display: none;
  overflow: hidden;
}

.dropdown-menu.is-open {
  display: block;
}

.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s;
}

.dropdown-item:hover {
  background: var(--bg-sidebar);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-normal);
  margin: 3px 0;
}

/* =============================================
   Memo Block
   ============================================= */

.memo-block {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-normal);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}

.memo-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
}

.memo-date {
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--text-faintest);
  font-family: var(--font-mono);
}

/* --- Memo Editor --- */
.memo-editor {
  margin-top: 10px;
  display: none;
}

.memo-editor.is-open {
  display: block;
}

.memo-textarea {
  width: 100%;
  padding: 9px 11px;
  font-size: 12.5px;
  font-family: var(--font-base);
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  resize: vertical;
  min-height: 72px;
  line-height: 1.6;
  outline: none;
  transition: border-color 0.15s;
}

.memo-textarea:focus {
  border-color: var(--accent);
}

.memo-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 7px;
  justify-content: flex-end;
}

.btn-cancel {
  padding: 5px 12px;
  font-size: 12px;
  color: var(--text-weak);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s;
}

.btn-cancel:hover {
  background: var(--bg-sidebar);
}

.btn-save {
  padding: 5px 12px;
  font-size: 12px;
  color: var(--bg-elevated);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: background 0.1s;
}

.btn-save:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* =============================================
   Empty State
   ============================================= */

.empty-state {
  padding: 48px 0 24px;
  text-align: center;
  color: var(--text-meta);
}

.empty-icon {
  font-size: 32px;
  margin-bottom: 14px;
  opacity: 0.4;
}

.empty-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-weak);
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 12.5px;
  color: var(--text-meta);
  line-height: 1.7;
}

/* =============================================
   Toast
   ============================================= */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--text-primary);
  color: var(--bg-base);
  font-size: 12.5px;
  padding: 9px 20px;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
  white-space: nowrap;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =============================================
   Responsive  (≤ 820px)
   ============================================= */

@media (max-width: 820px) {
  body {
    flex-direction: column;
  }

  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--border-normal);
    overflow: visible;
  }

  .sidebar-brand {
    width: 100%;
    padding: 12px 16px 10px;
  }

  .sidebar-nav {
    padding: 4px 0 8px;
    width: 100%;
  }

  .sidebar-nav-label {
    display: none;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 4px 12px 8px;
  }

  .nav-item {
    padding: 5px 12px;
    border-radius: var(--radius);
    width: auto;
  }

  .sidebar-utils {
    border-top: none;
    border-left: 1px solid var(--border-normal);
    padding: 4px 0 8px;
    display: flex;
    align-items: center;
  }

  .sidebar-footer {
    border-top: 1px solid var(--border-normal);
    width: 100%;
    padding: 8px 16px;
  }

  .main-inner {
    max-width: 100%;
    width: 100%;
    padding: 20px 20px 60px;
  }

  .main > .main-header {
    padding: 20px 20px 14px;
  }

  .main > .main-content {
    padding: 0 20px 60px;
  }
}

/* =============================================
   スマホ専用 記事カードレイアウト (≤ 600px)
   ============================================= */

@media (max-width: 600px) {
  .article-body {
    flex-direction: column;
  }

  .article-thumb {
    width: 100%;
    max-width: 100%;
    height: 200px;
  }
}

/* =============================================
   スマホ記事閲覧の調整 (≤ 820px)
   ============================================= */

@media (max-width: 820px) {
  /* --- サイドバー: ブランド名・フッターを非表示にしてコンパクト化 --- */
  .sidebar-brand {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }

  /* utils（RSS管理・除外KW等）: フィルタ行の下に合流、控えめなサイズ */
  .sidebar-utils {
    border-left: none;
    border-top: 1px solid var(--border-normal);
    width: 100%;
    flex-wrap: wrap;
    padding: 4px 10px 6px;
  }

  .util-item {
    font-size: 11px;
    padding: 5px 8px;
    width: auto;
    gap: 4px;
  }

  .util-icon {
    width: 11px;
    height: 11px;
  }

  /* --- main-inner: 左右余白を少し詰める --- */
  .main-inner {
    max-width: 100%;
    width: 100%;
    padding: 16px 16px 60px;
  }

  .main > .main-header {
    padding: 16px 16px 14px;
  }

  .main > .main-content {
    padding: 0 16px 60px;
  }

  /* --- 記事行: 上下余白を広げてゆったりした閲覧感に --- */
  .article-row {
    padding: 28px 0;
  }

  /* --- 概要: 4行まで表示 --- */
  .article-desc {
    -webkit-line-clamp: 4;
  }

  /* --- action row: 縦余白を少し広く --- */
  .article-actions {
    margin-top: 12px;
    gap: 4px;
  }

  /* --- メモボタン: 44px タップ領域 --- */
  .btn-memo {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 12.5px;
  }

  /* --- …メニューボタン: 44px タップ領域 --- */
  .btn-menu {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  /* --- ドロップダウン: 画面端からのはみ出し防止 --- */
  .dropdown-menu {
    max-width: calc(100vw - 32px);
  }

  /* ドロップダウン項目: タップしやすい高さ */
  .dropdown-item {
    padding: 11px 14px;
    font-size: 13px;
  }

  /* --- メモテキストエリア: 16pxでiOS自動ズーム防止、高さも確保 --- */
  .memo-textarea {
    min-height: 100px;
    font-size: 16px;
  }

  /* --- 保存/キャンセルボタン: 押しやすく --- */
  .btn-save,
  .btn-cancel {
    min-height: 40px;
    padding: 8px 18px;
    font-size: 13px;
  }

  .memo-editor-actions {
    gap: 10px;
    margin-top: 10px;
  }

  /* 診断 — スマホ対応 */
  .diag-q-block {
    padding: 16px 16px;
  }

  .diag-q-list {
    gap: 12px;
  }

  .diag-score-num {
    width: 44px;
    height: 44px;
    font-size: 15px;
    border-radius: 6px;
  }

  .diag-score-text {
    font-size: 9px;
    max-width: 44px;
  }

  .diag-options {
    gap: 7px;
  }

  .diag-actions {
    margin-top: 24px;
    padding-top: 16px;
  }

  .diag-cat-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }

}

/* =============================================
   Sidebar util-item active state (sources.html)
   ============================================= */

.util-item.active {
  color: var(--accent);
  font-weight: 500;
}

/* =============================================
   RSS Management — sources.html
   ============================================= */

/* Header */
.rss-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.rss-subtitle {
  font-size: 12.5px;
  color: var(--text-meta);
  margin-top: 5px;
}

.btn-add-rss {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
  transition: background 0.1s;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.btn-add-rss:hover {
  background: #d8e6f0;
}

/* Add Form */
.rss-form-wrap {
  display: none;
  margin-bottom: 20px;
}

.rss-form-wrap.is-open {
  display: block;
}

.rss-form,
.rss-edit-form {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.rss-form-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.rss-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.rss-form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.rss-field-label {
  font-size: 11.5px;
  color: var(--text-weak);
  font-weight: 500;
}

.rss-field-input {
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s;
}

.rss-field-input:focus {
  border-color: var(--accent);
}

.rss-form-check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  padding-top: 18px;
}

.rss-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}

/* RSS List */
.rss-list {
  display: flex;
  flex-direction: column;
}

.rss-row {
  padding: 18px 0;
  border-bottom: 1px solid var(--border-normal);
  position: relative;
}

.rss-row:first-child {
  border-top: none;
}

.rss-row.is-disabled {
  opacity: 0.6;
}

.rss-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.rss-info {
  flex: 1;
  min-width: 0;
}

.rss-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.rss-url {
  font-size: 11.5px;
  color: var(--text-meta);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rss-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.rss-status {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.rss-status.active {
  color: var(--accent);
  background: var(--accent-light);
}

.rss-status.inactive {
  color: var(--text-meta);
  background: var(--border-normal);
}

.rss-meta-item {
  font-size: 11px;
  color: var(--text-meta);
  font-family: var(--font-mono);
}

.rss-meta-label {
  color: var(--text-faintest);
  margin-right: 4px;
}

/* Actions */
.rss-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.btn-rss-action {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-weak);
  background: none;
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}

.btn-rss-action:hover {
  background: var(--bg-sidebar);
  color: var(--text-secondary);
}

.btn-rss-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Edit Form (inline) */
.rss-edit-wrap {
  display: none;
  margin-top: 14px;
}

.rss-edit-wrap.is-open {
  display: block;
}

/* Delete Confirm */
.rss-confirm-wrap {
  display: none;
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius);
}

.rss-confirm-wrap.is-open {
  display: block;
}

.rss-confirm-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.rss-confirm-actions {
  display: flex;
  gap: 8px;
}

.btn-delete-confirm {
  padding: 5px 12px;
  font-size: 12px;
  font-family: inherit;
  color: #fff;
  background: #a03838;
  border: 1px solid #a03838;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  transition: background 0.1s;
}

.btn-delete-confirm:hover {
  background: #8a2e2e;
  border-color: #8a2e2e;
}

.rss-delete-item {
  color: #a03838;
}

.rss-delete-item:hover {
  background: #fdf0f0;
  color: #8a2e2e;
}

/* Empty State */
.rss-empty {
  padding: 56px 0 32px;
  text-align: center;
}

.rss-empty-icon {
  font-size: 30px;
  opacity: 0.35;
  margin-bottom: 14px;
}

.rss-empty-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-weak);
  margin-bottom: 8px;
}

.rss-empty-desc {
  font-size: 12.5px;
  color: var(--text-meta);
  line-height: 1.7;
  margin-bottom: 20px;
}

/* Responsive for sources.html */
@media (max-width: 820px) {
  .rss-header-row {
    flex-direction: column;
    gap: 10px;
  }

  .rss-form-grid {
    grid-template-columns: 1fr;
  }

  .rss-form-check {
    padding-top: 0;
  }

  .rss-row-top {
    flex-direction: column;
    gap: 10px;
  }

  .rss-actions {
    flex-wrap: wrap;
  }
}

/* =============================================
   PHP版追加スタイル
   ============================================= */

/* フォームをdropdown-itemと同じ幅にする */
.dropdown-form {
  display: block;
  margin: 0;
  padding: 0;
}

.dropdown-form > button {
  width: 100%;
}

/* メモエディタはPHP版ではstyle属性で開閉する */
.memo-editor {
  display: none;
}

/* =============================================
   除外キーワード管理
   ============================================= */

.kw-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
}

.kw-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.kw-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.kw-subtitle {
  font-size: 12px;
  color: var(--text-meta);
  margin-top: 4px;
}

/* Add bar (always visible on exclude_keywords.php) */
.kw-add-bar {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.kw-add-inline,
.kw-edit-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.kw-input {
  width: 240px;
  flex-shrink: 0;
}

/* Keyword list */
.kw-list {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
}

.kw-row {
  border-bottom: 1px solid var(--border-light);
}

.kw-row:last-child {
  border-bottom: none;
}

.kw-row.is-disabled .kw-word {
  color: var(--text-meta);
  text-decoration: line-through;
}

.kw-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card);
}

.kw-word {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
}

.kw-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.kw-badge.active {
  background: #e6f3ec;
  color: #2e7d4f;
}

.kw-badge.inactive {
  background: var(--bg-elevated);
  color: var(--text-meta);
}

.kw-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.kw-delete-btn {
  color: var(--text-meta);
}

.kw-delete-btn:hover {
  color: #c0392b;
  background: #fdf2f2;
}

/* Edit form inside kw-row */
.kw-edit-wrap {
  display: none;
  padding: 10px 14px 12px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-light);
}

.kw-edit-wrap.is-open {
  display: block;
}

.kw-empty {
  font-size: 13px;
  color: var(--text-meta);
  padding: 16px 0;
}

/* =============================================
   メンバー識別 / 気になる (STEP 5)
   ============================================= */

/* --- メンバーバー --- */
.member-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 12px;
  font-size: 12px;
  color: var(--text-meta);
  border-bottom: 1px solid var(--border-normal);
  margin-bottom: 16px;
}

.member-current {
  color: var(--text-meta);
}

.member-name {
  color: var(--text-secondary);
  font-weight: 500;
}

.member-no-select {
  color: var(--text-weak);
}

.member-change-btn {
  font-size: 11.5px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.member-change-btn:hover {
  background: var(--accent-light);
  text-decoration: none;
}

/* --- メンバー選択 --- */
.member-select-wrap {
  display: none;
  margin-bottom: 20px;
}

.member-select-wrap.is-open {
  display: block;
}

.member-select-inner {
  background: var(--bg-elevated);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.member-select-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.member-select-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.member-select-btn {
  padding: 6px 18px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}

.member-select-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.member-select-btn.is-current {
  background: var(--bg-elevated);
  border-color: var(--mc, var(--accent));
  color: var(--mc, var(--accent));
  font-weight: 500;
}

.member-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mc, var(--text-meta));
  flex-shrink: 0;
  margin-right: 5px;
  vertical-align: middle;
}

.member-select-clear {
  font-size: 12px;
  color: var(--text-meta);
  margin-left: 4px;
}

/* --- 気になるボタン --- */
.btn-interest {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--text-meta);
  padding: 6px 14px;
  min-height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-normal);
  background: var(--bg-sidebar);
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  font-family: inherit;
}

.btn-interest:hover {
  background: var(--bg-sidebar);
  border-color: var(--border-normal);
  color: var(--text-secondary);
}

.btn-interest.is-marked {
  color: var(--mc, var(--accent));
  background: var(--accent-light);
  border-color: var(--mc, var(--accent));
}

.btn-interest.is-marked:hover {
  opacity: 0.8;
}

.btn-interest:disabled {
  opacity: 0.35;
  cursor: default;
}

.interest-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.btn-interest.is-marked .interest-icon path {
  fill: var(--mc, currentColor);
}

.interest-count {
  font-size: 10.5px;
  font-family: var(--font-mono);
  background: rgba(0,0,0,0.06);
  padding: 1px 5px;
  border-radius: 10px;
  margin-left: 1px;
}

.btn-interest.is-marked .interest-count {
  background: rgba(74,107,138,0.15);
}

/* --- 興味ない ボタン --- */
.btn-not-interest {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--text-meta);
  padding: 6px 12px;
  min-height: 32px;
  margin-left: auto;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  font-family: inherit;
}

.btn-not-interest:hover {
  background: var(--bg-sidebar);
  border-color: var(--border-normal);
  color: var(--text-secondary);
}

.btn-not-interest:disabled {
  opacity: 0.35;
  cursor: default;
}

.not-interest-icon {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

/* フェードアウト */
.article-row.is-fading-out {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* 誰が気になるを付けたか（PC） */
.interest-who {
  font-size: 11px;
  align-self: center;
}

.who-sep {
  color: var(--text-faintest);
}

/* =============================================
   メンバー管理 (sources.php)
   ============================================= */

.member-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-normal);
}

.member-section-header {
  margin-bottom: 16px;
}

.member-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.member-section-subtitle {
  font-size: 12.5px;
  color: var(--text-meta);
}

.member-mgr-list {
  display: flex;
  flex-direction: column;
}

.member-mgr-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-normal);
}

.member-mgr-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.member-mgr-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.member-color-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.member-color-input {
  width: 40px;
  height: 28px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 2px;
  cursor: pointer;
  background: none;
}

/* --- スマホ: 気になるボタンのタップ領域拡大 --- */
@media (max-width: 820px) {
  .btn-interest {
    min-height: 44px;
    padding: 10px 10px;
  }

  .interest-who {
    display: none; /* スマホでは件数のみ */
  }

  .member-bar {
    padding: 6px 0 10px;
    flex-wrap: wrap;
  }

  .member-select-btn {
    padding: 8px 16px;
    font-size: 14px;
    min-height: 44px;
  }
}

/* =============================================
   AI結果表示ブロック
   ============================================= */
.ai-block {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f7f8fa;
  border-left: 3px solid #b0b8c8;
  border-radius: 0 4px 4px 0;
  font-size: 13px;
  color: var(--text-main);
}

.ai-block + .memo-editor {
  margin-top: 4px;
}

.ai-section {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.ai-section + .ai-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e0e4ea;
}

.ai-label {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: #7a8a9e;
  letter-spacing: 0.03em;
  padding-top: 2px;
  min-width: 52px;
}

.ai-summary {
  line-height: 1.65;
  color: var(--text-primary);
}

.ai-idea-list {
  margin: 0;
  padding: 0 0 0 16px;
  line-height: 1.65;
  color: var(--text-primary);
}

.ai-idea-list li + li {
  margin-top: 4px;
}

.ai-block-pending {
  background: #f5f5f5;
  border-left-color: #c8c8c8;
}

.ai-block-error {
  background: #fff5f5;
  border-left-color: #e08080;
}

.ai-status-label {
  font-size: 12px;
  color: #999;
}

.ai-block-error .ai-status-label {
  color: #c0605a;
}

.ai-relevance-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.ai-relevance-badge.ai-relevance-high  { background: #e6f4ea; color: #2d7a3a; }
.ai-relevance-badge.ai-relevance-mid   { background: #fff3e0; color: #c07700; }
.ai-relevance-badge.ai-relevance-low   { background: #f0f0f0; color: #757575; }
.ai-relevance-badge.ai-relevance-watch { background: #e3f2fd; color: #1565c0; }

.ai-block.ai-block-high  { border-left-color: #4caf50; }
.ai-block.ai-block-mid   { border-left-color: #f9a825; }
.ai-block.ai-block-low   { border-left-color: #bdbdbd; }
.ai-block.ai-block-watch { border-left-color: #42a5f5; }

.ai-summary-structured {
  margin: 0;
  padding: 0;
}

.ai-summary-row {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.ai-summary-row + .ai-summary-row {
  margin-top: 3px;
}

.ai-summary-lbl {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: #9aa5b4;
  white-space: nowrap;
  min-width: 72px;
}

.ai-summary-val {
  margin: 0;
  line-height: 1.6;
  color: var(--text-primary);
  word-break: break-word;
}

/* AI block 3段構成 */
.ai-judge {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.ai-rss-notice {
  font-size: 11px;
  color: #9a6700;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 4px;
  padding: 2px 8px;
  line-height: 1.4;
}

.ai-summary-block {
  padding-top: 8px;
  border-top: 1px solid #e4e8ee;
}

.ai-memo-block {
  padding-top: 8px;
  border-top: 1px solid #e4e8ee;
  margin-top: 8px;
}

.ai-memo-head {
  font-size: 10.5px;
  font-weight: 700;
  color: #7a8a9e;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.ai-memo-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-memo-item {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  padding: 5px 10px;
  background: #eef0f4;
  border-radius: 3px;
}

.ai-recommend-block {
  padding-top: 8px;
  border-top: 1px solid #e4e8ee;
  margin-top: 8px;
}

.ai-recommend-head {
  font-size: 10.5px;
  font-weight: 700;
  color: #7a8a9e;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.ai-recommend-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-recommend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12.5px;
  line-height: 1.6;
}

.ai-recommend-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 10px;
  border: 1px solid;
  white-space: nowrap;
}

.ai-recommend-reason {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===== profile_settings.php ===== */
.ps-notice {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 20px;
}

.ps-notice-ok {
  background: #eaf6ee;
  color: #1e7e34;
  border: 1px solid #c3e6cb;
}

.ps-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px 24px;
  margin-bottom: 20px;
}

.ps-section-head {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.ps-section-note {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.ps-field {
  margin-bottom: 14px;
}

.ps-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.ps-fallback-note {
  font-size: 11px;
  color: var(--text-tertiary, #aaa);
  font-weight: 400;
  margin-left: 6px;
}

.ps-input {
  width: 100%;
  padding: 7px 10px;
  font-size: 13.5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-main);
  color: var(--text-primary);
  font-family: inherit;
  box-sizing: border-box;
}

.ps-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb, 99,102,241), 0.12);
}

.ps-textarea {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-main);
  color: var(--text-primary);
  font-family: inherit;
  resize: vertical;
  line-height: 1.7;
  box-sizing: border-box;
}

.ps-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb, 99,102,241), 0.12);
}

.ps-actions {
  margin-top: 16px;
  text-align: right;
}

/* Profile settings — landing page cards */
.ps-landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.ps-target-card {
  display: block;
  padding: 14px 16px;
  background: var(--bg-white);
  border: 1px solid var(--border-normal);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ps-target-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(74,107,138,0.12);
}

.ps-target-card small {
  display: block;
  font-size: 11px;
  color: var(--text-meta);
  font-weight: 400;
  margin-top: 4px;
}

/* Breadcrumb back link */
.ps-breadcrumb {
  margin-bottom: 20px;
}

.ps-breadcrumb a {
  font-size: 12px;
  color: var(--text-weak);
  text-decoration: none;
}

.ps-breadcrumb a:hover {
  color: var(--accent);
}

/* Sidebar utils section label */
.sidebar-utils-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-faintest);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 16px 4px;
}

/* AI Candidate Confirmation (ai_candidates.php) */
.ac-info {
  font-size: 12px;
  color: var(--text-meta);
  background: var(--bg-base);
  border: 1px solid var(--border-normal);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 16px;
  line-height: 1.6;
}
.ac-list { margin-top: 4px; }
.ac-row {
  display: grid;
  grid-template-columns: 24px 1fr 90px 66px;
  gap: 6px 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-normal);
  align-items: start;
}
.ac-row.ac-skip { opacity: 0.45; }
.ac-rank { color: var(--text-faintest); font-size: 11px; text-align: right; padding-top: 2px; }
.ac-title-link { font-size: 13px; font-weight: 500; color: var(--text-primary); text-decoration: none; display: block; line-height: 1.4; }
.ac-title-link:hover { color: var(--accent); }
.ac-row-meta { font-size: 11px; color: var(--text-meta); margin-top: 3px; }
.ac-skip-note { font-size: 10px; color: #c0392b; margin-top: 2px; }
.ac-score-num { font-size: 13px; font-weight: 600; color: var(--accent); }
.ac-score-parts { font-size: 10px; color: var(--text-meta); margin-top: 3px; line-height: 1.7; }
.ac-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--bg-base);
  color: var(--text-weak);
  white-space: nowrap;
}
.ac-badge-error   { background: #fdf0f0; color: #c0392b; }
.ac-badge-done    { background: #eafaf1; color: #1e8449; }
.ac-badge-fetched { background: #eaf2fb; color: #2471a3; }
.ac-badge-extract { background: #fef9e7; color: #b7770d; }

/* ── member_interest_diagnosis.php ── */
.diag-info {
  font-size: 12px; color: var(--text-meta);
  background: var(--bg-base); border: 1px solid var(--border-normal);
  border-radius: 6px; padding: 10px 14px; margin-bottom: 16px; line-height: 1.6;
}
.diag-warning {
  font-size: 12px; color: #7d4a00;
  background: #fef9e7; border: 1px solid #f0c040;
  border-radius: 6px; padding: 10px 14px; margin-bottom: 16px; line-height: 1.6;
}
.diag-error {
  font-size: 12px; color: #c0392b;
  background: #fdf0f0; border: 1px solid #f1948a;
  border-radius: 6px; padding: 10px 14px; margin-bottom: 12px;
}
.diag-success {
  font-size: 12px; color: #1e8449;
  background: #eafaf1; border: 1px solid #a9dfbf;
  border-radius: 6px; padding: 10px 14px; margin-bottom: 12px;
}
.diag-progress { font-size: 12px; color: var(--text-meta); margin-bottom: 4px; }
.diag-bar-wrap { height: 6px; background: var(--bg-base); border-radius: 3px; margin-bottom: 16px; overflow: hidden; }
.diag-bar { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s; }
.diag-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px; margin-top: 16px;
}
.diag-cat-card {
  display: block; padding: 18px 20px;
  background: var(--bg-white); border: 1.5px solid var(--border-normal);
  border-radius: 8px; text-decoration: none; color: var(--text-primary);
  font-size: 13px; font-weight: 500;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.diag-cat-card:hover { border-color: var(--accent); box-shadow: 0 2px 6px rgba(74,107,138,0.12); }
.diag-cat-card.completed { border-color: #27ae60; }
.diag-cat-card small {
  display: block; font-size: 11px; color: var(--text-meta);
  font-weight: 400; margin-top: 6px;
}
.diag-cat-card.completed small { color: #27ae60; }
.diag-member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px; margin-top: 12px;
}
.diag-member-card {
  display: block; padding: 16px; text-align: center;
  background: var(--bg-white); border: 1.5px solid var(--border-normal);
  border-radius: 8px; text-decoration: none; color: var(--text-primary);
  font-size: 14px; font-weight: 600;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.diag-member-card:hover { border-color: var(--accent); box-shadow: 0 2px 6px rgba(74,107,138,0.12); }
.diag-member-card small {
  display: block; font-size: 11px; color: var(--text-meta);
  font-weight: 400; margin-top: 4px;
}
/* 設問リスト — 設問間の縦余白 */
.diag-q-list { display: flex; flex-direction: column; gap: 16px; }

/* 設問ブロック — カード化 */
.diag-q-block {
  padding: 20px 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-normal);
  border-radius: 8px;
}
.diag-q-block:last-child { border-bottom: none; }

/* 質問テキスト */
.diag-q-text { font-size: 13.5px; color: var(--text-primary); line-height: 1.65; margin-bottom: 14px; }

/* 回答ボタン群 */
.diag-options { display: flex; gap: 10px; flex-wrap: wrap; }

/* ラベル全体 */
.diag-score-label {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; cursor: pointer; user-select: none;
}
.diag-score-label input[type="radio"] {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}

/* 数字ボタン */
.diag-score-num {
  display: flex; align-items: center; justify-content: center;
  width: 50px; height: 50px; border-radius: 7px;
  border: 1.5px solid var(--border-normal); background: var(--bg-white);
  font-size: 16px; font-weight: 600; color: var(--text-secondary);
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.diag-score-label:hover .diag-score-num { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* スコアラベルテキスト */
.diag-score-text { font-size: 10px; color: var(--text-faintest); text-align: center; line-height: 1.3; max-width: 50px; }

/* 選択中 */
.diag-score-label:has(input:checked) .diag-score-num {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 2px 6px rgba(74,107,138,0.3);
}
.diag-score-label:has(input:checked) .diag-score-text { color: var(--accent); font-weight: 600; }

/* 保存・アクション領域 */
.diag-actions {
  margin-top: 32px; padding-top: 20px; padding-bottom: 8px;
  border-top: 1px solid var(--border-normal);
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.diag-back { font-size: 12.5px; color: var(--text-weak); text-decoration: none; padding: 6px 0; }
.diag-back:hover { color: var(--accent); }
.diag-cat-nav {
  font-size: 12px; color: var(--text-meta); margin-bottom: 6px;
}

/* ── Preview mode (view=preview) ── */
.diag-result-btn {
  display: inline-block; margin-top: 16px; padding: 7px 16px;
  border-radius: 6px; background: var(--bg-white);
  border: 1.5px solid var(--accent); color: var(--accent);
  font-size: 13px; font-weight: 500; text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.diag-result-btn:hover { background: var(--accent); color: #fff; }
.diag-section { margin-bottom: 24px; }
.diag-section-title {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  padding-bottom: 6px; border-bottom: 2px solid var(--accent);
  margin-bottom: 12px;
}
.diag-tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.diag-tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 500;
  border: 1px solid var(--border-normal);
  color: var(--text-secondary); background: var(--bg-base);
}
.diag-tag-num { font-size: 10px; opacity: 0.7; }
.diag-tag.high { background: #eaf2fb; border-color: #2471a3; color: #1a5276; }
.diag-tag.low  { background: #fdf0f0; border-color: #c0392b; color: #922b21; }
.diag-tag.cat5 { background: #fef9e7; border-color: #d4ac0d; color: #7d6608; }
.diag-tendency-list { margin: 0; padding: 0; list-style: none; }
.diag-tendency-item {
  font-size: 12px; color: var(--text-secondary); line-height: 1.5;
  padding: 5px 0; border-bottom: 1px solid var(--border-normal);
}
.diag-tendency-item:last-child { border-bottom: none; }
.diag-tendency-empty { font-size: 12px; color: var(--text-faintest); }
.diag-preview-note {
  font-size: 12px; color: var(--text-meta); background: var(--bg-base);
  border-radius: 6px; padding: 10px 14px; border: 1px solid var(--border-normal);
  margin-top: 24px; line-height: 1.6;
}
.diag-partial-note { font-size: 11px; color: var(--text-faintest); margin-top: 6px; }
.diag-gen-preview { margin-top: 4px; border: 1px solid var(--border-normal); border-radius: 6px; overflow: hidden; }
.diag-gen-field {
  display: grid; grid-template-columns: 130px 1fr;
  gap: 0; border-bottom: 1px solid var(--border-normal);
  align-items: baseline;
}
.diag-gen-field:last-child { border-bottom: none; }
.diag-gen-label {
  font-size: 11px; font-weight: 600; color: var(--text-meta);
  background: var(--bg-base); padding: 8px 10px;
  border-right: 1px solid var(--border-normal); line-height: 1.5;
}
.diag-gen-value {
  font-size: 12px; color: var(--text-primary); padding: 8px 10px;
  line-height: 1.6; white-space: pre-line;
}
.diag-gen-empty { font-size: 11px; color: var(--text-faintest); padding: 8px 10px; }
.diag-apply-section { margin-top: 20px; }
.diag-apply-warning {
  font-size: 12px; color: #7d4a00;
  background: #fef9e7; border: 1px solid #f0c040;
  border-radius: 6px; padding: 10px 14px; margin-bottom: 12px; line-height: 1.6;
}
.diag-apply-insuf {
  font-size: 12px; color: var(--text-meta);
  background: var(--bg-base); border: 1px solid var(--border-normal);
  border-radius: 6px; padding: 10px 14px; margin-bottom: 12px;
}
.diag-apply-ok { font-size: 12px; color: #1e8449; margin-bottom: 8px; }

/* ── 汎用ボタン（診断保存ボタン等） ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 22px; font-size: 13px; font-family: inherit;
  border-radius: var(--radius); cursor: pointer; font-weight: 500;
  border: 1.5px solid transparent;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ── manual_update.php ── */
.mu-section { margin-bottom: 36px; }
.mu-section-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin: 0 0 8px; }
.mu-desc { font-size: 12.5px; color: var(--text-muted); margin: 0 0 14px; line-height: 1.6; }
.mu-meta { font-size: 11.5px; color: var(--text-muted); margin: 10px 0 0; }

.mu-status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 8px; }
.mu-status-item { background: var(--bg-elevated); border: 1px solid var(--border-normal); border-radius: 8px; padding: 14px 16px; }
.mu-status-label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.mu-status-value { display: block; font-size: 18px; font-weight: 600; color: var(--text-primary); }

.mu-form { display: flex; flex-direction: column; gap: 12px; }
.mu-form-inline { display: inline-flex; }
.mu-limit-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mu-limit-label { font-size: 12.5px; color: var(--text-muted); }
.mu-radio-label { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; cursor: pointer; }
.mu-radio-label input { accent-color: var(--accent); }

.mu-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px;
  border-radius: 6px; border: 1px solid var(--border-strong); background: var(--bg-elevated);
  font-size: 13px; font-weight: 500; color: var(--text-primary); cursor: pointer;
  transition: background 0.12s, border-color 0.12s; white-space: nowrap; }
.mu-btn:hover { background: var(--bg-hover); }
.mu-btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.mu-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.mu-btn-secondary { border-color: var(--border-strong); }

.mu-link-btn { display: inline-flex; align-items: center; padding: 8px 18px;
  border-radius: 6px; border: 1px solid var(--border-normal); background: var(--bg-elevated);
  font-size: 13px; color: var(--text-secondary); text-decoration: none;
  transition: background 0.12s; }
.mu-link-btn:hover { background: var(--bg-hover); }

.mu-result-box { margin-top: 16px; border-radius: 8px; border: 1px solid var(--border-normal); overflow: hidden; }
.mu-result-ok   { border-color: #2e7d32; }
.mu-result-warn { border-color: #e6a817; background: #fffbf0; }
.mu-result-error { border-color: #c0392b; background: #fff5f5; }
.mu-result-head { padding: 10px 16px; font-size: 13px; font-weight: 600; background: var(--bg-elevated); border-bottom: 1px solid var(--border-normal); }
.mu-result-ok .mu-result-head { background: #e8f5e9; border-bottom-color: #c8e6c9; }
.mu-result-warn, .mu-result-error { padding: 12px 16px; font-size: 13px; }

.mu-empty { padding: 14px 16px; font-size: 12.5px; color: var(--text-muted); margin: 0; }

.mu-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mu-table th { text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 600; color: var(--text-muted); background: var(--bg-base); border-bottom: 1px solid var(--border-normal); }
.mu-table td { padding: 8px 12px; border-bottom: 1px solid var(--border-subtle); color: var(--text-primary); vertical-align: top; }
.mu-table tr:last-child td { border-bottom: none; }
.mu-td-id    { color: var(--text-muted); width: 48px; }
.mu-td-src   { width: 100px; color: var(--text-muted); }
.mu-td-score { width: 56px; text-align: right; color: var(--text-muted); }
.mu-td-st    { width: 80px; font-size: 11px; }

.mu-result-row { display: flex; align-items: baseline; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--border-subtle); font-size: 12.5px; flex-wrap: wrap; }
.mu-result-row:last-child { border-bottom: none; }
.mu-result-row-done  .mu-result-status { color: #2e7d32; }
.mu-result-row-error .mu-result-status { color: #c0392b; }
.mu-result-status { font-size: 11px; font-weight: 600; min-width: 60px; }
.mu-result-title { flex: 1; color: var(--text-primary); }
.mu-result-src  { font-size: 11px; color: var(--text-muted); }
.mu-result-err  { font-size: 11px; color: #c0392b; flex-basis: 100%; }
.mu-result-link { padding: 12px 16px; background: var(--bg-elevated); border-top: 1px solid var(--border-normal); }
.mu-result-link a { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }
.mu-result-link a:hover { text-decoration: underline; }

/* --- 今日はスキップ --- */
.btn-today-skip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 11.5px;
  line-height: 1.4;
  border: 1px solid var(--border-normal);
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.btn-today-skip:hover {
  background: #f0f4fa;
  color: var(--text-primary);
  border-color: #b0bec5;
}
