/* 配色・部品は Brave Cockpit に合わせる（ライトテーマ） */
:root {
  --bg: #f2f4f8;
  --surface: #ffffff;
  --sidebar: #f7f8fa;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #171717;
  --muted: #667085;
  --faint: #98a2b3;
  --hover: #e8e8ec;
  --primary: #0d318a;
  --primary-hover: #0b2a78;
  --navy: #0a2670;
  --soft-blue: #e7ecf8;
  --orange: #f9b233;
  --orange-strong: #f39c12;
  --green: #9dcb55;
  --danger-bg: #fdecec; --danger: #c22a1e; --danger-border: #f5c6c2;
  --success-bg: #e8f6ee; --success: #187a49; --success-border: #c6ebd4;
  --info-bg: #eaf1ff; --info: #2059b8; --info-border: #cbdcfb;
  --shadow-xs: 0 1px 2px rgba(4, 16, 36, .06);
  --shadow-md: 0 4px 10px rgba(4, 16, 36, .10), 0 2px 4px rgba(4, 16, 36, .05);
  --shadow-lg: 0 12px 28px rgba(4, 16, 36, .14), 0 4px 10px rgba(4, 16, 36, .06);
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; height: 100%; background: var(--bg); color: var(--text);
  font-family: "Noto Sans JP", "Montserrat", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif; font-size: 14px; line-height: 1.65; }
a { color: var(--navy); }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.025em; margin: 0 0 6px; }
h1::after { content: ""; display: block; width: 36px; height: 3px; margin-top: 8px; background: var(--orange); border-radius: 2px; }
h2 { font-size: 15px; color: var(--navy); margin: 22px 0 8px; }
:focus-visible { outline: 2px solid var(--orange-strong); outline-offset: 2px; }

/* ボタン */
button, .btnlink {
  font: inherit; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--navy); cursor: pointer; text-decoration: none; transition: background .15s var(--ease), border-color .15s var(--ease);
}
button:hover, .btnlink:hover { background: var(--sidebar); border-color: var(--orange); }
button:active, .btnlink:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: default; }
.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: var(--shadow-xs); }
.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.danger:hover { background: #fbdcdc; border-color: var(--danger-border); }
.big { width: 100%; min-height: 42px; padding: 0 20px; margin-top: 10px; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--danger); }
.notice { background: #f3f5fb; border: 1px solid #c3cde6; color: var(--navy); border-radius: 8px; padding: 10px 12px; font-size: 12px; }

input {
  width: 100%; margin-top: 6px; min-height: 38px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: #fff; color: var(--text); font: inherit; font-size: 14px;
}
input:focus { outline: 2px solid #c3cde6; border-color: var(--primary); }
.copyrow { display: flex; gap: 8px; align-items: center; }
.copyrow input { margin: 0; }
.copyrow button { flex-shrink: 0; }

/* ブランド */
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; text-decoration: none; color: var(--text); }
.brand img { width: 34px; height: 34px; }
.brand strong { display: block; font-size: 14px; line-height: 1.2; }
.brand small { display: block; font-size: 11px; color: var(--muted); }

/* カード型の画面（トップ・入室前・設定） */
.home { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-xs); padding: 28px; width: 100%; max-width: 460px; }
.card label { display: block; margin-top: 14px; color: var(--muted); font-size: 12px; font-weight: 600; }
details { margin-top: 14px; }
summary { cursor: pointer; color: var(--muted); font-size: 12px; }
#preview { width: 100%; aspect-ratio: 16 / 9; background: #0b1220; border-radius: 10px; transform: scaleX(-1); object-fit: cover; margin-top: 8px; }

/* 会議画面 */
#meeting { height: 100%; display: flex; flex-direction: column; }
#grid { flex: 1; display: grid; gap: 10px; padding: 12px; min-height: 0; position: relative; }
#grid[data-n="1"], #grid[data-n="2"] { grid-template-columns: 1fr; }
#grid[data-n="3"], #grid[data-n="4"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.tile { position: relative; background: #0b1220; border-radius: 14px; overflow: hidden; min-height: 0; box-shadow: var(--shadow-xs); }
.tile video { width: 100%; height: 100%; object-fit: contain; background: #0b1220; display: block; }
.tile.self video.mirror { transform: scaleX(-1); }
/* 1対1（担当者＋顧客）は相手を大きく、自分を右下に小さく */
#grid[data-n="2"] .tile.self {
  position: absolute; right: 24px; bottom: 24px; width: 24%; min-width: 150px; aspect-ratio: 16 / 9; z-index: 2;
  border: 2px solid #fff; box-shadow: var(--shadow-lg);
}
#grid[data-n="2"] .tile.self .label { font-size: 11px; }
.tile .label { position: absolute; left: 10px; bottom: 10px; background: rgba(255, 255, 255, .92); color: var(--text);
  padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  max-width: calc(100% - 20px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .off { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700;
  color: var(--navy); background: var(--soft-blue); }
#bar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 12px; background: var(--surface); border-top: 1px solid var(--border); }
#bar button.offstate { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
#recBadge { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); background: var(--danger-bg); color: var(--danger);
  border: 1px solid var(--danger-border); padding: 4px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; z-index: 10; }
#toast { position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%); background: var(--surface); color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--shadow-md); padding: 10px 16px; border-radius: 10px; z-index: 10; max-width: calc(100% - 32px); }
@media (max-width: 700px) {
  #grid[data-n="3"], #grid[data-n="4"] { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-rows: 1fr; }
  #grid[data-n="2"] .tile.self { width: 34%; min-width: 110px; right: 18px; bottom: 18px; }
}

/* 一覧・議事録ページ */
.page { max-width: 880px; margin: 0 auto; padding: 24px 16px 96px; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-xs); padding: 16px; margin-top: 16px; }
.panel h2 { margin-top: 0; }
.filters { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { min-height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px; background: var(--sidebar); color: var(--muted); border: 1px solid var(--border); }
.tag.active { background: var(--soft-blue); color: var(--primary); border-color: var(--primary); }
span.tag { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; background: var(--soft-blue); color: var(--primary); border-color: #c3cde6; font-weight: 600; }
.row { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-xs);
  padding: 14px 16px; margin-bottom: 10px; color: var(--text); text-decoration: none; transition: box-shadow .15s var(--ease), transform .15s var(--ease); }
.row:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.row .when { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; font-weight: 600; }
.live { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); border-radius: 999px; padding: 0 8px; font-size: 11px; font-weight: 600; }
.ok { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); border-radius: 999px; padding: 0 8px; font-size: 11px; font-weight: 600; }
.sharerow { margin: 12px 0; }
.prose { white-space: pre-wrap; line-height: 1.85; }
.transcript p { margin: 0 0 8px; }
.transcript .t { color: var(--faint); font-size: 12px; margin-right: 6px; }
.transcript .who { font-weight: 700; color: var(--navy); margin-right: 6px; }
.yt { position: relative; aspect-ratio: 16 / 9; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 10px; }
progress { width: 100%; height: 8px; accent-color: var(--primary); }
