/* ============================================
   THE DIRECTORATE — TRAY: Operations Log + Quick Reference (spy-log.js)
   Split out of spy.css; loads right after it.
   ============================================ */

/* --- Tray --- */

.sa-tray {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    width: min(380px, 92vw);
    display: flex;
    flex-direction: column;
    background: var(--color-bg-mid);
    border-left: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: -12px 0 30px rgba(0, 0, 0, 0.5);
    transform: translateX(105%);
    transition: transform 280ms ease;
}

.sa-tray.is-open {
    transform: none;
}

.sa-tray__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    border-bottom: var(--border-subtle);
}

.sa-tray__tabs {
    display: flex;
    gap: 0.3rem;
}

.sa-tray__tab,
.sa-tray__close {
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--color-text-dim);
    font: inherit;
    font-size: 0.85rem;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
}

.sa-tray__tab.is-active {
    color: var(--color-text);
    border-color: rgba(212, 175, 55, 0.4);
}

.sa-tray__close:hover,
.sa-tray__tab:hover {
    color: var(--color-text);
}

.sa-log {
    flex: 1;
    overflow-y: auto;
    list-style: none;
    padding: 0.6rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.82rem;
    color: var(--color-text);
}

.sa-log li {
    border-left: 3px solid transparent;
    padding-left: 0.45rem;
}

.sa-log li.is-head {
    margin-top: 0.4rem;
    color: var(--color-text-dim);
    font-size: 0.72rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Quick Reference (tray tab): titled sections with room between them */
.sa-ref {
    flex: 1;
    overflow-y: auto;
    padding: 0.9rem 1rem 1.4rem;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--color-text);
}

.sa-ref__guide { width: 100%; margin-bottom: 0.4rem; }

.sa-ref__sec {
    padding: 0.9rem 0 0.2rem;
    border-top: 1px solid var(--panel-line);
    margin-top: 0.9rem;
}

.sa-ref__sec:first-of-type { margin-top: 0.6rem; }

.sa-ref__title {
    margin: 0 0 0.5rem;
    font-family: var(--font-ui);
    font-weight: 400;
    font-size: 1.15rem;
    letter-spacing: 1.5px;
    line-height: 1.1;
    color: var(--color-gold);
}

.sa-ref__list {
    margin: 0;
    padding-left: 1.05rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.sa-ref__list li::marker { color: var(--color-text-dim); }
.sa-ref b { color: #fff6df; font-weight: 600; }

.sa-ref__suit {
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.2);
}

.sa-ref__suit + .sa-ref__suit { margin-top: 0.5rem; }

.sa-ref__suithead {
    font-family: var(--font-ui);
    font-size: 1.1rem;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.sa-ref__fx {
    padding-left: 0.55rem;
    border-left: 3px solid var(--good);
    font-size: 0.85rem;
}

.sa-ref__fx + .sa-ref__fx { margin-top: 0.3rem; }
.sa-ref__fx.is-bad { border-left-color: var(--bad); }
.sa-ref__fx.is-good b { color: var(--good); }
.sa-ref__fx.is-bad b { color: var(--bad); }

.sa-ref__keys {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.4rem 0.8rem;
    margin: 0;
    align-items: center;
}

.sa-ref__keys dd { margin: 0; color: var(--color-text-dim); }

.sa-ref kbd {
    display: inline-block;
    min-width: 1.9em;
    padding: 0.05rem 0.35rem;
    border: 1px solid var(--panel-line);
    border-bottom-width: 2px;
    border-radius: var(--radius-sm);
    background: var(--color-bg-mid);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-align: center;
}

.sa-mark {
    display: inline-block;
    width: 1.1em;
    font-weight: 700;
}

.sa-mark.is-good { color: var(--good); }
.sa-mark.is-bad { color: var(--bad); }

/* The "?" (How to Play) button in the top bar */
.sa-guide-btn { font-family: var(--font-ui); font-size: 1.35rem; line-height: 1; }

/* Tab font (typography role; kept last so it wins, as it did in spy.css) */
.sa-tray__tab {
    font-family: var(--font-ui);
    font-weight: 400;
    font-size: 1.2rem;
    letter-spacing: 1px;
    line-height: 1.1;
}
