.guestbook{max-width:980px;margin:0 auto;padding:0}

:root{
	--gb-primary:#7839ee;
	--gb-text:#111827;
	--gb-muted:#6b7280;
	--gb-border:rgba(0,0,0,.08);
	--gb-soft:#f3f4f6;
	--gb-bubble:#f3f4f6;
	--gb-shadow:0 25px 70px rgba(17,24,39,0.12);
}

.gb-top{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin:6px 0 12px}
.gb-title{margin:6px 0 12px;font-size:28px;line-height:1.15;color:var(--gb-text)}
.gb-subtitle{color:var(--gb-muted);margin-top:4px}

.gb-alert{border-radius:14px;padding:10px 12px;margin:12px 0;border:1px solid var(--gb-border);background:#fff;color:var(--gb-text)}
.gb-alert--error{background:rgba(220,53,69,.08);border-color:rgba(220,53,69,.22)}

.gb-chat{border:1px solid var(--gb-border);background:#fff;overflow:hidden;box-shadow:var(--gb-shadow)}

.gb-thread{max-height:70vh;overflow:auto;padding:18px 18px 12px;background:var(--gb-soft)}

.gb-msg{display:flex;gap:10px;align-items:flex-end;margin:10px 0;color:var(--gb-text)}

.gb-msg--me{flex-direction:row-reverse}
.gb-msg--me .gb-bubble__head{justify-content:flex-end}
.gb-msg--me .gb-time{margin-left:0}
.gb-msg--me .gb-site{display:none}

.gb-avatar{width:40px;height:40px;border-radius:999px;display:flex;align-items:center;justify-content:center;font-weight:900;
	background:#fff;border:1px solid var(--gb-border);color:var(--gb-text);flex:0 0 auto}
.gb-avatar--admin{background:rgba(245,158,11,.10);border-color:rgba(245,158,11,.25)}

.gb-bubble{position:relative;flex:0 1 auto;min-width:0;max-width:75%;background:var(--gb-bubble);border:1px solid rgba(0,0,0,.06);
	border-radius:18px;border-bottom-left-radius:0;padding:10px 12px;box-shadow:0 6px 22px rgba(17,24,39,.08)}

.gb-msg--me .gb-bubble{background:var(--gb-primary);border-color:rgba(120,57,238,.35);color:#fff;border-bottom-left-radius:18px;border-bottom-right-radius:0}

.gb-bubble__head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:6px;font-size:12px;color:rgba(17,24,39,.72)}
.gb-msg--me .gb-bubble__head{color:rgba(255,255,255,.86)}

.gb-name{font-weight:900}
.gb-site{opacity:.85;text-decoration:none;font-size:12px;color:inherit}
.gb-site:hover{text-decoration:underline}
.gb-time{margin-left:auto;opacity:.9;font-size:12px;white-space:nowrap}

.gb-del{position:absolute;top:8px;right:10px;width:26px;height:26px;border-radius:999px;display:flex;align-items:center;justify-content:center;
	text-decoration:none;color:inherit;border:1px solid rgba(0,0,0,.08);background:rgba(255,255,255,.85);
	opacity:0;pointer-events:none;transition:opacity .15s ease, transform .15s ease}
.gb-msg:hover .gb-del{opacity:1;pointer-events:auto}
.gb-del:hover{transform:scale(1.03);background:#fff}
.gb-msg--me .gb-del{right:auto;left:10px;background:rgba(0,0,0,.18);border-color:rgba(255,255,255,.18)}
.gb-msg--me .gb-del:hover{background:rgba(0,0,0,.26)}

.gb-bubble__body{line-height:1.55;overflow-wrap:anywhere}

.gb-badge{display:inline-flex;align-items:center;border-radius:999px;padding:2px 8px;font-size:12px;font-weight:800}
.gb-badge--admin{background:rgba(245,158,11,.14);border:1px solid rgba(245,158,11,.30);color:rgba(17,24,39,.92)}

.gb-nav{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin:14px 0 0}
.gb-nav__item{min-width:38px;text-align:center;border-radius:12px;padding:8px 10px;border:1px solid var(--gb-border);
	text-decoration:none;color:var(--gb-text);background:#fff}
.gb-nav__item:hover{background:rgba(17,24,39,.03)}
.gb-nav__item.is-active{background:rgba(120,57,238,.10);border-color:rgba(120,57,238,.30);color:var(--gb-text)}

.gb-empty{color:var(--gb-muted);padding:8px 0;text-align:center}

.gb-compose{border-top:1px solid rgba(0,0,0,.06);background:#fff;padding:14px}

.gb-form{margin:0}
.gb-form__row{margin:10px 0}
.gb-form__row--as{color:var(--gb-muted)}
.gb-label{display:block;margin-bottom:6px;font-weight:800;color:var(--gb-text)}

.gb-input{box-sizing:border-box;border-radius:16px;border:1px solid rgba(0,0,0,.08);background:var(--gb-soft);color:var(--gb-text);padding:10px 12px;outline:none;width:100%}
.gb-input:focus{border-color:rgba(120,57,238,.35);box-shadow:0 0 0 4px rgba(120,57,238,.10)}

.gb-composer{position:relative}
.gb-input--msg{min-height:48px;max-height:140px;resize:none;overflow:auto;border-radius:999px;padding-right:108px}

.gb-iconbtn{position:absolute;right:58px;top:50%;transform:translateY(-50%);
	width:40px;height:40px;border-radius:999px;border:1px solid rgba(0,0,0,.06);background:#fff;color:var(--gb-text);cursor:pointer;font-size:18px;
	box-shadow:0 6px 18px rgba(17,24,39,.08)}
.gb-iconbtn:hover{background:rgba(17,24,39,.03)}

.gb-send{position:absolute;right:6px;top:50%;transform:translateY(-50%);
	width:44px;height:44px;border:none;border-radius:999px;background:var(--gb-primary);color:#fff;cursor:pointer;font-weight:900;
	box-shadow:0 12px 24px rgba(120,57,238,.26)}
.gb-send:hover{filter:brightness(1.05)}
.gb-send:active{transform:translateY(-50%) scale(.98)}
.gb-send__icon{font-size:16px;line-height:1}

.gb-emoji-panel{margin-top:10px;display:grid;grid-template-columns:repeat(10, 1fr);gap:6px;padding:10px;
	border-radius:16px;border:1px solid rgba(0,0,0,.08);background:#fff;box-shadow:0 18px 40px rgba(17,24,39,.12);
	width:340px;max-width:100%;margin-left:auto}
.gb-emoji__btn{border:1px solid rgba(0,0,0,.08);background:var(--gb-soft);border-radius:12px;padding:6px 0;cursor:pointer;color:inherit}
.gb-emoji__btn:hover{background:#fff}

.gb-form__row--captcha{display:grid;grid-template-columns:130px 1fr;gap:10px;align-items:center}
.gb-captcha{display:inline-flex;align-items:center;justify-content:center}
.gb-captcha img{border-radius:12px;width:130px;height:46px;object-fit:cover;display:block}

@media (max-width: 640px){
	.gb-thread{max-height:none}
	.gb-bubble{max-width:86%}
	.gb-emoji-panel{grid-template-columns:repeat(8, 1fr)}
}
