/* lab 共通: モード切替（通常 / ショート）とログダイアログ */

/* PC: ロゴ右の横並び切替 */
.lab-mode--switch {
  display: none;
  align-items: center;
  gap: 0;
  margin-left: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
}
.lab-mode__switch-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.7rem;
  color: #c9b3bd;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.lab-mode__switch-item:last-child {
  border-right: 0;
}
.lab-mode__switch-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.lab-mode__switch-item.is-active {
  color: #fff;
  background: rgba(255, 77, 148, 0.4);
}

/* ヘッダー: ログ操作（小さめ・アイコン主体） */
.lab-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  min-width: 1.85rem;
  min-height: 1.85rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.4);
  color: #c9b3bd;
  font: inherit;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.lab-icon-btn:hover {
  color: #fff;
  border-color: rgba(255, 180, 120, 0.55);
  background: rgba(255, 160, 80, 0.12);
}
.lab-icon-btn__text {
  font-size: 0.58rem;
  font-weight: 800;
}
.lab-icon-btn__ico {
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1;
  opacity: 0.95;
}

/* SP: 画面下フル幅・四角フラットメニュー */
.lab-mode--dock {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  width: auto;
  max-width: 100%;
  margin: 0;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #000;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  gap: 0;
  box-sizing: border-box;
}
.lab-mode__dock-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 3.35rem;
  padding: 0.45rem 0.2rem 0.4rem;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.35);
  border-top: 2px solid transparent;
  border-radius: 0;
  color: #a8909c;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  background: transparent;
  box-shadow: none;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.lab-mode__dock-item:last-child {
  border-right: 0;
}
.lab-mode__dock-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.lab-mode__dock-item.is-active {
  color: #ff7bad;
  background: rgba(255, 77, 148, 0.22);
  border-top-color: #ff4d94;
  box-shadow: inset 0 0 0 1px rgba(255, 77, 148, 0.25);
}
.lab-mode__dock-item.is-active .lab-mode__icon {
  color: #ff4d94;
}
.lab-mode__icon {
  font-size: 1.05rem;
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: inherit;
}

.lab-log {
  width: min(720px, calc(100vw - 2rem));
  max-height: min(80vh, 640px);
  padding: 0;
  border: 1px solid rgba(255, 77, 148, 0.35);
  border-radius: 16px;
  background: #161318;
  color: #f7eef2;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}
.lab-log::backdrop {
  background: rgba(0, 0, 0, 0.65);
}
.lab-log__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(58, 40, 50, 0.95);
}
.lab-log__head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}
.lab-log__head-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.lab-log__danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 120, 120, 0.55);
  background: rgba(180, 40, 50, 0.28);
  color: #ffb4b4;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.lab-log__danger:hover {
  color: #fff;
  border-color: rgba(255, 140, 140, 0.85);
  background: rgba(200, 50, 60, 0.45);
}
.lab-log__summary {
  margin: 0;
  padding: 0.7rem 1rem 0;
  color: #a8909c;
  font-size: 0.8rem;
}
.lab-log__body {
  margin: 0.7rem 1rem 1rem;
  padding: 0.85rem;
  max-height: min(62vh, 520px);
  overflow: auto;
  border-radius: 10px;
  background: #0b0a0c;
  color: #f3dce6;
  font-size: 0.72rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (min-width: 981px) {
  .lab-mode--switch {
    display: inline-flex;
  }
}
@media (max-width: 980px) {
  .lab-mode--dock {
    display: flex;
  }
  body.lab-has-dock {
    padding-bottom: calc(3.6rem + env(safe-area-inset-bottom));
  }
}
