@charset "UTF-8";
/* ==========================================================================
   SNS Research - 管理画面スタイル
   白ベース / モダン / 情報量重視 / PC優先・スマホ完全対応
   ========================================================================== */

:root {
  --bg:            #f5f6f8;
  --surface:       #ffffff;
  --surface-alt:   #fafbfc;
  --border:        #e4e7ec;
  --border-strong: #d0d5dd;
  --text:          #101828;
  --text-sub:      #475467;
  --muted:         #98a2b3;
  --primary:       #2563eb;
  --primary-dark:  #1d4ed8;
  --primary-light: #eff6ff;
  --success:       #059669;
  --success-light: #ecfdf5;
  --warning:       #d97706;
  --warning-light: #fffbeb;
  --danger:        #dc2626;
  --danger-light:  #fef2f2;
  --info:          #0891b2;
  --info-light:    #ecfeff;
  --purple:        #7c3aed;

  --radius:    8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
  --shadow:    0 1px 3px rgba(16,24,40,.1), 0 1px 2px rgba(16,24,40,.06);
  --shadow-lg: 0 10px 24px rgba(16,24,40,.10);

  --sidebar-w: 228px;
  --header-h:  56px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
          "Noto Sans JP", Meiryo, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }

/* hidden 属性は display 指定より優先させる (モーダル・一括操作バーの初期非表示) */
[hidden] { display: none !important; }

/* インラインSVGアイコンの既定サイズ (指定が無いSVGが巨大化するのを防ぐ) */
svg:not([width]) {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  vertical-align: -0.15em;
}
.stat__label svg { width: 14px; height: 14px; }
.card__title svg { width: 15px; height: 15px; }
.empty__icon svg { width: 40px; height: 40px; }
.collapse__toggle svg { width: 14px; height: 14px; }
.verified-icon { width: 13px; height: 13px; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.35; }
p { margin: 0 0 8px; }
ul { margin: 0; padding-left: 1.2em; }

/* ---------------------------------------------------------------- Layout */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  z-index: 60;
}
.sidebar__brand {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.sidebar__logo {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 12px; flex: 0 0 auto;
}
.sidebar__name { font-weight: 600; font-size: 13.5px; letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__nav { flex: 1 1 auto; overflow-y: auto; padding: 8px; }
.sidebar__section { padding: 12px 10px 5px; font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: .06em; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--text-sub); font-size: 13px; font-weight: 500;
  margin-bottom: 1px; white-space: nowrap;
}
.nav-item:hover { background: var(--surface-alt); color: var(--text); text-decoration: none; }
.nav-item.is-active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.nav-item svg { width: 16px; height: 16px; flex: 0 0 auto; }
.nav-item__badge {
  margin-left: auto; background: var(--surface-alt); border: 1px solid var(--border);
  color: var(--text-sub); border-radius: 10px; padding: 0 6px; font-size: 10.5px; font-weight: 600;
}
.sidebar__footer { flex: 0 0 auto; border-top: 1px solid var(--border); padding: 10px; font-size: 11px; color: var(--muted); }

.main { flex: 1 1 auto; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--header-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 50;
}
.topbar__title { font-size: 15px; font-weight: 600; }
.topbar__spacer { flex: 1 1 auto; }
.topbar__meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-sub); }

.menu-toggle {
  display: none; background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); width: 34px; height: 34px; cursor: pointer;
  align-items: center; justify-content: center; color: var(--text-sub);
}

.content { padding: 18px 20px 48px; flex: 1 1 auto; min-width: 0; }
.content--wide { max-width: none; }

.sidebar-backdrop { display: none; }

