:root {
  --stm-primary: #2B7FE8;
  --stm-danger: #EF4444;
  --stm-text: #1a2332;
  --stm-text-muted: #5a6a7a;
  --stm-border: #e2e8f0;
}

.stm-demo {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  position: relative;
}

/* ===== 通常状態のダミー画面 ===== */
.stm-app-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stm-hint {
  margin: 0;
  font-size: 13px;
  color: var(--stm-text-muted);
}

.stm-dummy-input {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  border: 1.5px solid var(--stm-border);
  border-radius: 6px;
  resize: vertical;
  box-sizing: border-box;
}

.stm-status {
  margin: 0;
  font-size: 12px;
  color: var(--stm-text-muted);
}

/* hidden 属性で非表示にする要素は display: none を明示（.stm-app-view はflexのため打ち消しが必須） */
.stm-app-view[hidden] {
  display: none;
}

/* ===== ログアウト後のダミー画面 ===== */
.stm-login-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 20px;
  text-align: center;
}

.stm-login-view[hidden] {
  display: none;
}

.stm-login-message {
  margin: 0;
  font-size: 14px;
  color: var(--stm-text);
}

.stm-retry-btn {
  padding: 8px 20px;
  font-size: 14px;
  color: #fff;
  background: var(--stm-primary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.stm-retry-btn:hover {
  opacity: 0.85;
}

/* ===== 警告モーダル ===== */
.stm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  border-radius: 8px;
  padding: 16px;
}

.stm-overlay[hidden] {
  display: none;
}

.stm-dialog {
  background: #fff;
  max-width: 320px;
  width: 100%;
  padding: 24px;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}

.stm-dialog-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--stm-text);
}

.stm-dialog-message {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--stm-text);
}

.stm-countdown {
  font-weight: 700;
  color: var(--stm-danger);
  font-size: 18px;
}

.stm-dialog-actions {
  display: flex;
  gap: 8px;
}

.stm-extend-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  color: #fff;
  background: var(--stm-primary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.stm-extend-btn:hover {
  opacity: 0.85;
}

.stm-logout-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--stm-text-muted);
  background: #fff;
  border: 1.5px solid var(--stm-border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.stm-logout-btn:hover {
  background: #F4F6F9;
  border-color: #9AA5B4;
}

.stm-demo-tip {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--stm-text-muted);
}

/* ===== リセットボタン（.demo-controls / .reset-btn は global.css / example.css に定義がないため必須） ===== */
.demo-controls {
  margin-top: 12px;
}

.reset-btn {
  padding: 6px 16px;
  font-size: 13px;
  color: #5A6A7A;
  background: #fff;
  border: 1.5px solid #D0D7E0;
  border-radius: 6px;
  cursor: pointer;
  font-family: sans-serif;
  transition: background 0.15s, border-color 0.15s;
}

.reset-btn:hover {
  background: #F4F6F9;
  border-color: #9AA5B4;
}

/* ===== レスポンシブ対応 ===== */
@media (max-width: 480px) {
  .stm-dialog {
    padding: 20px;
  }

  .stm-dialog-actions {
    flex-direction: column;
  }
}
