/* All rules belong to this component; the host page keeps its own typography. */
.tkano-material-guide {
    --guide-surface: #f2e7dc;
    --guide-text: #29221e;
    --guide-action: #ff654e;
    --guide-action-hover: #f5533c;
    --guide-action-text: #fff;
    --guide-focus: #33251b;
    --guide-shadow: 0 .3125em 1.5625em rgb(0 0 0 / 8%);
    --guide-radius: .4375em;
    --guide-space-xs: .25em;
    --guide-space-sm: .5em;
    --guide-space-md: .75em;
    --guide-space-lg: 1em;
    --guide-space-xl: 1.5em;
    --guide-width: clamp(18.75em, 25vw, 21.25em);
    --guide-trigger-width: 4.5em;
    --guide-control-size: 2.25em;
    --guide-edge-gap: 1.25em;
    --guide-compact-gap: var(--guide-space-sm);
    --guide-expanded-gap: var(--guide-space-xl);
    --guide-layer: 900;
    --guide-motion-duration: .3s;
    --guide-motion-easing: ease-out;

    position: fixed;
    inset-block-start: calc(var(--guide-header-offset, 0px) + var(--guide-compact-gap));
    inset-inline-end: 0;
    z-index: var(--guide-layer);
    inline-size: fit-content;
    max-inline-size: calc(100% - var(--guide-edge-gap));
    color: var(--guide-text);
    font-family: inherit;
    font-size: inherit;
    line-height: 1.4;
    text-align: start;
    pointer-events: none;
}

.tkano-material-guide[hidden] {
    display: none;
}

/* Local normalization, with no global reset and no ID selectors. */
.tkano-material-guide :where(.tkano-guide-disclosure, .tkano-guide-trigger, .tkano-guide-panel, .tkano-guide-copy, .tkano-guide-question, .tkano-guide-intro, .tkano-guide-download, .tkano-guide-close, .tkano-guide-icon) {
    box-sizing: border-box;
}

.tkano-material-guide .tkano-guide-disclosure {
    margin: 0;
    padding: 0;
    border: none;
}

.tkano-material-guide .tkano-guide-disclosure[open] {
    inline-size: var(--guide-width);
    max-inline-size: 100%;
}

.tkano-material-guide .tkano-guide-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--guide-space-sm);
    min-inline-size: var(--guide-trigger-width);
    min-block-size: var(--guide-control-size);
    margin: 0;
    padding: var(--guide-space-xs) var(--guide-space-sm);
    border: none;
    border-radius: var(--guide-radius) 0 0 var(--guide-radius);
    background: var(--guide-surface);
    color: inherit;
    font: inherit;
    list-style: none;
    cursor: pointer;
    pointer-events: auto;
}

.tkano-material-guide .tkano-guide-trigger::-webkit-details-marker {
    display: none;
}

.tkano-material-guide .tkano-guide-trigger::marker {
    content: "";
}

.tkano-material-guide .tkano-guide-disclosure[open] > .tkano-guide-trigger {
    display: none;
}

.tkano-material-guide .tkano-guide-panel {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--guide-space-md);
    margin-block-start: calc(var(--guide-expanded-gap) - var(--guide-compact-gap));
    padding: var(--guide-space-lg) var(--guide-space-xl) var(--guide-space-lg) var(--guide-space-lg);
    border: none;
    border-radius: var(--guide-radius) 0 0 var(--guide-radius);
    background: var(--guide-surface);
    box-shadow: var(--guide-shadow);
    pointer-events: auto;
}

.tkano-material-guide .tkano-guide-copy {
    display: grid;
    flex: 1 1 10em;
    gap: var(--guide-space-xs);
    min-inline-size: 0;
}

.tkano-material-guide .tkano-guide-question {
    margin: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.tkano-material-guide .tkano-guide-intro {
    margin: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    font-size: .8125em;
}

.tkano-material-guide .tkano-guide-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-block-size: 2.5em;
    margin: 0;
    padding: var(--guide-space-sm) var(--guide-space-md);
    border: none;
    border-radius: var(--guide-radius);
    background: var(--guide-action);
    color: var(--guide-action-text);
    font: inherit;
    font-size: .875em;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.tkano-material-guide .tkano-guide-download:where(:link, :visited, :focus, :active) {
    color: var(--guide-action-text);
    text-decoration: none;
}

.tkano-material-guide .tkano-guide-download:hover {
    background: var(--guide-action-hover);
    color: var(--guide-action-text);
    text-decoration: none;
}

.tkano-material-guide .tkano-guide-close {
    position: absolute;
    inset-block-start: 0;
    inset-inline-end: 0;
    display: grid;
    place-items: center;
    inline-size: var(--guide-space-xl);
    block-size: var(--guide-space-xl);
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.tkano-material-guide .tkano-guide-icon {
    display: block;
    flex-shrink: 0;
    inline-size: 1em;
    block-size: 1em;
    pointer-events: none;
}

.tkano-material-guide .tkano-guide-close .tkano-guide-icon {
    inline-size: var(--guide-space-md);
    block-size: var(--guide-space-md);
}

.tkano-material-guide :where(.tkano-guide-trigger, .tkano-guide-download, .tkano-guide-close):focus-visible {
    outline: .125em solid var(--guide-focus);
    outline-offset: .1875em;
}

/* Static presentation is the default; motion is an explicit preference. */
@media (prefers-reduced-motion: no-preference) {
    .tkano-material-guide .tkano-guide-disclosure[open] > .tkano-guide-panel {
        animation: tkano-guide-enter var(--guide-motion-duration) var(--guide-motion-easing) both;
    }

    @keyframes tkano-guide-enter {
        from {
            opacity: 0;
            transform: translateX(100%);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
}

@media (forced-colors: active) {
    .tkano-material-guide :where(.tkano-guide-panel, .tkano-guide-trigger, .tkano-guide-download) {
        outline: 1px solid CanvasText;
        box-shadow: none;
    }
}