/* ------------------------------------------------------------- Utilities */
.row { display: flex; gap: 12px; }
.row--wrap { flex-wrap: wrap; }
.row--center { align-items: center; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.gap-sm { gap: 6px; }
.gap-lg { gap: 20px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.text-muted { color: var(--muted); }
.text-sub { color: var(--text-sub); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.w-100 { width: 100%; }
.pos-up { color: var(--success); font-weight: 600; }
.pos-down { color: var(--danger); font-weight: 600; }

/* ----------------------------------------------------------------- Cards */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.card__head {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.card__title { font-size: 13.5px; font-weight: 600; }
.card__body { padding: 16px; }
.card__body--tight { padding: 10px 12px; }
.card__foot { padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface-alt); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ------------------------------------------------------------- Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow-sm); min-width: 0;
}
.stat__label { font-size: 11.5px; color: var(--text-sub); display: flex; align-items: center; gap: 5px; }
.stat__value { font-size: 24px; font-weight: 700; line-height: 1.2; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat__sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.stat__delta { font-size: 11.5px; font-weight: 600; }

/* --------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font-size: 12.5px; font-weight: 500; font-family: inherit;
  cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s;
  text-decoration: none; line-height: 1.5;
}
.btn:hover { background: var(--surface-alt); text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn:disabled, .btn.is-disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn--danger { background: var(--surface); border-color: #fca5a5; color: var(--danger); }
.btn--danger:hover { background: var(--danger-light); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--text-sub); }
.btn--ghost:hover { background: var(--surface-alt); }
.btn--sm { padding: 4px 9px; font-size: 11.5px; }
.btn--lg { padding: 10px 20px; font-size: 14px; }
.btn--block { width: 100%; }
.btn--icon { padding: 6px; width: 30px; height: 30px; }
.btn svg { width: 15px; height: 15px; }

/* ---------------------------------------------------------------- Inputs */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field__label { font-size: 11.5px; font-weight: 600; color: var(--text-sub); }
.field__hint { font-size: 11px; color: var(--muted); }
.field__error { font-size: 11.5px; color: var(--danger); }

.input, .select, .textarea {
  width: 100%; padding: 7px 10px; font-size: 13px; font-family: inherit; line-height: 1.5;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:disabled, .select:disabled { background: var(--surface-alt); color: var(--muted); }
.textarea { resize: vertical; min-height: 84px; }
.select { appearance: none; padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
.input--sm, .select--sm { padding: 4px 8px; font-size: 12px; }
.select--sm { padding-right: 24px; }

.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; user-select: none; }
.check input[type="checkbox"], .check input[type="radio"] { width: 15px; height: 15px; accent-color: var(--primary); margin: 0; cursor: pointer; }

.segmented { display: inline-flex; background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px; gap: 2px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  padding: 5px 13px; border-radius: 5px; font-size: 12.5px; font-weight: 500;
  color: var(--text-sub); cursor: pointer; white-space: nowrap;
}
.segmented input:checked + label, .segmented label.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }

/* ------------------------------------------------------------ Search bar */
.searchbar { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.searchbar__input {
  flex: 1 1 320px; min-width: 0; font-size: 15px; padding: 11px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface);
}
.searchbar__input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* --------------------------------------------------------------- Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 7px; border-radius: 20px; font-size: 11px; font-weight: 600;
  background: var(--surface-alt); border: 1px solid var(--border); color: var(--text-sub);
  white-space: nowrap; line-height: 1.7;
}
.badge--primary { background: var(--primary-light); border-color: #bfdbfe; color: var(--primary-dark); }
.badge--success { background: var(--success-light); border-color: #a7f3d0; color: #047857; }
.badge--warning { background: var(--warning-light); border-color: #fde68a; color: #b45309; }
.badge--danger  { background: var(--danger-light);  border-color: #fecaca; color: #b91c1c; }
.badge--info    { background: var(--info-light);    border-color: #a5f3fc; color: #0e7490; }
.badge--purple  { background: #f5f3ff; border-color: #ddd6fe; color: #6d28d9; }

.platform-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px;
  border-radius: 5px; font-size: 10.5px; font-weight: 700; color: #fff; line-height: 1.8;
}
.platform-badge--x { background: #0f1419; }
.platform-badge--instagram { background: linear-gradient(45deg,#f09433,#dc2743,#bc1888); }
.platform-badge--tiktok { background: #010101; }
.platform-badge--youtube { background: #ff0000; }
.platform-badge--threads { background: #000; }

/* Score badges */
.score { display: inline-block; min-width: 30px; text-align: center; padding: 1px 6px; border-radius: 5px; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score-a { background: #dcfce7; color: #15803d; }
.score-b { background: #d1fae5; color: #047857; }
.score-c { background: #fef3c7; color: #b45309; }
.score-d { background: #ffedd5; color: #c2410c; }
.score-e { background: #fee2e2; color: #b91c1c; }
.score-none { background: var(--surface-alt); color: var(--muted); }

.grade { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-weight: 700; font-size: 12px; }
.grade-A { background: #dcfce7; color: #15803d; }
.grade-B { background: #d1fae5; color: #047857; }
.grade-C { background: #fef3c7; color: #b45309; }
.grade-D { background: #ffedd5; color: #c2410c; }
.grade-E { background: #fee2e2; color: #b91c1c; }
.grade--none { background: var(--surface-alt); color: var(--muted); }

/* --------------------------------------------------------------- Avatar */
.avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  background: var(--surface-alt); border: 1px solid var(--border);
}
.avatar--lg { width: 60px; height: 60px; }
.avatar--xl { width: 84px; height: 84px; }
.avatar-fallback {
  display: grid; place-items: center; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #93c5fd, #6366f1); font-size: 12.5px;
}
.avatar--lg.avatar-fallback { font-size: 22px; }
.avatar--xl.avatar-fallback { font-size: 30px; }

/* ---------------------------------------------------------------- Table */
/* 横に広いテーブルはこのラッパー内でスクロールする。
   ラッパー自体がスクロールコンテナになるため、thead は top:0 でこの中に固定される
   (親に overflow がある場合、ビューポート基準の sticky は効かないため) */
.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 140px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  overscroll-behavior: contain;
}
/* カード内に直接置く場合は二重の枠線を避ける */
.card > .table-wrap { border: 0; border-radius: 0; max-height: calc(100vh - 220px); }
.card > .table-wrap:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.data-table th, .data-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table thead th {
  position: sticky; top: 0; z-index: 5;
  background: var(--surface-alt); font-size: 11px; font-weight: 600; color: var(--text-sub);
  white-space: nowrap; border-bottom: 1px solid var(--border);
}
.data-table tbody tr:hover { background: #fbfcfe; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .col-check { width: 32px; }
.data-table .col-actions { width: 90px; white-space: nowrap; }
.table--compact th, .table--compact td { padding: 6px 8px; }
.table--fixed { table-layout: fixed; }

.account-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.account-cell__body { min-width: 0; }
.account-cell__name { font-weight: 600; font-size: 12.5px; display: flex; align-items: center; gap: 4px; }
.account-cell__handle { color: var(--muted); font-size: 11.5px; }
.account-cell__bio { color: var(--text-sub); font-size: 11.5px; margin-top: 1px; max-width: 380px; }

.verified-icon { width: 13px; height: 13px; color: #1d9bf0; flex: 0 0 auto; }

/* ----------------------------------------------------------- Pagination */
.pagination { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 30px; height: 30px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text-sub); font-size: 12px; text-decoration: none;
}
.pagination a:hover { background: var(--surface-alt); text-decoration: none; }
.pagination .is-current { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pagination .is-disabled { opacity: .4; pointer-events: none; }

/* ---------------------------------------------------------------- Alerts */
.alert {
  padding: 10px 13px; border-radius: var(--radius); font-size: 12.5px;
  border: 1px solid var(--border); background: var(--surface-alt); color: var(--text-sub);
  display: flex; gap: 9px; align-items: flex-start;
}
.alert svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }
.alert--success { background: var(--success-light); border-color: #a7f3d0; color: #065f46; }
.alert--warning { background: var(--warning-light); border-color: #fde68a; color: #92400e; }
.alert--error   { background: var(--danger-light);  border-color: #fecaca; color: #991b1b; }
.alert--info    { background: var(--info-light);    border-color: #a5f3fc; color: #155e75; }

.flash-stack { position: fixed; top: 66px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.flash-stack .alert { box-shadow: var(--shadow-lg); background: var(--surface); animation: flash-in .22s ease-out; }
.flash-stack .alert--success { background: var(--success-light); }
.flash-stack .alert--error { background: var(--danger-light); }
.flash-stack .alert--warning { background: var(--warning-light); }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ Empty state */
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty__icon { width: 40px; height: 40px; margin: 0 auto 10px; opacity: .35; }
.empty__title { font-size: 14px; font-weight: 600; color: var(--text-sub); margin-bottom: 4px; }
.empty__text { font-size: 12.5px; max-width: 460px; margin: 0 auto; line-height: 1.8; }

/* ------------------------------------------------------------ Collapsible */
.collapse__toggle {
  display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none;
  font-size: 12.5px; font-weight: 600; color: var(--text-sub); background: none; border: none;
  padding: 0; font-family: inherit;
}
.collapse__toggle svg { width: 14px; height: 14px; transition: transform .15s; }
.collapse__toggle[aria-expanded="true"] svg { transform: rotate(90deg); }

/* --------------------------------------------------------------- Filters */
.filters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 10px 12px; }
.filters-flags { display: flex; flex-wrap: wrap; gap: 8px 16px; padding-top: 4px; }
.range-pair { display: flex; align-items: center; gap: 5px; }
.range-pair .input { min-width: 0; }
.range-pair span { color: var(--muted); font-size: 11px; }

/* ------------------------------------------------------------------ Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a, .tabs button {
  padding: 8px 14px; font-size: 12.5px; font-weight: 500; color: var(--text-sub);
  border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent;
  white-space: nowrap; font-family: inherit; text-decoration: none;
}
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs .is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ----------------------------------------------------------------- Chart */
.chart-box { position: relative; height: 240px; }
.chart-box--sm { height: 168px; }
.chart-empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 12.5px; text-align: center; padding: 12px; }

/* ----------------------------------------------------------- Definition */
.dl { display: grid; grid-template-columns: minmax(96px, auto) 1fr; gap: 6px 14px; font-size: 12.5px; }
.dl dt { color: var(--text-sub); font-weight: 500; }
.dl dd { margin: 0; font-variant-numeric: tabular-nums; word-break: break-word; }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.metric {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; background: var(--surface-alt);
}
.metric__label { font-size: 10.5px; color: var(--text-sub); }
.metric__value { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; }
.metric__sub { font-size: 10.5px; color: var(--muted); }

/* ----------------------------------------------------------------- Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px; max-height: 88vh; overflow: auto;
}
.modal__head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.modal__title { font-size: 14px; font-weight: 600; flex: 1 1 auto; }
.modal__body { padding: 18px; }
.modal__foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-alt); }

/* ------------------------------------------------------------- Bulk bar */
.bulkbar {
  position: sticky; bottom: 0; z-index: 40;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 9px 14px; margin-top: 10px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.bulkbar__count { font-weight: 600; font-size: 12.5px; }

/* ------------------------------------------------------------- Post list */
.post-item { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.post-item:last-child { border-bottom: none; }
.post-item__text { color: var(--text); white-space: pre-wrap; word-break: break-word; }
.post-item__meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 11.5px; margin-top: 5px; }

.tag-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 20px;
  font-size: 11px; border: 1px solid var(--border); background: var(--surface-alt); color: var(--text-sub);
}
.tag-chip button { border: none; background: none; cursor: pointer; color: var(--muted); padding: 0 0 0 2px; font-size: 13px; line-height: 1; }
.tag-chip button:hover { color: var(--danger); }

.chip-list { display: flex; flex-wrap: wrap; gap: 5px; }

.progress { height: 5px; border-radius: 3px; background: var(--surface-alt); overflow: hidden; }
.progress__bar { height: 100%; background: var(--primary); border-radius: 3px; }

.kv-list { font-size: 12.5px; }
.kv-list__item { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.kv-list__item:last-child { border-bottom: none; }

.ai-output { white-space: pre-wrap; font-size: 13px; line-height: 1.85; word-break: break-word; }

.spinner {
  width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
.spinner--dark { border-color: rgba(16,24,40,.2); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

.best-value { background: var(--success-light) !important; font-weight: 700; color: #047857; }

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

.note-status { font-size: 11px; color: var(--muted); }

/* --------------------------------------------------------------- Login */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.auth-card { width: 100%; max-width: 396px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 28px; }
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 6px; }
.auth-brand__logo { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--primary), var(--purple)); color: #fff; display: grid; place-items: center; font-weight: 700; }
.auth-title { text-align: center; font-size: 17px; font-weight: 600; }
.auth-sub { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 20px; }

/* -------------------------------------------------------------- Install */
.install-page { min-height: 100vh; padding: 28px 16px; background: var(--bg); }
.install-card { max-width: 680px; margin: 0 auto; }
.step-list { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.step { flex: 1 1 120px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: 12px; color: var(--text-sub); }
.step.is-active { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.step.is-done { border-color: #a7f3d0; background: var(--success-light); color: #047857; }

/* ============================================================ Responsive */
@media (max-width: 1100px) {
  .account-cell__bio { max-width: 220px; }
}

@media (max-width: 900px) {
  :root { --header-h: 52px; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
    width: 260px; flex-basis: 260px;
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(16,24,40,.4); z-index: 55;
  }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .content { padding: 14px 12px 60px; }
  .topbar { padding: 0 12px; }
  .flash-stack { top: 60px; right: 10px; left: 10px; max-width: none; }

  /* 入力欄はiOSの自動ズームを防ぐため16px以上 */
  .input, .select, .textarea, .searchbar__input { font-size: 16px; padding: 9px 11px; }
  .input--sm, .select--sm { font-size: 16px; }

  .stats { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  .stat__value { font-size: 21px; }

  /* テーブル -> カード表示 */
  .table-wrap { border: none; background: transparent; overflow: visible; max-height: none; }
  .card > .table-wrap { max-height: none; }
  .data-table { display: block; font-size: 13px; }
  .data-table thead { display: none; }
  .data-table tbody { display: block; }
  .data-table tbody tr {
    display: block; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); margin-bottom: 9px; padding: 11px 13px; box-shadow: var(--shadow-sm);
  }
  .data-table tbody tr:hover { background: var(--surface); }
  .data-table td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border: none; text-align: right; }
  .data-table td::before {
    content: attr(data-label); font-size: 11.5px; color: var(--text-sub); font-weight: 600;
    text-align: left; flex: 0 0 auto;
  }
  .data-table td[data-label=""]::before, .data-table td.no-label::before { content: none; }
  .data-table td.cell-account { display: block; text-align: left; padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
  .data-table td.cell-account::before { content: none; }
  .data-table td.col-check { position: absolute; }
  .data-table tbody tr { position: relative; padding-left: 40px; }
  .data-table td.col-check { left: 12px; top: 12px; padding: 0; }
  .data-table td.col-actions { justify-content: flex-end; padding-top: 9px; border-top: 1px solid var(--border); margin-top: 6px; }
  .data-table td.col-actions::before { content: none; }
  .account-cell__bio { max-width: none; }

  .filters-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 8px; }
  .bulkbar { position: fixed; left: 10px; right: 10px; bottom: 10px; margin: 0; }
  .modal { max-height: 92vh; }
  .card__body { padding: 13px; }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .searchbar__input { flex-basis: 100%; }
  .btn { padding: 8px 12px; }
  .topbar__meta { display: none; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
  .sidebar, .topbar, .bulkbar, .btn { display: none !important; }
  .main { margin-left: 0; }
  body { background: #fff; }
}
