#shop-help-launcher, #shop-help {
    --help-text: #17251c;
    --help-deep: #215838;
    --help-green: #2e7244;
    --help-page: #f3f6f3;
    --help-surface: #fbfdfb;
    --help-line: #d3ded5;
    --help-muted: #4b5e51;
    --help-warm: #fbf0d7;
    --help-hover: #e9f2ea;
}
#shop-help-launcher[hidden], #shop-help [hidden] { display: none !important; }
#shop-help-launcher {
    position: fixed;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    right: var(--help-aligned-right, max(18px, env(safe-area-inset-right)));
    bottom: max(calc(18px + env(safe-area-inset-bottom)), calc(var(--proso-shopping-bottom, 0px) + 10px), var(--help-aligned-bottom, 0px));
    min-height: 48px;
    padding: 6px 15px 6px 8px;
    border: 0;
    border-radius: 999px;
    color: var(--help-deep);
    background: var(--help-surface);
    box-shadow: 0 3px 11px rgb(0 0 0 / .18);
    font: inherit;
    font-weight: 650;
    line-height: 1.2;
}
#shop-help-launcher:hover, #shop-help .close-chat:hover { background: var(--help-hover); }
#shop-help-launcher .help-mark, #shop-help .help-mark {
    position: relative;
    display: grid;
    flex: none;
    width: 31px;
    height: 31px;
    place-items: center;
    border-radius: 50%;
    color: white;
    background: var(--help-green);
}
#shop-help-launcher .floating-icon::after {
    content: "";
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 12px;
    height: 12px;
    border: 2px solid white;
    border-radius: 50%;
    background: #38bb61;
}
#shop-help {
    position: fixed;
    inset: auto max(18px, env(safe-area-inset-right)) 16px auto;
    width: min(412px, calc(100% - 32px));
    height: 492px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid #c6d5cb;
    border-radius: 14px;
    color: var(--help-text);
    background: white;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.45;
}
#shop-help::backdrop { background: rgb(17 35 24 / .24); }
#shop-help[open] { animation: shop-help-reveal .18s ease-out; }
@keyframes shop-help-reveal { from { opacity: .7; transform: translateY(7px); } }
#shop-help .chat { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
#shop-help .chat-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 44px;
    gap: 10px;
    align-items: center;
    padding: 12px 12px 12px 16px;
    border-bottom: 1px solid var(--help-line);
    background: var(--help-surface);
}
#shop-help .help-mark { width: 38px; height: 38px; font-size: 18px; }
#shop-help .chat-head h2 { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
#shop-help .chat-head p { margin: 4px 0 0; color: var(--help-muted); font-size: 14px; }
#shop-help .close-chat {
    position: relative;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 8px;
    color: var(--help-deep);
    background: var(--help-page);
}
#shop-help .close-chat::before, #shop-help .close-chat::after {
    content: "";
    position: absolute;
    width: 17px;
    height: 2px;
    left: calc(50% - 8.5px);
    top: calc(50% - 1px);
    background: currentColor;
    transform: rotate(45deg);
}
#shop-help .close-chat::after { transform: rotate(-45deg); }
#shop-help .messages {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: #a6b9ab transparent;
    padding: 15px;
    background: var(--help-page);
}
#shop-help .bubble {
    width: fit-content;
    max-width: 96%;
    margin-bottom: 11px;
    padding: 10px 12px;
    border: 1px solid var(--help-line);
    border-radius: 12px 12px 12px 4px;
    background: white;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}
#shop-help .bubble p { margin: 0; }
#shop-help .stock-label { white-space: nowrap; }
#shop-help .stock-label::before {
    content: "";
    display: inline-block;
    width: .5em;
    height: .5em;
    margin-inline-end: .32em;
    border-radius: 50%;
    background: currentColor;
    vertical-align: .08em;
}
#shop-help .bubble.visitor {
    margin-left: auto;
    border-color: #e7dcc5;
    border-radius: 12px 12px 4px 12px;
    background: var(--help-warm);
}
#shop-help .bubble a {
    display: flex;
    align-items: center;
    min-height: 34px;
    margin-top: 4px;
    color: var(--help-deep);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
}
#shop-help .topics { display: grid; border: 1px solid var(--help-line); border-radius: 10px; background: white; }
#shop-help .topics button {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 6px 12px 6px 9px;
    border: 0;
    background: transparent;
    color: var(--help-text);
    font: inherit;
    font-weight: 600;
    text-align: left;
}
#shop-help .topics button:first-child { border-radius: 9px 9px 0 0; }
#shop-help .topics button:last-child { border-radius: 0 0 9px 9px; }
#shop-help .topics button + button { border-top: 1px solid var(--help-line); }
#shop-help .topics button:hover { background: var(--help-hover); }
#shop-help .topic-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    color: var(--help-deep);
    background: var(--help-warm);
}
#shop-help .topics .arrow { color: var(--help-muted); font-size: 12px; }
#shop-help .chat-footer { padding: 12px 13px calc(3px + env(safe-area-inset-bottom)); border-top: 1px solid var(--help-line); }
#shop-help .chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; margin: 0; }
#shop-help .chat-form input {
    min-width: 0;
    min-height: 46px;
    border: 1px solid #82958a;
    border-radius: 7px;
    padding: 0 10px;
    color: var(--help-text);
    background: white;
    font: inherit;
    caret-color: var(--help-deep);
}
#shop-help .chat-form input::placeholder { color: var(--help-muted); opacity: 1; }
#shop-help .chat-form button {
    min-height: 46px;
    padding-inline: 10px;
    border: 1px solid var(--help-green);
    border-radius: 7px;
    color: white;
    background: var(--help-green);
    font: inherit;
    font-weight: 650;
}
#shop-help .chat-form button:hover { background: var(--help-deep); }
#shop-help .chat-form button:disabled { opacity: .65; cursor: default; }
#shop-help .notice { margin: 7px 0 0; color: var(--help-muted); font-size: 14px; }
#shop-help .notice.has-error { padding: 7px 9px; border-radius: 7px; color: var(--help-text); background: var(--help-warm); }
#shop-help .staff { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--help-deep); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
#shop-help .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#shop-help-launcher:focus-visible, #shop-help :focus-visible { outline: 2px solid var(--help-deep); outline-offset: 2px; }
#shop-help .messages:focus-visible, #shop-help .topics button:focus-visible { outline-offset: -2px; }
@media (max-width: 991px) {
    #shop-help-launcher { justify-content: center; right: var(--help-aligned-right, max(12px, env(safe-area-inset-right))); width: 44px; height: 44px; min-height: 44px; padding: 0; }
    #shop-help-launcher .floating-label { display: none; }
}
@media (max-width: 540px) {
    #shop-help { inset: auto 0 0; width: 100%; height: 510px; max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); border-radius: 14px 14px 0 0; }
    #shop-help .chat-head { gap: 8px; padding-inline: 13px 9px; }
    #shop-help .help-mark { width: 34px; height: 34px; font-size: 16px; }
    #shop-help .chat-head h2 { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { #shop-help[open] { animation: none; } }
