body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
    background-color: #b2c7da; /* LINEの背景風のブルーグレー */
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    height: 100vh;
    color: #111;
}

#chat-app {
    width: 100%;
    max-width: 480px;
    background-color: #abc1d7; /* トーク画面背景色 */
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.15);
    overflow: hidden;
}

/* URLバナー（上部からの通知演出） */
#url-banner {
    background-color: #2c3e50;
    color: #fff;
    padding: 12px 15px;
    box-sizing: border-box;
    transition: all 0.4s ease;
    z-index: 10;
    border-bottom: 2px solid #1a252f;
    max-height: 150px; /* 中身が収まる十分な高さを設定 */
    overflow: hidden;  /* はみ出た部分を隠す */
}

#url-banner.hidden {
    max-height: 0;         /* 高さを0にして隠す */
    padding-top: 0;        /* 上下の余白も0にする */
    padding-bottom: 0;
    border-bottom-width: 0;/* 下線の太さも0にする */
    opacity: 0;
}

.banner-text {
    margin: 0 0 8px 0;
    font-size: 0.8rem;
    color: #bdc3c7;
    text-align: center;
}

.copy-box {
    display: flex;
    gap: 8px;
}

#share-url {
    flex: 1;
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    background-color: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 0.85rem;
}

#copy-btn {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    white-space: nowrap;
}

/* ヘッダー */
#chat-header {
    background-color: #273246;
    color: white;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    box-sizing: border-box;
    z-index: 5;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 1.1rem;
}

.avatar {
    width: 32px;
    height: 32px;
    background-color: #5d6d7e;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.header-back, .header-menu {
    font-size: 1.2rem;
    cursor: pointer;
    color: #ecf0f1;
}

/* タイムライン */
#chat-timeline {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* 吹き出しの基本構造 */
.msg-row {
    display: flex;
    width: 100%;
}

.msg-bubble {
    max-width: 70%;
    padding: 9px 14px;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
    white-space: pre-wrap;
}

/* ユーザー（相手）のメッセージ（右側） */
.msg-row.user {
    justify-content: flex-end;
}

.msg-row.user .msg-bubble {
    background-color: #7ee269; /* LINE風の黄緑 */
    color: #000;
    border-top-right-radius: 2px;
}

/* Luca（あなた）のメッセージ（左側） */
.msg-row.luca {
    justify-content: flex-start;
}

.msg-row.luca .msg-bubble {
    background-color: #ffffff;
    color: #000;
    border-top-left-radius: 2px;
}

/* フッター（入力欄） */
#chat-footer {
    background-color: #ffffff;
    padding: 10px;
    box-sizing: border-box;
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background-color: #f5f6f8;
    border-radius: 20px;
    padding: 5px 12px;
}

#message-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 6px 0;
    resize: none;
    font-size: 1rem;
    max-height: 100px;
    outline: none;
    font-family: inherit;
}

#send-btn {
    background: none;
    border: none;
    color: #1e88e5;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    margin-bottom: 2px;
}

#send-btn:disabled {
    color: #b0bec5;
}

/* 管理者モード用カード */
.admin-thread-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.admin-history {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.9rem;
}
.admin-reply-box {
    display: flex;
    gap: 8px;
}
.admin-reply-box textarea {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    resize: none;
}