/* demo の画面。スマホの縦持ち前提の1画面。
   飾りは最小限に留める — メインのデザインは学生の担当領域。 */

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* dvh 未対応の古い端末向け */
  min-height: 100dvh;
}

/* ---------- 上部バー ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  position: relative;
  z-index: 50; /* 終了の表示より上。終了後もメニューから要望を書けるようにする */
}

.app-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.icon-button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--ink);
}

/* ---------- 本体 ---------- */

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px 12px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}

.camera-area {
  position: relative;
  background: #1c1c1c;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  max-height: 46dvh;
}

#video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.camera-message {
  position: absolute;
  inset: auto 12px 12px;
  margin: 0;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 10px;
  font-size: 0.85rem;
}

/* ---------- 回答 ---------- */

.qa {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
}

.asked {
  margin: 0 0 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.answer-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.answer {
  margin: 0;
  flex: 1;
}

.sent-image {
  width: 72px;
  border-radius: 8px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

/* ---------- 入力まわり ---------- */

.status {
  margin: 0;
  min-height: 1.4em;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.ask-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto; /* ボタンを画面下寄りに置き、片手の親指で届かせる */
}

#question {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

#question:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.button-row {
  display: flex;
  gap: 10px;
}

.primary-button {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: var(--shadow);
}

.primary-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.secondary-button {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
}

.secondary-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.ghost-button {
  margin-top: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
}

.link-button {
  border: none;
  background: none;
  padding: 0;
  color: inherit;
  text-decoration: underline;
}

/* ---------- 告知（畳まない） ---------- */

.notice {
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

/* ---------- オーバーレイ ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(60, 55, 40, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 60;
}

.overlay[hidden] { display: none; }

/* 終了の表示はメニュー類より下に置き、終了後も要望への導線を生かす */
#ended { z-index: 30; }
#form-overlay { z-index: 70; }

.sheet {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: min(100%, 320px);
  overflow: hidden;
}

.sheet-item {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
  color: var(--ink);
}

.sheet-item:last-child { border-bottom: none; }

.sheet-item-quiet { color: var(--muted); font-size: 0.9rem; }

.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: min(100%, 420px);
  max-height: 80vh;
  max-height: 80dvh;
  overflow-y: auto;
  padding: 18px;
}

.panel h2 { margin: 0 0 10px; font-size: 1.05rem; }
.panel ul, .panel ol { margin: 0 0 14px; padding-left: 20px; }
.panel li { margin-bottom: 6px; }

.panel-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 10px;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.field-label select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

/* ---------- 要望フォーム（画面いっぱい） ---------- */

.overlay-full { padding: 0; }

.form-wrap {
  background: var(--bg);
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.form-frame {
  flex: 1;
  border: none;
  width: 100%;
}

.form-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 24px;
  text-align: center;
}

.form-placeholder p { margin: 0; }

.form-close {
  margin: 12px 16px calc(12px + env(safe-area-inset-bottom));
}

.ended-panel { text-align: center; }
.ended-panel .primary-button { width: 100%; margin-top: 8px; }

/* ---------- 機能の置き場（いまは空） ---------- */

.feature-slot {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--muted);
}
