/* The two buttons at the far right of the status bar - Feedback, then Privacy - and the privacy sheet
   the second one slides up. The same file in every web tool - the canonical copy is
   shared/feedback-and-privacy/privacy-sheet.css. Its colours come from the --fxm-* custom properties
   each tool maps onto its own tokens in css/app.css (the same ones the FlexTools menu uses), and it
   docks on --fxm-statusbar-h, the status bar's fixed height; the fallbacks are the house greys. */

/* Faint, because they are standing controls rather than anything about the work on screen - and they
   stay at every width, which a status bar's notes do not. Both are buttons dressed as links. */
.statusbar-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex: none;
    padding: 0;
    border: 0;
    background: none;
    color: var(--fxm-faint, #56626f);
    font: inherit;
    white-space: nowrap;
    cursor: pointer;
}

.statusbar-link:hover,
.statusbar-link:focus-visible,
body:has(.privacy-sheet:popover-open) .statusbar-link[popovertarget] {
    color: var(--fxm-text, #dde5ee);
}

/* The chevron points up to open the sheet and down once it is open. */
.statusbar-chevron {
    width: 0.625rem;
    height: 0.625rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s ease;
}

body:has(.privacy-sheet:popover-open) .statusbar-chevron {
    transform: rotate(180deg);
}

/* Slides up out of the status bar, on the right under the button that opened it. A popover, so it
   lives in the top layer and needs no z-index; the UA's centring and border are undone. */
.privacy-sheet {
    position: fixed;
    inset: auto 0.75rem var(--fxm-statusbar-h, 1.5rem) auto;
    box-sizing: border-box;
    width: min(26rem, calc(100vw - 1.5rem));
    max-height: calc(100vh - var(--fxm-statusbar-h, 1.5rem) - 3.5rem);
    margin: 0;
    padding: 0.875rem 1rem 0.75rem;
    overflow: auto;
    background: var(--fxm-pane, #15191f);
    border: 1px solid var(--fxm-border, #262f3a);
    border-bottom: 0;
    border-radius: 0.5rem 0.5rem 0 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.22);
    color: var(--fxm-text, #dde5ee);
    font-family: 'Inter', 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.8125rem;
    line-height: 1.5;

    transform: translateY(100%);
    opacity: 0;
    transition:
        transform 0.22s ease,
        opacity 0.22s ease,
        overlay 0.22s allow-discrete,
        display 0.22s allow-discrete;
}

.privacy-sheet:popover-open {
    transform: none;
    opacity: 1;
}

@starting-style {
    .privacy-sheet:popover-open {
        transform: translateY(100%);
        opacity: 0;
    }
}

/* Clear, so the workbench stays readable behind it - it is a note, not a dialog. */
.privacy-sheet::backdrop {
    background: transparent;
}

.privacy-sheet-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.privacy-sheet-title {
    flex: 1;
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.privacy-sheet-close {
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    background: none;
    color: var(--fxm-muted, #8391a2);
    cursor: pointer;
}

.privacy-sheet-close:hover,
.privacy-sheet-close:focus-visible {
    border-color: var(--fxm-border, #262f3a);
    background: var(--fxm-hover, #1e242d);
    color: var(--fxm-text, #dde5ee);
}

.privacy-sheet-close svg {
    width: 0.75rem;
    height: 0.75rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.privacy-sheet-list {
    margin: 0;
    padding-left: 1.125rem;
    color: var(--fxm-muted, #8391a2);
}

.privacy-sheet-list li + li {
    margin-top: 0.4375rem;
}

.privacy-sheet-list strong {
    color: var(--fxm-text, #dde5ee);
    font-weight: 600;
}

.privacy-sheet-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-top: 0.75rem;
    padding-top: 0.625rem;
    border-top: 1px solid var(--fxm-border-soft, #1a212a);
    font-size: 0.75rem;
}

.privacy-sheet-foot a {
    color: var(--fxm-accent, #8391a2);
    text-decoration: none;
}

.privacy-sheet-foot a:hover,
.privacy-sheet-foot a:focus-visible {
    text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
    .privacy-sheet,
    .statusbar-chevron {
        transition: none;
    }
}
