/* Meta Ray-Ban Display (600x600, additive waveguide)
   黒は透明として描画されるため、背景=黒 / 前景=高輝度色 が基本 */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: #000;
  color: #f2f2f2;
  font-family: -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 20px;
  line-height: 1.45;
}

.hidden { display: none !important; }

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* ---- セットアップ画面 ---- */
#screen-setup { align-items: center; justify-content: center; }
.setup-box { text-align: center; padding: 24px; }
.logo { font-size: 34px; color: #e8825a; margin-bottom: 28px; font-weight: 700; }
.setup-text { font-size: 22px; color: #cfcfcf; }

/* ---- ステータスバー ---- */
#statusbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 2px solid #444;
  font-size: 20px;
  flex-shrink: 0;
}
.dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: #888;
  flex-shrink: 0;
}
.dot.ok       { background: #37d67a; }
.dot.busy     { background: #ffcf40; }
.dot.error    { background: #ff5c5c; }

/* ---- ログ ---- */
#log {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px;
  scroll-behavior: smooth;
}
.msg { margin-bottom: 14px; word-break: break-word; white-space: pre-wrap; }
.msg.user      { color: #7fd4ff; }
.msg.assistant { color: #f2f2f2; }
.msg.tool      { color: #9a9a9a; font-size: 18px; }
.msg.system    { color: #ffcf40; font-size: 18px; }
.msg.error     { color: #ff7c7c; }

/* ---- アクションボタン列 ---- */
#actions {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  padding: 10px 12px 14px;
  overflow-x: hidden;
  border-top: 2px solid #444;
}
.action-btn {
  min-height: 88px;
  min-width: 130px;
  flex: 1;
  background: #1c1c1c;
  color: #f2f2f2;
  border: 2px solid #555;
  border-radius: 14px;
  font-size: 20px;
  padding: 8px 10px;
}

/* ---- フォーカス表示 (D-pad操作の要) ---- */
.focusable:focus, .focusable.focused {
  outline: none;
  border-color: #e8825a;
  background: #3a231a;
  color: #ffffff;
  box-shadow: 0 0 0 3px #e8825a;
}

/* ---- 許可オーバーレイ ---- */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.perm-box {
  width: 520px;
  border: 3px solid #ffcf40;
  border-radius: 18px;
  background: #141200;
  padding: 24px;
  text-align: center;
}
.perm-title { font-size: 24px; color: #ffcf40; margin-bottom: 14px; font-weight: 700; }
.perm-detail {
  font-size: 19px;
  color: #e6e6e6;
  margin-bottom: 22px;
  max-height: 220px;
  overflow: hidden;
  word-break: break-all;
  white-space: pre-wrap;
}
.perm-buttons { display: flex; gap: 16px; }
.perm-btn {
  flex: 1;
  min-height: 92px;
  font-size: 24px;
  border-radius: 14px;
  border: 2px solid #555;
  background: #1c1c1c;
  color: #fff;
}
.perm-btn.allow { border-color: #37d67a; }
.perm-btn.deny  { border-color: #ff5c5c; }

/* ---- プロジェクト切替 ---- */
.proj-box {
  width: 520px;
  max-height: 520px;
  border: 3px solid #7fd4ff;
  border-radius: 18px;
  background: #001018;
  padding: 24px;
  text-align: center;
  overflow: hidden;
}
.proj-box .perm-title { color: #7fd4ff; }
#proj-list { display: flex; flex-direction: column; gap: 12px; }
.proj-btn {
  min-height: 76px;
  font-size: 22px;
  border-radius: 14px;
  border: 2px solid #555;
  background: #1c1c1c;
  color: #fff;
}
.proj-btn.active { border-color: #7fd4ff; }
.proj-btn .sub { display: block; font-size: 15px; color: #9a9a9a; }
#overlay-history .proj-box { border-color: #b48cff; }
#overlay-history .perm-title { color: #b48cff; }
#hist-list { display: flex; flex-direction: column; gap: 10px; max-height: 400px; overflow-y: auto; }
#hist-list .proj-btn { text-align: left; padding: 8px 14px; min-height: 64px; }

/* ---- スマホ用入力バー ---- */
#inputbar {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-top: 2px solid #444;
}
#inputbar input {
  flex: 1;
  min-height: 56px;
  background: #141414;
  border: 2px solid #555;
  border-radius: 12px;
  color: #f2f2f2;
  font-size: 18px;
  padding: 0 12px;
}
#inputbar button {
  min-width: 72px;
  min-height: 56px;
  background: #1c1c1c;
  border: 2px solid #555;
  border-radius: 12px;
  color: #f2f2f2;
  font-size: 18px;
}
#mic-btn.recording { border-color: #ff5c5c; background: #3a1414; }
