/* Tool-only details; the site's existing outer frame and colours remain authoritative. */
body[data-tool] .tool-share-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    box-sizing: border-box;
    width: 100%;
    min-height: 48px;
    padding: .8rem 1rem;
    margin: 1.25rem auto !important;
    align-self: center;
    flex-shrink: 0;
    border: 1px solid #c9a06366;
    border-radius: 12px;
    color: #c9a063;
    background: transparent;
    font: inherit;
    font-size: .9rem;
    line-height: 1.5;
    cursor: pointer;
    transition: border-color .18s, background-color .18s;
}
body[data-tool] .tool-share-button:hover { border-color: #c9a063; background: #c9a0630a; }
body[data-tool] .tool-share-button:focus-visible { outline: 2px solid #c9a063; outline-offset: 4px; }
body[data-tool] .swal2-popup { max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); overflow-y: auto; overscroll-behavior: contain; }
body[data-tool] .swal2-html-container { overflow-wrap: anywhere; word-break: break-word; }
body[data-tool] .swal2-image, body[data-tool] .swal2-html-container img { max-width: 100%; height: auto; }
body[data-tool] .swal2-actions { position: sticky; bottom: 0; width: 100%; margin-inline: 0; padding-block: .6rem; background: inherit; z-index: 2; }
body[data-tool="tool_bazi"] #resName { padding-inline: 3rem; line-height: 1.6; }
body[data-tool="tool_bazi"] :where(#resInfo,#resBaZiBase) { max-width: 100%; overflow-wrap: anywhere; }
body[data-tool="tool_almanac"] :where([id^="val-"],#list-hours .truncate) { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.tool-share-icon { width: 19px; height: 19px; flex: 0 0 19px; }
body[data-tool] :where(#btn-share,#btn-share-poster) { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
body[data-tool] .tool-emblem-row { display: flex; justify-content: center; }
body[data-tool] .tool-emblem {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px !important;
    height: 96px;
    flex: 0 0 96px;
    margin-inline: auto;
    border: 1px solid #c9a06399;
    border-radius: 50%;
    color: #c9a063;
    background: #1a1a1a;
    box-shadow: 0 0 20px #c9a06320;
}
body[data-tool] .tool-emblem--compact { width: 64px !important; height: 64px; flex-basis: 64px; }
.tool-taiji { width: 42px; height: 42px; display: block; flex: none; }
.tool-emblem--compact .tool-taiji { width: 32px; height: 32px; }
body[data-tool] .tool-action-icon { display: inline-block; width: 1.2em; text-align: center; vertical-align: -.05em; }
body[data-tool] :where(input,textarea)::placeholder { color: #9098a1; opacity: 1; }
body[data-tool] input[type="date"] { color-scheme: dark; }
body[data-tool] :where(select,input[type="text"],input[type="date"],input[type="number"]) { min-height: 44px; }
body[data-tool="tool_almanac"] main.site-shell { padding-bottom: calc(7.5rem + env(safe-area-inset-bottom)) !important; }
body[data-tool="tool_almanac"] #btn-share-poster { margin-bottom: 0; }
body[data-tool="tool_almanac"] .tool-date-nav { bottom: calc(1rem + env(safe-area-inset-bottom)); max-width: calc(100vw - 2rem); }
@media (max-width: 47.999rem) {
    body[data-tool] :where(select,input[type="text"],input[type="date"],input[type="number"],textarea) { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    body[data-tool] .tool-emblem { animation: none; }
    body[data-tool] .tool-share-button { transition: none; }
}
