:root {
  --bni-red: #cf2030;
  --bni-navy: #14284b;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --border: #d9dde3;
  --text: #1c2430;
  --muted: #6b7480;
  --ok: #1f9d55;
  --danger: #cf2030;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 10px 14px;
  background: var(--bni-navy);
  color: #fff;
}
.app-header h1 { font-size: 17px; margin: 0; }
.header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lang-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--bni-navy);
  background: #ffd54a;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
}
.lang-select select {
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid var(--bni-navy);
  font-size: 13px;
  font-weight: 700;
  background: #fff;
}

.status { font-size: 12px; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.status--wait { background: #66707f; color: #fff; }
.status--ok { background: var(--ok); color: #fff; }
.status--mock { background: #e0a800; color: #201a00; }
.status--err { background: var(--danger); color: #fff; }

main { padding: 16px; max-width: 1200px; margin: 0 auto; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.panel h2 { font-size: 15px; margin: 0 0 10px; color: var(--bni-navy); }

.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 10px; }
.row:last-child { margin-bottom: 0; }

label { display: inline-flex; align-items: center; gap: 6px; }
input[type="number"] { width: 68px; padding: 5px 6px; border: 1px solid var(--border); border-radius: 6px; }
input[type="text"] { width: 100%; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; }

.hint { color: var(--muted); font-size: 12px; margin: 0 0 10px; line-height: 1.6; }

.btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.btn:hover { background: #f0f2f5; }
.btn--primary { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn--primary:hover { filter: brightness(0.95); background: var(--ok); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(0.95); background: var(--danger); }
.btn--ghost { background: #fff; }
.file-label { cursor: pointer; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 760px; }
th, td { border: 1px solid var(--border); text-align: left; vertical-align: middle; }
thead th { background: #eef1f5; color: var(--bni-navy); font-weight: 600; white-space: nowrap; padding: 5px 7px; }
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { background: #e2e8f2; }
.sort-ind { color: var(--muted); font-size: 11px; }
tbody td { padding: 0; } /* inputs fill the cell edge-to-edge (spreadsheet style) */
tbody td.check { text-align: center; padding: 2px; }
tbody td.role-cell { padding: 3px 4px; }
tbody tr.present { background: #f2fbf5; }
td .del { color: var(--danger); cursor: pointer; border: none; background: none; font-size: 16px; }

/* Spreadsheet-like cell inputs: no border/radius, fill the cell, grid comes
   from the table borders; focus shows a selection outline. */
tbody td input[type="text"] {
  width: 100%;
  height: 100%;
  min-height: 30px;
  padding: 5px 7px;
  border: none;
  border-radius: 0;
  background: transparent;
}
tbody td input[type="text"]:focus {
  outline: 2px solid var(--bni-navy);
  outline-offset: -2px;
  background: #fff;
}
.col-narrow { width: 90px; }
.col-check { width: 52px; }

.col-role { width: 150px; }
.role-cell { white-space: nowrap; text-align: center; }
.role-ico {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  margin: 0 1px;
  font-size: 16px;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  filter: grayscale(1) opacity(0.4);
  transition: filter 0.1s, background 0.1s, border-color 0.1s;
  user-select: none;
}
/* Instant tooltip showing the role meaning on hover/focus. */
.role-ico[data-tip]:hover::after,
.role-ico[data-tip]:focus::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bni-navy);
  color: #fff;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 20;
  pointer-events: none;
}
.role-ico:hover { background: #eef1f5; filter: grayscale(0.3) opacity(0.8); }
.role-ico.active {
  filter: none;
  background: #eaf2ff;
  border-color: var(--bni-navy);
}
.role-badge { font-size: 12px; }

.name-cell { display: flex; align-items: stretch; gap: 0; }
.name-cell input { flex: 1 1 auto; min-width: 0; }
.copy-ico {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  padding: 0 5px;
  user-select: none;
}
.copy-ico:hover { background: #eef1f5; color: var(--bni-navy); }
.copy-ico.copied { color: var(--ok); }

.radios { display: flex; flex-wrap: wrap; gap: 14px; }
.radios label { gap: 4px; }

.preview { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.room-card { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: #fbfcfd; }
.room-card h4 { margin: 0 0 6px; font-size: 13px; color: var(--bni-red); }
.room-card ul { margin: 0; padding-left: 18px; }
.room-card li { font-size: 12px; line-height: 1.5; }
.room-card .tag { font-size: 10px; color: #fff; border-radius: 4px; padding: 0 4px; margin-left: 4px; }
.tag-v { background: #cf2030; }
.tag-o { background: #7a4ed8; }
.tag-h { background: #1e73c8; }

.warn { color: #a35400; font-size: 12px; margin-top: 8px; }

/* Messages shown in place of browser dialogs, which the Zoom client may suppress. */
.preview .warn,
.preview .note {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
}
.preview .warn { background: #fff4e5; border: 1px solid #f0c98a; color: #8a4b00; }
.preview .note { background: #eef5ff; border: 1px solid #bcd4f5; color: #12457f; }
.log { background: #10151d; color: #cfe4ff; padding: 10px; border-radius: 8px; max-height: 220px; overflow: auto; font-size: 12px; white-space: pre-wrap; }

/* Host-role warning: the one thing a non-host operator must read first. */
.banner {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff4e5;
  border: 1px solid #f0c98a;
  color: #8a4b00;
  font-size: 14px;
  line-height: 1.6;
}

/* Pushes the roster name to the participant's Zoom screen name. */
.push-ico {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  padding: 0 5px;
  user-select: none;
}
.push-ico:hover { background: #eef1f5; color: var(--bni-navy); }

/* Per-group controls inside a preview card. */
.room-ops { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.room-ops .mini {
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  color: var(--bni-navy);
}
.room-ops .mini:hover:not(:disabled) { background: #eef1f5; }
.room-ops .mini:disabled { opacity: .45; cursor: default; }

/* Shown only when the browser lands here from the OAuth install redirect. */
.install-done { max-width: 560px; margin: 48px auto; text-align: center; }
.install-done h2 { margin: 0 0 10px; }
.install-done p { margin: 0; color: var(--muted); line-height: 1.7; }

/* Destination picker in the roster, used while the rooms are already open. */
.col-send { width: 120px; }
.send-sel { width: 100%; font-size: 12px; padding: 3px 4px; }
.send-sel:disabled { opacity: .5; }

/* Last-resort CSV, shown only when the clipboard is refused too. */
.csv-dump { width: 100%; min-height: 140px; font-family: ui-monospace, monospace; font-size: 11px; margin-top: 6px; }

/* Live room view: someone invited but not yet in the room. */
.pending-tag { font-size: 10px; color: #8a4b00; background: #fff4e5; border: 1px solid #f0c98a; border-radius: 4px; padding: 0 4px; }
.room-card li.muted { color: var(--muted); font-size: 11px; list-style: none; margin-left: -18px; }
