/* ===== ベース ===== */
/* ビュー全体をフレックスで中央寄せするためのルート設定 */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}
body {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #d3d7df;
  font-family: 'Inter','Noto Sans JP',sans-serif;
  padding: 2rem; /* 画面端との余白 */
  box-sizing: border-box;
}
.iphone-shell {
  width: 430px;
  height: 880px;
  background: #000;
  border-radius: 48px;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.iphone-frame {
  width: 390px;
  height: 840px;
  background: #fff;
  border-radius: 36px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.content-scroll {
  flex: 1;
  overflow-y: auto;
  background: #F6F6E9;
  padding-bottom: 140px; /* ナビ分の余白 */
}
.banner {
  aspect-ratio: 3 / 1;
}

/* ===== メンテナンスカード ===== */
.maint-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 1rem;
  text-align: center;
}
.tile {
  background: #fff;
  border: 1px solid #E5E5E5;
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  aspect-ratio: 1 / 1;
  padding: 0.45rem;
  min-width: 0;
}
.tile-title {
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.2rem;
}
.tile-icon {
  width: 24px;
  height: 24px;
  opacity: 0.38;
  margin: 0.25rem 0 0.35rem;
}
.tile-footer {
  margin-top: auto;
  width: 100%;
  background: #F5F5F5;
  border-radius: 0.6rem;
  padding: 0.2rem 0;
  font-size: 0.6rem;
  font-weight: 600;
  color: #808080;
  line-height: 1;
}
.tile.alert {
  border-color: #F6C9C9;
}
.tile.alert .tile-footer {
  background: #FEE;
  color: #E60023;
}
.badge {
  position: absolute;
  top: 0.28rem;
  right: 0.28rem;
  width: 0.75rem;
  height: 0.75rem;
  background: #E60023;
  color: #fff;
  font-size: 0.48rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  line-height: 1;
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: #fff;
  border-top: 1px solid #E5E5E5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 10;
}
.nav-item {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  line-height: 1;
  color: #6B7280;
}
.nav-item.active {
  color: #EF4444;
  font-weight: 600;
}
.nav-item img {
  width: 22px;
  height: 22px;
  opacity: 0.8;
}
.spacer {
  flex: 1 1 0%;
  pointer-events: none;
}

/* ===== Floating Action Button (故障) ===== */
.fab {
  position: absolute;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4B4B4B, #2F2F2F);
  /* background: linear-gradient(135deg, #FF616A, #FF2A3A); */
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  /* box-shadow: 0 8px 20px rgba(255,42,58,.35); */
  z-index: 20;
}

/* ===== Fault Sheet ===== */
#faultSheet { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,.5); z-index: 30; }
#faultSheet.active { display: block; }
#faultSheet > #faultContent { transform: translateY(100%); transition: transform .3s ease-out; }
#faultSheet.active > #faultContent { transform: translateY(0); }

/* ===== Conversation Screen ===== */
#conversationScreen { position: absolute; inset: 0; background: #F6F6E9; transform: translateY(100%); transition: transform .3s ease-out; z-index: 40; display: flex; flex-direction: column; }
#conversationScreen.active { transform: translateY(0); }
#chatLog { flex: 1; overflow-y: auto; }
#chatLog .message { margin-bottom: 0.5rem; }
#chatLog .message.agent { text-align: left; }
#chatLog .message.user { text-align: right; }
