body {
    font-family: "Noto Sans JP", "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", "メイリオ", Meiryo, Osaka, "ＭＳ Ｐゴシック", "MS PGothic", "sans-serif";
    margin: 0;
    padding: 20px;
    background: #f5f5f5;
}

.demo-content {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* =========================
   WIDGET CONTAINER
========================= */

.widget-container {
    width: 400px;
    height: 600px;
    position: fixed;
    right: 20px;
    bottom: 13px; /* Base position on screen */
    z-index: 10000;
    font-family: Arial, sans-serif;
    transition: transform 0.5s ease, bottom 0.5s ease;
    
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;

    /* CLOSED STATE: Shifting it down so only the header shows */
    /* Adjust '60px' to match the height of your red header bar */
    transform: translateY(calc(100% - 60px));
}

.widget-container.open {
    bottom: 20px;
	transform: translateY(0);
}

.widget-container.open .redBtn2::after {
    transform: rotate(180deg);
}

/* =========================
   BUTTONS
========================= */

.redBtn1,
.redBtn2 {
    width: 210px;
    border: none;
    color: white;
    cursor: pointer;
    background-color: #52C0E2;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
    font-family: "Noto Sans JP", "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", "メイリオ", Meiryo, Osaka, "ＭＳ Ｐゴシック", "MS PGothic", "sans-serif";
    padding: 3px 0;
	text-align: center !important;
}

/* left icon */
.redBtn1::before,
.redBtn2::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 10px;
    margin: auto;
    width: 36px;
    height: 23px;
    background: url(img/houkoku_chatbot_icon.svg) center no-repeat;
    background-size: cover;
}

/* right arrow */
.redBtn1::after,
.redBtn2::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 10px;
    margin: auto;
    width: 10px;
    height: 5px;
    background: url(img/arr_down.svg) center no-repeat;
    background-size: cover;
}

/* chat title */
.redBtn1 .chatTitle,
.redBtn2 .chatTitle {
    font-size: 12px;
    font-weight: 700;
    display: block;
    text-align: center;
}

/* =========================
   REDBTN2 SPECIAL
========================= */

.redBtn2 {
    width: 100%;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    padding: 13px 0;
	flex-shrink: 0;
}

/* .redBtn2::before {
    left: 39px;
} */

.redBtn2::after {
    right: 39px;
    background: url(img/arr_up.svg) center no-repeat;
    background-size: cover;
    transition: all 0.5s;
    transform: rotate(0deg);
}

.redBtn2 img {
    display: none;
}

.redBtn2 .chatTitle {
    font-size: 16px;
}

/* =========================
   CHAT STRUCTURE
========================= */

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(12, 23, 99, 0.2);
}

.chat-header {
    background-color: #52C0E2;
    color: white;
    padding: 15px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
}

.chat-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.chat-close-btn:hover {
    opacity: 0.8;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #D9D9D9;
}

.message {
    margin-bottom: 10px;
    display: flex;
}

.agent-message {
    justify-content: flex-start;
}

.agent-message p {
    background-color: #fff;
    padding: 10px 12px;
    border-top-left-radius: 20px;
	border-top-right-radius: 20px;
	border-bottom-right-radius: 20px;
    margin: 0;
    max-width: 80%;
	min-width: 230px;
	font-size: 12px;
}

.user-message {
    justify-content: flex-end;
}

.user-message p {
	word-wrap: break-word;
	background-color: #fff;
    color: #000;
    padding: 10px 12px;
    border-top-left-radius: 20px;
	border-top-right-radius: 20px;
	border-bottom-left-radius: 20px;
    margin: 0;
    max-width: 80%;
	min-width: 230px;
	font-size: 12px;
}

/* =========================
   INPUT AREA
========================= */

.chat-input-area {
	position: relative;
    padding: 12px;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 8px;
    background: #0374e4;
	flex-shrink: 0;
}

.chat-input {
    flex: 1;
    padding: 8px 45px 8px 12px;
    border: 1px solid #ccc;
    border-radius: 16px;
    font-size: 12px;
    resize: none;
	outline: none;
	min-height: 30px;
	box-sizing: border-box;
	scrollbar-width: none;
}

.chat-input::-webkit-scrollbar {
  display: none;         /* Chrome, Safari, Edge */
}

.chat-send-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	right: 20px;
    padding: 8px 16px;
    background-color: #52C0E2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
	background: url(img/send_msg_icon.png)no-repeat center;
	background-size: contain;
	width: 20px;
	height: 20px;
}

.mail-form-container,
.mail-complete {
	max-width: 300px;
	width: 100%;
	margin: 0 auto;
	background: #fff;
	border-radius: 5px;
	padding: 14px 20px 16px;
	box-sizing: border-box;
	font-size: 10px;
}

