/* Shared by previews and live templates 2–5. Template 1 cannot match. */
.mw-themed .mw-guestbook-heading{display:flex;gap:24px;align-items:flex-start;margin-bottom:30px}
.mw-themed .mw-guestbook-heading h2{margin:10px 0 12px}.mw-themed .mw-guestbook-heading .mw-section-icon{display:none}
.mw-themed .mw-guestbook-emblem{display:grid;place-items:center;width:70px;height:70px;flex-shrink:0;border:1px solid var(--mw-line);border-radius:22px;background:var(--mw-soft);color:var(--mw-accent);font-size:28px;transform:rotate(-6deg)}
.mw-themed .mw-guestbook-caption{font:14px/1.7 var(--mw-body);color:var(--mw-muted);margin:0}
.mw-themed .mw-guestbook-form{padding:28px;border:1px solid var(--mw-line);border-radius:24px;background:var(--mw-surface);box-shadow:var(--mw-shadow)}
.mw-themed .mw-guestbook-editor .mw-demo-field{margin:0;font-weight:600;font-size:13px}
.mw-themed #guestbook .mw-guestbook-editor textarea{display:block;width:100%;min-height:170px;resize:vertical;background:var(--mw-paper)!important;border:1px solid var(--mw-line)!important;color:var(--mw-ink)!important;-webkit-text-fill-color:var(--mw-ink)!important;caret-color:var(--mw-ink)!important;font:16px/1.8 var(--mw-body);border-radius:16px;padding:20px;margin-top:12px;box-shadow:none}
.mw-themed #guestbook .mw-guestbook-editor textarea::placeholder{color:var(--mw-muted)!important;-webkit-text-fill-color:var(--mw-muted)!important;opacity:1}
.mw-themed #guestbook .mw-guestbook-editor textarea:focus{outline:2px solid var(--mw-accent);outline-offset:3px}
.mw-themed .mw-guestbook-actions{display:flex;justify-content:space-between;gap:18px;align-items:center;margin-top:20px}
.mw-themed .mw-guestbook-count{font:500 12px var(--mw-body);font-variant-numeric:tabular-nums;color:var(--mw-muted)}
.mw-themed .mw-guestbook-actions .mw-button{gap:12px;background:var(--mw-ink)!important;color:var(--mw-paper)!important;border:0!important;box-shadow:none}
.mw-themed .mw-guestbook-actions .mw-button:disabled{opacity:.55;cursor:wait;transform:none}
.mw-themed #chatgroup :is(.mw-demo-message,#messages>div,#messages>article){padding:22px;border:1px solid var(--mw-line);border-radius:18px;background:var(--mw-surface);margin-bottom:14px;color:var(--mw-ink)}
.mw-themed #chatgroup .mw-demo-message strong{font:600 13px var(--mw-body)}
@media(max-width:600px){.mw-themed .mw-guestbook-heading{gap:15px}.mw-themed .mw-guestbook-emblem{width:48px;height:48px;border-radius:15px;font-size:21px}.mw-themed .mw-guestbook-form{padding:18px}.mw-themed .mw-guestbook-actions{flex-wrap:wrap}.mw-themed .mw-guestbook-actions .mw-button{width:100%;justify-content:center}}
/* Conversation view — deliberately excluded from the immutable model 1. */
.mw-themed .mw-guestbook-emblem.mw-guest-avatar{border-radius:50%;transform:none;font:600 28px/1 var(--mw-body);background:var(--mw-soft);color:var(--mw-ink)}
.mw-themed #chatgroup .mw-conversation{display:flex;flex-direction:column;gap:24px;max-width:960px;margin:32px auto 0;padding:4px 0;overflow:visible}
.mw-themed #chatgroup .mw-message-row{display:flex!important;align-items:flex-end;justify-content:flex-start;gap:14px;width:100%!important;max-width:none!important;float:none!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;text-align:left!important}
.mw-themed #chatgroup .mw-message-row[data-side="right"]{flex-direction:row-reverse!important}
.mw-themed #chatgroup .mw-message-avatar{display:grid;place-items:center;flex:0 0 48px;width:48px;height:48px;border-radius:50%;border:1px solid var(--mw-line);background:var(--mw-soft);color:var(--mw-ink);font:600 19px/1 var(--mw-body);box-shadow:0 5px 14px #00000008;user-select:none}
.mw-themed #chatgroup .mw-message-bubble{position:relative;min-width:0;width:fit-content;max-width:min(78%,640px);padding:20px 24px;border:1px solid var(--mw-line);border-radius:22px 22px 22px 5px;background:var(--mw-surface);color:var(--mw-ink);box-shadow:var(--mw-shadow);overflow-wrap:anywhere;font:14px/1.75 var(--mw-body)}
.mw-themed #chatgroup .mw-message-row[data-side="right"] .mw-message-bubble{background:var(--mw-soft);border-radius:22px 22px 5px 22px}
.mw-themed #chatgroup .mw-message-bubble :is(p,span,strong,b,h3,h4,h5,h6){color:var(--mw-ink)!important;font-family:var(--mw-body)!important;text-align:left}
.mw-themed #chatgroup .mw-message-bubble :is(strong,b,h3,h4,h5,h6){font-size:12px!important;font-weight:700;margin:0 0 8px;letter-spacing:.025em}
.mw-themed #chatgroup .mw-message-bubble p{font-size:14px;line-height:1.75;margin:8px 0 0;white-space:pre-wrap}
.mw-themed #chatgroup .mw-message-bubble :is(time,small){display:block;font:11px/1.5 var(--mw-body);color:var(--mw-muted)!important;margin-top:10px}
.mw-themed #chatgroup .mw-message-bubble a{color:inherit;text-decoration:underline;text-underline-offset:3px}
@media(max-width:600px){.mw-themed #chatgroup .mw-conversation{gap:20px}.mw-themed #chatgroup .mw-message-row{gap:9px}.mw-themed #chatgroup .mw-message-avatar{flex-basis:36px;width:36px;height:36px;font-size:15px}.mw-themed #chatgroup .mw-message-bubble{max-width:calc(100% - 55px);padding:15px 17px}.mw-themed .mw-guestbook-emblem.mw-guest-avatar{font-size:21px}}
/* The exact loadmessages.php structure: name on a separate line, then message. */
.mw-themed #chatgroup .mw-message-bubble .mw-message-author{display:block!important;margin:0 0 8px!important;font:700 12px/1.5 var(--mw-body)!important;color:var(--mw-ink)!important}
.mw-themed #chatgroup .mw-message-text{display:block;white-space:pre-wrap;font:400 14px/1.75 var(--mw-body);color:var(--mw-ink);overflow-wrap:anywhere}
.mw-themed #chatgroup .mw-message-row[data-side="left"] .mw-message-bubble{background:var(--mw-surface)!important;color:var(--mw-ink)!important}
.mw-themed #chatgroup .mw-message-row[data-side="right"] .mw-message-bubble{background:var(--mw-soft)!important;color:var(--mw-ink)!important}
.mw-themed #messagetext.mw-save-error{color:#a42d2d;background:#fff0ed;border:1px solid #e5a99d;border-radius:12px;padding:14px}
.mw-themed .mw-success-dialog{position:fixed;box-sizing:border-box;width:min(490px,calc(100% - 32px));max-height:90dvh;overflow:auto;margin:auto;padding:48px 32px 32px;border:1px solid var(--mw-line);border-radius:30px;background:var(--mw-surface);color:var(--mw-ink);text-align:center;box-shadow:0 28px 100px #0005}
.mw-themed .mw-success-dialog[open]{animation:mw-success-in .45s cubic-bezier(.2,1,.3,1)}
.mw-themed .mw-success-dialog::backdrop{background:#111a25a6;backdrop-filter:blur(7px)}
.mw-themed .mw-success-dialog h2{font:500 clamp(30px,5vw,42px)/1.15 var(--mw-display);letter-spacing:-.03em;margin:18px 0 12px;color:var(--mw-ink)}
.mw-themed .mw-success-dialog p{font:14px/1.7 var(--mw-body);color:var(--mw-muted);margin:0 0 26px}
.mw-themed .mw-success-close{position:absolute;right:15px;top:13px;width:36px;height:36px;border:1px solid var(--mw-line);border-radius:50%;background:var(--mw-paper);color:var(--mw-ink);font-size:25px;cursor:pointer}
.mw-themed .mw-success-seal{width:86px;height:86px;display:grid;place-items:center;margin:0 auto 22px;border-radius:50%;background:var(--mw-soft);box-shadow:0 0 0 9px var(--mw-paper)}
.mw-themed .mw-success-seal svg{width:57px;height:57px;fill:none;stroke:var(--mw-ink);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}
.mw-themed .mw-success-dialog[open] .mw-success-seal path{stroke-dasharray:50;stroke-dashoffset:50;animation:mw-draw-check .5s .2s ease forwards}
.mw-themed .mw-success-dialog .mw-success-action{justify-content:center;gap:12px;background:var(--mw-ink);color:var(--mw-paper);border:0;min-width:200px}
.mw-themed .mw-confetti{position:absolute;inset:0;pointer-events:none;overflow:hidden;border-radius:inherit}
.mw-themed .mw-confetti span{position:absolute;left:var(--x);top:-15px;width:6px;height:12px;border-radius:2px;background:var(--mw-accent);opacity:0}
.mw-themed .mw-confetti span:nth-child(3n){background:#daaa50}.mw-themed .mw-confetti span:nth-child(3n + 1){background:#68a594}
.mw-themed .mw-success-dialog[open] .mw-confetti span{animation:mw-confetti-fall 1.9s calc(var(--i)*.025s) ease-out both}
@keyframes mw-success-in{from{opacity:0;transform:translateY(20px) scale(.94)}to{opacity:1;transform:none}}
@keyframes mw-draw-check{to{stroke-dashoffset:0}}
@keyframes mw-confetti-fall{0%{opacity:0;transform:translateY(0) rotate(0deg)}15%{opacity:.85}100%{opacity:0;transform:translateY(450px) rotate(var(--r))}}
@media(prefers-reduced-motion:reduce){.mw-themed .mw-success-dialog[open],.mw-themed .mw-success-dialog[open] .mw-success-seal path{animation:none;stroke-dashoffset:0}.mw-themed .mw-confetti{display:none}}
