html { scrollbar-gutter: stable; }

/* ============================================================
   SiteDiff — 共通スタイル  /css/style.css
   ============================================================ */

/* ---- CSS変数 ---- */
:root {
  --bg:        #f3f3f3;
  --surface:   #fff;
  --surface2:  #f4f5f8;
  --border:    #e0e3ec;
  --accent:    #4f7fff;
  --accent2:   #ff6b8a;
  --accent3:   #7c3aed;
  --draft:     #4f7fff;
  --release:   #ff6b8a;
  --text:      #1a1d2e;
  --text2:     #6b7080;
  --text3:     #a0a5b8;
  --shadow:    0 2px 12px rgba(30,40,80,0.08);
  --shadow-sm: 0 1px 4px rgba(30,40,80,0.06);
  --r:         12px;
}

/* ---- リセット ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'IBM Plex Sans JP', sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* ---- アイコン ---- */
.ico {
  font-family: 'Material Symbols Outlined';
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
  font-size: 18px;
  line-height: 1;
  vertical-align: middle;
  display: inline-block;
  white-space: nowrap;
}
.mi {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  vertical-align: middle;
}

/* ---- ヘッダー（共通） ---- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  min-height: 80px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-sizing: border-box;
}

/* ---- ボタン ---- */
.btn {
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-sec {
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
}
.btn-sec:hover { border-color: var(--accent); color: var(--accent); }

.btn-ic {
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px;
  border-radius: 5px;
  color: var(--text3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.btn-ic:hover { background: var(--surface2); color: var(--accent); }
.btn-ic.del:hover { color: var(--accent2); }
.btn-ic.active { background: rgba(79,127,255,0.1); color: var(--accent); }
.btn-ic.active2 { background: rgba(124,58,237,0.1); color: var(--accent3); }

.btn-ghost {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: var(--text2);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all .15s;
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

/* ---- フォーム ---- */
.inp {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  color: var(--text);
  background: var(--surface2);
  transition: border-color .2s;
}
.inp:focus { border-color: var(--accent); }

.lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 5px;
  margin-top: 12px;
  display: block;
}

/* ---- バッジ ---- */
.badge {
  font-size: 10px;
  background: var(--accent);
  color: #fff;
  border-radius: 20px;
  padding: 1px 6px;
  font-weight: 700;
  display: inline-block;
}
.badge.red    { background: var(--accent2); }
.badge.gray   { background: var(--text3); }
.badge.purple { background: var(--accent3); }

/* ---- モーダル ---- */
.mbg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.mbg.open { display: flex; }

.mbox {
  background: var(--surface);
  border-radius: 15px;
  width: 90%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 8px 40px rgba(30,40,80,.18);
}
.mtitle {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.macts { display: flex; gap: 7px; margin-top: 18px; }

/* share/group-share用モーダル */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.modal-bg.open { display: flex; }
.modal-box {
  background: var(--surface);
  border-radius: 16px;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px;
  box-shadow: 0 8px 40px rgba(30,40,80,.18);
}
.modal-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-actions { display: flex; gap: 8px; margin-top: 20px; }

/* ---- トースト ---- */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #1a1d2e;
  color: #fff;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 9999;
  transform: translateY(18px);
  opacity: 0;
  transition: all .3s;
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ---- ローディングバー ---- */
.lbar {
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  transition: width .3s;
  width: 0;
}

/* ---- エンプティステート ---- */
.empty-st {
  text-align: center;
  padding: 48px 20px;
  color: var(--text3);
}
.empty-st .ico { font-size: 44px; display: block; margin-bottom: 10px; }

/* ---- vtabs（タブUI） ---- */
.vtabs {
  display: flex;
  background: var(--surface2);
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 3px;
}
.vtab {
  flex: 1;
  padding: 6px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: #333;
  border: none;
  background: none;
  font-family: inherit;
  transition: all .15s;
}
.vtab.active {
  background: var(--surface);
  color: #333;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(30,40,80,0.06);
}

/* ---- share/group-share共通 ---- */
.logo { font-family: 'IBM Plex Sans JP', sans-serif; font-weight: 800; font-size: 18px; color: var(--text); }
.logo span { color: var(--accent); }
.badge-role { font-size: 11px; padding: 3px 10px; border-radius: 20px; background: var(--surface2); border: 1px solid var(--border); color: var(--text2); }
.expire-badge { font-size: 11px; padding: 3px 10px; border-radius: 20px; background: rgba(255,170,0,.1); border: 1px solid #ffaa00; color: #cc8800; }

.center { display: flex; align-items: center; justify-content: center; min-height: 80vh; }
.box { border: 1px solid var(--border); border-radius: 16px; padding: 32px; width: 400px; max-width: 90vw; box-shadow: 0 8px 40px rgba(30,40,80,0.12); }
.box-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.box-sub { font-size: 13px; color: var(--text2); margin-bottom: 22px; line-height: 1.6; }
.err { font-size: 13px; color: #e53e3e; margin-top: 8px; text-align: center; }

/* report共通 */
.report { display: none; }
.report-header { display: none; }
.r-side { width: 280px; flex-shrink: 0; display: flex; flex-direction: column; }
.r-stabs { display: flex; }
.r-stab { flex: 1; padding: 11px 6px; text-align: center; font-size: 12px; cursor: pointer; border: none; background: none; color: var(--text2); border-bottom: 2px solid transparent; font-family: inherit; transition: all .2s; }
.r-stab.active { color: #e95532; border-bottom-color: #e95532; }
.r-sc { flex: 1; overflow-y: auto; padding: 16px; }
.r-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.r-vtabs { display: flex; background: var(--surface2); border-radius: 8px; padding: 3px; border: 1px solid var(--border); margin: 12px 16px; width: fit-content; }
.r-vtab { padding: 5px 14px; border-radius: 6px; font-size: 12px; cursor: pointer; color: var(--text2); border: none; background: none; font-family: inherit; transition: all .15s; }
.r-vtab.active { color: var(--accent); font-weight: 600; }
.r-view { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

.report-body { display: flex; height: calc(100vh - 80px); overflow: hidden; }
.split { display: flex; flex: 1; overflow: hidden; gap: 12px; padding: 12px; }
.pane { flex: 1; display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); background: var(--surface); }
.ph { padding: 8px 14px; display: flex; align-items: center; gap: 7px; font-size: 11px; border-radius: var(--r) var(--r) 0 0; }
.ph-u { font-family: monospace; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc { flex: 1; overflow: auto; background: #f8f9fc; border-radius: 0 0 var(--r) var(--r); }
.pc img { width: 100%; display: block; }
.src { flex: 1; overflow: auto; background: var(--surface2); display: flex; flex-direction: column; }

.di { border: 1px solid var(--border); border-radius: var(--r); padding: 10px; margin-bottom: 6px; cursor: pointer; transition: all .15s; }
.di:hover { border: 2px solid #e95532; }
.di.sel { border: 2px solid #e95532; background: #fff; }
.di-h { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.di-t { font-size: 12px; font-weight: 500; }
.di-p { font-size: 11px; color: var(--text3); font-family: monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dp { background: #4fffb0; } .dt { background: #ff4f7b; }
.tag { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; text-transform: uppercase; }
.ta { background: rgba(79,127,255,.12); color: var(--accent); }
.td { background: rgba(255,107,138,.12); color: var(--accent2); }
.ti { background: rgba(160,100,255,.12); color: #9b59b6; }
.tc { background: rgba(79,127,255,.12); color: var(--accent); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 14px; }
.stat { border: 1px solid var(--border); border-radius: var(--r); padding: 10px; text-align: center; }
.stat-n { font-size: 22px; font-weight: 700; }
.stat-n.a { color: var(--accent); } .stat-n.d { color: var(--accent2); }
.stat-l { font-size: 10px; color: var(--text2); }

.c-card { border: 2px solid var(--border); border-radius: var(--r); padding: 11px; margin-bottom: 7px; transition: all .15s; }
.c-card:hover { border: 2px solid #e95532; }
.c-card .c-text { user-select: text; cursor: text; }
.c-meta { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.av { width: 23px; height: 23px; border-radius: 50%; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; background: #666666; color: #fff; }
.c-author { font-size: 12px; font-weight: 600; color: var(--text); }
.c-time { font-size: 11px; color: var(--text3); margin-left: auto; }
.c-text { font-size: 13px; color: var(--text2); line-height: 1.6; }
.c-ref { margin-top: 6px; padding: 4px 9px; background: var(--surface2); border-left: 3px solid var(--accent); font-size: 11px; color: var(--text3); border-radius: 0 6px 6px 0; }
.c-inp-area { padding: 12px; }
.c-inp { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; color: var(--text); font-size: 13px; font-family: inherit; outline: none; resize: none; min-height: 65px; }
.c-inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,127,255,0.1); }
.c-send { margin-top: 6px; padding: 7px 16px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .15s; }
.c-send:hover { background: #3a6aff; }
.c-name { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; color: var(--text); font-size: 13px; font-family: inherit; outline: none; margin-bottom: 6px; transition: border-color .2s; }
.c-name:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,127,255,0.1); }
.c-selected { border-color: #e95532 !important; }
.c-mark-num { font-size: 10px; background: rgba(100,120,180,0.5); color: #fff; border-radius: 20px; padding: 2px 7px; font-weight: 700; }
.c-mark-num.active { background: #e95532; }

/* source diff共通 */
.chg-block { border: 1px solid var(--border); border-radius: 8px; margin: 6px 0; overflow: hidden; }
.chg-prod { background: rgba(255,107,138,0.06); }
.chg-test { background: rgba(233,85,50,0.06); }
.chg-prod .dl, .chg-test .dl { background: transparent; }
.dl { display: flex; font-family: monospace; font-size: 12px; line-height: 1.7; }
.ln { width: 38px; padding: 0 5px; text-align: right; color: var(--text3); font-size: 11px; border-right: 1px solid var(--border); user-select: none; }
.ls { width: 22px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.lc { flex: 1; padding: 0 12px; white-space: pre; overflow: hidden; }
.la { background: rgba(233,85,50,.08); } .la .ls { color: #e95532; }
.ld { background: rgba(255,107,138,.08); } .ld .ls { color: var(--accent2); }
.l-sep { color: var(--text3); font-size: 11px; padding: 3px 12px; border-top: 1px solid var(--border); font-family: monospace; }

/* ---- スクロールバー ---- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---- ユーティリティ ---- */
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex { display: flex; align-items: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text2); }
.text-dim { color: var(--text3); }
.font-bold { font-weight: 700; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }

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


/* カスタムTooltip: JS制御 (auth.js) */

/* ============================================
   レスポンシブ共通 (max-width: 896px)
   ============================================ */
@media screen and (max-width: 896px) {
  /* ヘッダー */
  header { padding: 0 16px; min-height: 60px; }

  /* ボタン・インプット */
  .btn { font-size: 12px; padding: 8px 14px; }
  .inp { font-size: 16px; } /* iOSズーム防止 */

  /* モーダル */
  .mbg { padding: 12px; }
  .mbox { padding: 20px 16px; border-radius: 16px; }

  /* カード */
  .c-card { padding: 10px; }
  .di { padding: 8px 10px; }

  /* ページ共通 */
  body { overflow-y: auto; }

  /* サイドバー共通（各ページで上書き） */
  .sidebar { width: 100% !important; }
  .r-side { width: 100% !important; }
}