.mail-form-container.hide {
	display: none;
}

.mail-complete {
	min-height: 400px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
}

.mail-complete p {
	text-align: center;
	line-height: 20px;
	margin: 62px 0 70px;
}

.mail-complete.hide {
	display: none;
}

.mail-form-container h2,
.mail-complete h2 {
	color: #0058ac;
	margin: 0 0 10px 0;
}

.mail-form-container p {
	margin: 0;
}

.mail-form-container .content {
	margin-bottom: 20px;
}

.mail-form-container .notice {
	color: #C93E3E;
	margin-bottom: 10px;
}

.mail-form-container .description {
	margin-bottom: 13px;
}

.mail-form-container input {
	outline: none;
	border: 1px solid #9C9C9C;
	border-radius: 5px;
	margin-bottom: 6px;
	padding: 5px;
	width: 100%;
    box-sizing: border-box;
}

.mail-form-container label {
	display: block;
	color: #0058ac;
	font-weight: 700;
	font-weight: bold;
	margin-bottom: 8px;
}

.mail-form-container label span {
	font-weight: 400;
	font-style: unset;
}

.mail-form-container input::placeholder {
	color: #9C9C9C;
	font-size: 10px;
}

.mainTitle {
	font-size: 16px;
}

.desTitle {
	font-size: 12px;
}

#chat-question {
  max-height: 80px;
  overflow-y: auto;
  padding-right: 8px; /* space so text doesn't touch scrollbar */
}

/* ===== Chrome, Edge, Safari ===== */
#chat-question::-webkit-scrollbar {
  width: 6px;
}

#chat-question::-webkit-scrollbar-track {
  background: #e5e5e5;
  border-radius: 10px;
}

#chat-question::-webkit-scrollbar-thumb {
  background-color: #1e6bd6; /* blue dot */
  border-radius: 10px;
}

#chat-question::-webkit-scrollbar-thumb:hover {
  background-color: #1558b0;
}

/* ===== Firefox ===== */
#chat-question {
  scrollbar-width: thin;
  scrollbar-color: #1e6bd6 #e5e5e5;
}


button[type="submit"] {
	color: #fff;
	border: 1px solid #0B967C;
	cursor: pointer;
	font-size: 12px;
	background: #fff;
	border-radius: 5px;
	box-sizing: border-box;
	padding: 7px 0;
}

button.cancle {
	color: #0B967C;
	min-width: 100px;
	text-align: center !important;
}

button.okay {
	background-color: #0B967C;
	min-width: 64px;
	text-align: center !important;
}

.btnGp {
	display: flex;
	justify-content: center;
	gap: 13px;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {

    .widget-container {
        width: 100vw;
        height: 100vh;
        /* bottom: calc(-100vh + 80px); */
		max-height: 100vh;
        right: 0;
		bottom: 0;
		transform: translateY(calc(100% - 80px)); 
        transition: transform 0.5s ease;
    }

	.widget-container.open {
		bottom: 0;
		background: #D9D9D9;
		transform: translateY(0);
	}

    .widget-container.open .redBtn2 {
        background-color: #52C0E2 !important;
		height: unset;
    }

    /* .widget-container.open .redBtn2::before, */
    .widget-container.open .redBtn2::after {
        display: block;
    }
	
    .widget-container.open .redBtn2::after {
			position: absolute;
			top: 0;
			bottom: 0;
			right: 39px;
			margin: auto;
			width: 10px;
			height: 5px;
			background: url(img/arr_down.svg) center no-repeat;
			background-size: cover;
			transform: rotate(360deg);
    }

    .widget-container.open .redBtn2 .chatTitle {
        display: block;
    }

    .widget-container.open .redBtn2 img {
        display: none !important;
    }

	.widget-container.open .chat-container {
		height: calc(100vh - 48px);
	}

    .redBtn2 {
        width: 100%;
        background-color: transparent;
		height: 90px;
		border-radius: unset;
    }

    .redBtn2 .chatTitle {
        display: none;
    }

    /* .redBtn2::before, */
    .redBtn2::after {
        display: none;
    }

	.redBtn2::after {
		content: "";
        display: block;
        position: absolute;
        right: 8px;
        top: 8px;
        transform: translateY(-50%);
        width: 55px;
        height: 55px;
        background: url("img/icon_chat_sp.png") center no-repeat;
        background-size: contain;
	}

    .redBtn2 img {
        width: 51px;
        display: block;
        margin: 0 10px 0 auto;
    }

    .demo-content {
        padding: 15px;
        margin: 0 10px;
    }
}

/* =========================
   VIEW SWITCHING (CHAT / MAIL)
========================= */

.chat-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#mail-form-view,
#mail-complete-view {
    height: 100%;
    overflow-y: auto;
}
