@font-face{font-family:"Madena Alexandria";src:url("alexandria.woff2") format("woff2");font-style:normal;font-weight:100 900;font-display:swap}
@font-face{font-family:"Madena Caslon";src:url("libre-caslon-display.woff2") format("woff2");font-style:normal;font-weight:400;font-display:swap}

.mdchat {
    --mc-ink:#16302e; --mc-soft:#55635f; --mc-petrol:#406e73; --mc-deep:#2c5155;
    --mc-beige:#ded6cc; --mc-ground:#f3eee6; --mc-panel:#fbf8f3; --mc-line:#16302e33;
    --mc-sans:var(--sans,"Madena Alexandria",system-ui,sans-serif);
    --mc-serif:var(--serif-display,"Madena Caslon",Georgia,serif);
    font:400 14px/1.55 var(--mc-sans);
    color:var(--mc-ink);
}
.mdchat *, .mdchat *::before, .mdchat *::after { box-sizing:border-box; }
.mdchat button, .mdchat input { font:inherit; }
.mdchat button { cursor:pointer; }
.mdchat [hidden] { display:none !important; }
.mdchat :focus-visible { outline:2px solid var(--mc-deep); outline-offset:3px; }
.mdchat-launch {
    border:1px solid transparent; border-radius:999px; padding:12px 19px; min-height:46px;
    display:inline-flex; align-items:center; gap:9px; background:var(--mc-deep);
    color:var(--mc-panel); font-weight:650; box-shadow:0 10px 30px -12px #16302e70;
}
.mdchat-launch:hover,.mdchat-send:hover { background:var(--mc-petrol); }
.mdchat--floating .mdchat-launch {
    position:fixed; z-index:75; right:max(22px,env(safe-area-inset-right));
    bottom:calc(22px + env(safe-area-inset-bottom));
}
.mdchat-dialog {
    position:fixed; inset:auto max(22px,env(safe-area-inset-right)) max(22px,env(safe-area-inset-bottom)) auto;
    width:min(420px,calc(100vw - 44px)); max-width:none; max-height:calc(100vh - 44px);
    max-height:calc(100dvh - 44px); margin:0; padding:0; border:1px solid var(--mc-beige);
    border-radius:26px; background:var(--mc-panel); color:var(--mc-ink); overflow:auto;
    box-shadow:0 30px 70px -25px #16302e85;
}
.mdchat-dialog[open] { display:flex; flex-direction:column; }
.mdchat-dialog::backdrop { background:#16302e54; }
.mdchat-head {
    display:flex; align-items:center; justify-content:space-between; padding:14px 20px;
    background:var(--mc-panel); border-bottom:1px solid var(--mc-line); gap:12px;
}
.mdchat-head img { display:block; width:118px; height:36px; object-fit:contain; object-position:left; }
.mdchat-close {
    width:44px; height:44px; border-radius:50%; border:1px solid var(--mc-line);
    color:var(--mc-deep); background:transparent; font-size:24px !important; line-height:1 !important;
}
.mdchat-close:hover { background:var(--mc-ground); }
.mdchat-log {
    overflow:auto; overscroll-behavior:contain; min-height:0; max-height:min(38vh,330px);
    padding:15px 17px 0;
}
:is(.mdchat-dialog, .mdchat-panel)[data-active] .mdchat-log { padding-top:15px; min-height:min(170px,22vh); }
.mdchat-msg {
    padding:10px 13px; background:#ede7dd; color:var(--mc-ink); border-radius:15px 15px 15px 4px;
    margin:0 18px 9px 0; white-space:pre-line; overflow-wrap:anywhere; font-size:13px;
}
.mdchat-msg p { margin:0; }
.mdchat-msg--user { background:var(--mc-deep); color:var(--mc-panel); margin-right:0; margin-left:24px; border-radius:15px 15px 4px 15px; }
.mdchat-links { display:flex; flex-wrap:wrap; gap:5px 13px; margin-top:8px; }
.mdchat-links a, .mdchat-actions a { color:var(--mc-deep); text-decoration:underline; text-underline-offset:3px; font-weight:600; }
.mdchat-options { display:flex; flex-wrap:wrap; align-content:flex-start; gap:6px; padding:10px 17px 14px; max-height:120px; overflow:auto; }
.mdchat-options button {
    border:1px solid var(--mc-line); border-radius:999px; background:var(--mc-panel);
    color:var(--mc-deep); font-size:12px; font-weight:600; padding:7px 11px; min-height:34px;
}
.mdchat-options button:hover { border-color:var(--mc-petrol); background:#406e7314; }
.mdchat-compose { background:var(--mc-panel); border-top:1px solid var(--mc-line); padding:13px 17px 12px; }
.mdchat-form { display:flex; align-items:center; gap:7px; margin:0; }
.mdchat-form input { min-width:0; flex:1; background:white; color:var(--mc-ink); border:1px solid var(--mc-line); border-radius:12px; min-height:44px; padding:8px 11px; font-size:16px; }
.mdchat-send { flex:0 0 44px; min-height:44px; display:grid; place-items:center; color:var(--mc-panel); background:var(--mc-deep); border:0; border-radius:12px; }
.mdchat-send:disabled { opacity:.6; cursor:wait; }
.mdchat-compose p { margin:7px 0 5px; color:var(--mc-soft); font-size:11px; }
.mdchat-actions { display:flex; justify-content:space-between; gap:10px; font-size:11px; }
.mdchat-actions button { border:0; background:transparent; padding:0; color:var(--mc-deep); text-decoration:underline; text-underline-offset:3px; font-size:inherit; font-weight:600; }
.mdchat-sr { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

@media (max-width:900px) {
    .mdchat--floating .mdchat-launch { bottom:calc(79px + env(safe-area-inset-bottom)); right:14px; }
}
@media (max-width:500px) {
    .mdchat-dialog {
        inset:auto 8px max(8px,env(safe-area-inset-bottom)) 8px; width:auto;
        max-height:calc(100vh - 16px); max-height:calc(100dvh - 16px); border-radius:22px;
    }
    .mdchat-head { padding:9px 15px; }
    .mdchat-options button { min-height:40px; }
}
.mdchat-identity { display:grid; justify-items:start; gap:2px; }
.mdchat-identity span { color:var(--mc-soft); font-size:11px; font-weight:600; }
.mdchat-status:not(:empty) { padding:1px 17px 5px; color:var(--mc-soft); font-size:11px; }
.mdchat-options:empty { padding:0; }


.mdchat--inline {
    width:100%;
    max-width:700px;
    margin:clamp(20px,4vw,40px) auto;
}
.mdchat-panel {
    width:100%; min-width:0; color:var(--mc-ink); background:var(--mc-panel);
    border:1px solid var(--mc-beige); border-radius:26px; overflow:hidden;
    box-shadow:0 20px 50px -35px #16302e80;
}
.mdchat-panel .mdchat-log { max-height:clamp(180px,40dvh,350px); }
.mdchat-panel .mdchat-head { justify-content:flex-start; }
.mdchat-panel .mdchat-options { max-height:135px; }
.mdchat-panel .mdchat-compose { margin:0; }
@media (max-width:500px) {
    .mdchat-panel { border-radius:20px; }
    .mdchat-panel .mdchat-links a { overflow-wrap:anywhere; }
}
.mdchat--in-header {
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    width:100%;
    padding:0 12px;
}
.mdchat--in-header .mdchat-launch {
    position:static;
    margin:4px 0 8px;
    min-height:38px;
    padding:5px 12px;
    box-shadow:none;
    font-size:13px;
}
.mdchat--in-header .mdchat-dialog {
    position:static;
    width:100%;
    max-width:520px;
    max-height:52vh;
    max-height:min(430px,52dvh);
    margin:0 0 9px;
    border-radius:16px;
    box-shadow:none;
    overflow:auto;
    overscroll-behavior:contain;
}
.mdchat--in-header .mdchat-dialog[open] { display:block; }
.mdchat--in-header .mdchat-head { padding:5px 12px; }
.mdchat--in-header .mdchat-head img { height:26px; }
.mdchat--in-header .mdchat-close { width:38px; height:38px; }
.mdchat--in-header .mdchat-log { max-height:min(24vh,180px); }
.mdchat--in-header .mdchat-dialog[data-active] .mdchat-log { min-height:0; }
.mdchat--in-header .mdchat-options { padding:6px 12px; gap:4px; max-height:86px; }
.mdchat--in-header .mdchat-options button { min-height:32px; }
.mdchat--in-header .mdchat-compose { padding:8px 12px; }