/* An opt-in showcase; never reserve space in the learning layout. */
.sister-apps-btn[aria-expanded="true"] {
    color: #67548c;
    background: #eee7fa;
    border-color: #cbbce6;
}
.sister-apps-picto {
    display: inline-block;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    background: currentColor;
    -webkit-mask: var(--sister-apps-icon) center / contain no-repeat;
    mask: var(--sister-apps-icon) center / contain no-repeat;
}
.sister-apps-close-picto { --sister-apps-icon: url('assets/ui/close-rounded.svg'); }
.sister-apps-external { --sister-apps-icon: url('assets/ui/open-in-new-rounded.svg'); width: 18px; height: 18px; }
.sister-apps-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    background: rgba(29, 27, 32, .32);
}
.sister-apps-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(800px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid #e6e0ed;
    border-radius: 24px;
    background: #f7f3fc;
    color: #1d1b20;
    text-align: left;
    box-shadow: 0 12px 32px rgba(39, 30, 58, .16);
    font-family: 'Noto Sans JP', sans-serif;
}
.sister-apps-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: 0 0 auto;
    padding: 20px 24px 16px;
}
.sister-apps-intro { min-width: 0; }
.sister-apps-heading h2 { margin: 0; font-size: 20px; line-height: 1.5; font-weight: 700; }
.sister-apps-intro p { margin: 4px 0 0; color: #625a6b; font-size: 13px; line-height: 1.6; }
.sister-apps-close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    padding: 0;
    border: 1px solid #e1dae9;
    border-radius: 12px;
    background: #fffcff;
    color: #49454f;
    cursor: pointer;
}
.sister-apps-close:hover { background: #f1ebf8; }
.sister-apps-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 24px 24px;
}
#sisterAppsLinks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sister-apps-card { position: relative; min-width: 0; }
.sister-apps-link {
    --sister-apps-accent: #94415b;
    display: grid;
    grid-template-rows: auto auto 44px;
    gap: 12px;
    padding: 14px;
    min-width: 0;
    box-sizing: border-box;
    color: inherit;
    text-decoration: none;
    border: 1px solid #e6dfea;
    border-radius: 20px;
    background: #fffcff;
}
.sister-apps-link[data-app="sentence"] { --sister-apps-accent: #326398; }
.sister-apps-link:hover { border-color: var(--sister-apps-accent); }
.sister-apps-card-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sister-apps-card-heading img { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px; object-fit: contain; }
.sister-apps-copy { display: grid; gap: 3px; flex: 1; min-width: 0; }
.sister-apps-copy strong { font-size: 17px; line-height: 1.5; font-weight: 700; }
.sister-apps-copy span { font-size: 13px; line-height: 1.6; color: #625a6b; overflow-wrap: anywhere; }
.sister-apps-media { position: relative; display: block; width: 100%; min-width: 0; box-sizing: border-box; aspect-ratio: 3 / 2; min-height: 200px; border: 1px solid #eee7ed; border-radius: 12px; overflow: hidden; background: #faf8ef; }
.sister-apps-media img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.sister-apps-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.sister-apps-media video[hidden] { display: none; }
.sister-apps-link[data-app="dictionary"] .sister-apps-media { background: #eeede6; }
.sister-apps-link[data-app="sentence"] .sister-apps-media { background: #f0f6f8; }
.sister-apps-example { position: absolute; top: 12px; left: 12px; right: 12px; display: grid; gap: 3px; line-height: 1.5; }
.sister-apps-example strong { color: #c90048; font-size: 20px; font-weight: 800; }
.sister-apps-example > span { color: #49454f; font-size: 12px; }
.sister-apps-link[data-app="dictionary"] .sister-apps-example { right: 84px; }
.sister-apps-motion-toggle {
    position: absolute;
    right: 23px;
    bottom: 79px;
    min-width: 56px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #d4cedb;
    border-radius: 100px;
    background: #fffcfff2;
    color: #49454f;
    font: 600 12px 'Noto Sans JP', sans-serif;
    cursor: pointer;
}
.sister-apps-motion-toggle:hover { background: #f1ebf8; }
.sister-apps-motion-toggle:disabled { opacity: .65; cursor: default; }
.sister-apps-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border-radius: 100px;
    background: var(--sister-apps-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}
.sister-apps-panel :focus-visible,
.sister-apps-btn:focus-visible { outline: 2px solid #67548c; outline-offset: 2px; }

@media (max-width: 768px) {
    .sister-apps-panel {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        border: 0;
        border-radius: 0;
    }
    .sister-apps-heading { padding: calc(12px + env(safe-area-inset-top)) 16px 16px; }
    .sister-apps-body { padding: 0 16px calc(20px + env(safe-area-inset-bottom)); }
    #sisterAppsLinks { grid-template-columns: minmax(0, 1fr); max-width: 480px; margin: 0 auto; }
}
