.side-menu{
    background: #fff;
}
body {
    font-family: Arial, sans-serif;
    color: #333;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}
input#message {
    width: 100%;
    padding: 10px 10px;
    border: 0px;
}


.submit-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    margin-left: 10px;
}

.submit-button:hover {
    background-color: #0056b3;
}

/* ボタンのローディングスタイル */
.submit-button.loading {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* ローディング中の点滅アニメーション */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.chat-input-container.loading input[type="text"] {
    color: #aaa;
    animation: blink 1s infinite;
}

@media (max-width: 768px) {
    .side-menu {
        display: none; 
    }
    .chat-form{
        width: 100%;
        margin-left: 0px;
    }
    .back-link{
        width: 100%;
    }
}

/* 旧 .lesson 系スタイルを統一デザインへ刷新 */
.lesson,
.lesson * { box-sizing: border-box; }

/* ベース */
.lesson {
  font-size: 16px;
  line-height: 1.8;
  color: #111827;
}
@media (max-width: 769px) {
  .lesson { font-size: 14px; }
}

/* 見出し */
.lesson h1,
.lesson h2,
.lesson h3,
.lesson h4,
.lesson h5,
.lesson h6 {
  font-weight: 700;
  line-height: 1.4;
  margin: 1.25em 0 .6em;
}
.lesson h1 {
    position: relative;
    padding-left: 1rem;
    margin-top: 0;
}
.lesson h1::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 1.2em;
    background-color: #2563eb;
    border-radius: 2px;
}
.lesson h2 {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: .25rem;
  margin-top: 2.5rem;
}
.lesson h1 { font-size: 1.6em; }
.lesson h2 { font-size: 1.4em; }
.lesson h3 { font-size: 1.2em; }
.lesson h4 { font-size: 1.1em; }
.lesson h5,
.lesson h6 { font-size: 1em; }

/* 段落・リンク */
.lesson p {
  margin: 1rem 0;
  white-space: break-spaces;
}
.lesson a {
  color: #2563eb;
}
.lesson a:visited { color: #2563eb; }

/* 引用 */
.lesson blockquote {
  color: #4b5563;
  border-left: 4px solid #e5e7eb;
  padding: .3rem 1rem;
  margin: 1.5rem 0;
  background-color: #f9fafb;
}

/* リスト */
.lesson ul,
.lesson ol {
  margin: 1rem 0;
  padding-left: 1.5em;
}
.lesson ul { list-style: disc; }
.lesson ol { list-style: decimal; }
.lesson li + li { margin-top: .25rem; }
.lesson .task-list-item { list-style: none; }
.lesson .task-list-item-checkbox {
  margin: 0 .5em 0 -1.5em;
}

/* テーブル */
.lesson table {
  border-collapse: collapse;
  margin: 1rem 0;
  display: block;
  overflow: auto;
  width: 100%;
}
.lesson th,
.lesson td {
  border: 1px solid #e5e7eb;
  padding: .5rem .75rem;
  vertical-align: top;
  text-align: left;
}
.lesson thead th {
  background: #f9fafb;
  font-weight: 700;
}
.lesson tbody tr:nth-child(odd) td { background: #fafafa; }

/* 画像 */
.lesson img {
  max-width: 100%;
  background: #fff;
  margin: 1rem 0;
}

/* 区切り線・脚注 */
.lesson hr {
  border: 0;
  height: 1px;
  background: #e5e7eb;
  margin: 3rem 0;
}
.lesson section.footnotes {
  font-size: .9em;
  border-top: 1px solid #e5e7eb;
  margin-top: 2rem;
  padding-top: .5rem;
}

/* 見出しパーマリンク（必要なら） */
.lesson a.headerlink {
  color: #9ca3af;
  text-decoration: none;
  margin-left: .25em;
  visibility: hidden;
}
.lesson h1:hover .headerlink,
.lesson h2:hover .headerlink,
.lesson h3:hover .headerlink,
.lesson h4:hover .headerlink,
.lesson h5:hover .headerlink,
.lesson h6:hover .headerlink {
  visibility: visible;
}

/* 旧スタイルとの競合除去用（念のため） */
.lesson h1,
.lesson h2,
.lesson h3,
.lesson h4 { padding-top: 0; }
.lesson ol,
.lesson ul { margin-bottom: 0; }

.login-popup-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.login-popup-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    position: relative;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);
}

.login-popup-card p {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.login-popup-card .login-button {
    background-color: #2563eb;
    color: white;
    padding: 15px 30px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    width: fit-content;
    margin: 0px auto 8px;
    display: block;
}

.close-login-popup {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
}
.register-link{
    font-size: 12px;
    text-decoration: underline;
}

/* === 追加: .lesson 用コピー ボタン（旧デザイン保持） === */
.lesson pre { position: relative; }
.lesson pre > button.copy-button {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 12px;
  line-height: 1;
  padding: 4px 8px;
  background: rgba(0,0,0,.55);
  color: #f3f4f6;
  border: 1px solid #374151;
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.lesson pre > button.copy-button:hover {
  background: rgba(0,0,0,.75);
  color: #ffffff;
}