/* Sidebar "Lookup" button + Student Lookup modal + merged Style group sections */

/* ---- Lookup button (sidebar) ---- */
.lk-open {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0 0 10px;
    padding: 11px 14px;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: var(--text);
    border: 1px solid rgba(214, 164, 74, 0.32);
    border-radius: 13px;
    background: linear-gradient(180deg, rgba(214, 164, 74, 0.09), rgba(214, 164, 74, 0.02)), var(--panel-2);
    transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}

.lk-open:hover {
    border-color: var(--brass);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.lk-open-ic {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 14px;
    color: var(--brass-ink);
    background: var(--brass);
}

.lk-open-txt {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.lk-open-txt b {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .01em;
}

.lk-open-txt small {
    font-size: 11.5px;
    color: var(--text-dim);
    line-height: 1.3;
}

.lk-open-go {
    flex: 0 0 auto;
    font-size: 11px;
    color: var(--text-faint);
    transition: transform .2s var(--ease), color .2s;
}

.lk-open:hover .lk-open-go {
    transform: translateX(3px);
    color: var(--brass);
}

/* ---- Modal ---- */
.lk-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    overflow-y: auto;
    display: flex;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    transition: opacity .18s ease, visibility 0s linear .18s;
}

.lk-modal.show {
    visibility: visible;
    opacity: 1;
    transition: opacity .18s ease;
}

.lk-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(9, 11, 16, .55);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.lk-card {
    position: relative;
    width: 100%;
    max-width: 460px;
    margin: auto;
    padding: 24px 22px 22px;
    border: 1px solid var(--line-2);
    border-radius: 20px;
    background: var(--panel);
    color: var(--text);
    box-shadow: var(--shadow-lift);
    transform: translateY(10px) scale(.98);
    transition: transform .2s var(--ease);
}

.lk-modal.show .lk-card {
    transform: none;
}

.lk-x {
    -webkit-tap-highlight-color: transparent;
    outline: none;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dim);
    background: transparent;
    transition: background .15s, color .15s;
}

.lk-x i {
    display: block;
    transition: transform .25s var(--ease);
}

.lk-x {
    transition: background .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}

.lk-x:hover{
    background: var(--danger);
    color: #fff;
    box-shadow: 0 4px 10px -4px rgba(226, 104, 90, .6);
}

.lk-x:hover i{
    transform: rotate(90deg);
}

.lk-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .01em;
}

.lk-title-ic {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-size: 13px;
    color: var(--brass-ink);
    background: var(--brass);
}

.lk-body .hint {
    margin-bottom: 0;
}

html.lk-lock,
html.lk-lock body {
    overflow: hidden;
}

/* ---- Merged Style group ---- */
.sty-sec {
    padding: 14px 0 4px;
}

.sty-sec+.sty-sec {
    margin-top: 6px;
    border-top: 1px solid var(--line);
}

.sty-h {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.sty-h .group-icon {
    width: 22px;
    height: 22px;
    font-size: 10px;
}

.sty-sec .group-desc {
    margin-top: 0;
}


/* ---- Style group: collapsible sub-sections ---- */
.sty-sec {
    padding: 0;
}

.sty-sec .sty-h {
    margin: 0;
    padding: 12px 2px;
    cursor: pointer;
    user-select: none;
    transition: color .15s;
}

.sty-sec .sty-h:hover,
.sty-sec.open>.sty-h {
    color: var(--text);
}

.sty-chevron {
    margin-left: auto;
    font-size: 10px;
    color: var(--text-faint);
    transition: transform .25s var(--ease), color .15s;
}

.sty-sec.open>.sty-h .sty-chevron {
    transform: rotate(180deg);
    color: var(--brass);
}

.sty-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .28s var(--ease);
}

.sty-sec.open>.sty-body {
    grid-template-rows: 1fr;
}

.sty-body-in {
    min-height: 0;
    overflow: hidden;
    padding: 6px 6px 0;
    margin: 0 -6px;
}

.sty-sec.open>.sty-body>.sty-body-in {
    padding-bottom: 14px;
}

/* ---- Refined secondary ("ghost") buttons in the sidebar ---- */
#sidebar .btn.btn-ghost {
    padding: 9px 16px;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--text);
    border: 1px solid rgba(214, 164, 74, .28);
    background: linear-gradient(180deg, rgba(214, 164, 74, .06) 0%, rgba(214, 164, 74, .015) 100%);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
    transition: transform .15s var(--ease), border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease), color .2s;
}

#sidebar .btn.btn-ghost i {
    color: var(--brass);
}

/* Bangla (Li Ador Noirrit) reads better lighter */
#sidebar.is-bangla .btn.btn-ghost {
    font-weight: 400;
}

#sidebar .btn.btn-ghost:hover:not(:disabled) {
    border-color: var(--brass);
    transform: translateY(-1px);
    background: linear-gradient(180deg, rgba(214, 164, 74, .12) 0%, rgba(214, 164, 74, .04) 100%);
    box-shadow: 0 4px 10px -8px rgba(214, 164, 74, .35);
}

#sidebar .btn.btn-ghost:disabled {
    border-style: dashed;
    border-color: var(--line-2);
    background: transparent;
    box-shadow: none;
    color: var(--text-dim);
}

#sidebar .btn.btn-ghost:disabled i {
    color: var(--text-faint);
}

/* neutral variants for dismissive actions */
#sidebar #cpCancelBtn.btn-ghost,
#sidebar #logoClear.btn-ghost {
    border-color: var(--line-2);
    background: transparent;
    box-shadow: none;
    font-weight: 500;
}

#sidebar #cpCancelBtn.btn-ghost:hover:not(:disabled) {
    border-color: var(--text-dim);
    background: var(--panel-3);
    box-shadow: none;
}

#sidebar #logoClear.btn-ghost:hover:not(:disabled) {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(226, 104, 90, .08);
    box-shadow: none;
}

/* ---- Lookup result animation (found / not found) ---- */
.lk-result {
    position: absolute;
    inset: 0;
    z-index: 5;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    padding: 24px;
    background: var(--panel);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, visibility 0s linear .22s;
    --res: var(--gc-check, #8FE3D7);
    --res-bg: var(--gc-bg, rgba(95, 192, 180, .16));
    --res-glow: var(--gc-glow, 95, 192, 180);
}

.lk-result.show {
    opacity: 1;
    visibility: visible;
    transition: opacity .22s ease;
}

.lk-result.is-search {
    --res: var(--brass);
    --res-bg: rgba(214, 164, 74, .14);
    --res-glow: 214, 164, 74;
}

.lk-result.is-miss {
    --res: var(--danger);
    --res-bg: rgba(226, 104, 90, .13);
    --res-glow: 226, 104, 90;
}

.lk-res-badge {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--res-bg);
    box-shadow: 0 10px 28px -10px rgba(var(--res-glow), .7);
    transform: scale(.4);
    opacity: 0;
}

.lk-result.is-search.show .lk-res-badge {
    animation: lkPop .55s cubic-bezier(.34, 1.5, .5, 1) .05s both;
}

.lk-result.is-miss.show .lk-res-badge {
    animation: lkPop2 .5s cubic-bezier(.34, 1.5, .5, 1) .05s both, lkShake .55s ease-in-out .6s;
}

.lk-res-badge svg {
    width: 64px;
    height: 64px;
    fill: none;
    stroke: var(--res);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    overflow: visible;
}

.lk-res-ring,
.lk-res-tick,
.lk-res-x {
    stroke-dasharray: 150;
    stroke-dashoffset: 150;
}

.lk-res-ring,
.lk-res-tick,
.lk-res-x {
    opacity: 0;
}

/* hides the round-cap dot a zero-length dash would leave */

.lk-res-tick {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}

.lk-res-x {
    stroke-dasharray: 46;
    stroke-dashoffset: 46;
}

.lk-result.is-found.show .lk-res-ring,
.lk-result.is-miss.show .lk-res-ring {
    animation: lkDraw .6s cubic-bezier(.65, 0, .35, 1) .15s forwards;
}

/* tick is revealed as one stroke: top-left arm down to the bottom, then up to the top right */
.lk-result.is-found.show .lk-res-tick1 {
    animation: lkDraw .22s cubic-bezier(.4, 0, .6, 1) .65s forwards;
}

.lk-result.is-found.show .lk-res-tick2 {
    animation: lkDraw .38s cubic-bezier(.3, 0, .4, 1) .87s forwards;
}

.lk-result.is-miss.show .lk-res-x {
    animation: lkDraw .4s cubic-bezier(.65, 0, .35, 1) .6s forwards;
}

.lk-result.is-found .lk-res-x,
.lk-result.is-miss .lk-res-tick {
    display: none;
}

/* expanding rings */
.lk-res-ripple {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--res);
    opacity: 0;
}

.lk-result.is-found.show .lk-res-ripple,
.lk-result.is-miss.show .lk-res-ripple {
    animation: lkRipple 1.1s ease-out .55s both;
}

.lk-result.is-found.show .lk-res-ripple.r2,
.lk-result.is-miss.show .lk-res-ripple.r2 {
    animation-delay: .8s;
}

/* sparkle burst (found only) */
.lk-res-sparks {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.lk-res-sparks i {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    border-radius: 50%;
    background: var(--res);
    opacity: 0;
}

.lk-result.is-miss .lk-res-sparks {
    display: none;
}

.lk-result.is-found.show .lk-res-badge {
    animation: lkPop2 .55s cubic-bezier(.34, 1.5, .5, 1) .05s both;
}

.lk-result.is-found.show .lk-res-sparks i {
    animation: lkSpark .8s ease-out calc(.62s + var(--d)) both;
}

.lk-res-title {
    margin: 22px 0 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    opacity: 0;
    margin-top: 35px;
}

.lk-res-sub {
    margin: 0;
    min-height: 1em;
    font-size: 13px;
    color: var(--text-dim);
    opacity: 0;
}

.lk-result.is-found.show .lk-res-title,
.lk-result.is-miss.show .lk-res-title {
    animation: lkRise2 .4s ease .55s both;
    min-height: 1.3em;
}

.lk-result.is-found.show .lk-res-sub,
.lk-result.is-miss.show .lk-res-sub {
    animation: lkRise2 .4s ease .7s both;
}

.lk-result.is-search.show .lk-res-title {
    animation: lkRise .4s ease .1s both;
    min-height: 1.3em;
}

.lk-result.is-search.show .lk-res-sub {
    animation: lkRise .4s ease .2s both;
}

/* Brass magnifier: sweeps once (1.2s) while the record is looked up, then hands over to the tick / cross */
.lk-res-glass {
    display: none;
    position: absolute;
    inset: 0;
    margin: auto;
    width: 34px;
    height: 34px;
    overflow: visible;
    filter: drop-shadow(0 3px 6px rgba(214, 164, 74, .4));
    opacity: 0;
}

.lk-result.is-search .lk-res-glass {
    display: block;
    animation: lkGlass 1.2s cubic-bezier(.45, .05, .35, 1) .05s both;
}

.lk-result.is-search .lk-res-svg {
    display: none;
}

.lk-res-glass .g-lens {
    fill: rgba(214, 164, 74, .14);
    stroke: var(--brass);
    stroke-width: 4.5;
}

.lk-res-glass .g-handle {
    stroke: var(--brass);
    stroke-width: 6;
    stroke-linecap: round;
}

.lk-res-glass .g-shine {
    fill: none;
    stroke: var(--brass-2, #F0C378);
    stroke-width: 2.6;
    stroke-linecap: round;
    opacity: .85;
}

@keyframes lkGlass {
    0%   { transform: translate(0, 6px) scale(.5) rotate(-12deg); opacity: 0; }
    14%  { transform: translate(0, 0) scale(1) rotate(0); opacity: 1; }
    36%  { transform: translate(-7px, -3px) scale(1.04) rotate(-8deg); opacity: 1; }
    62%  { transform: translate(7px, -2px) scale(1.04) rotate(8deg); opacity: 1; }
    84%  { transform: translate(0, 3px) scale(1.08) rotate(0); opacity: 1; }
    100% { transform: translate(0, 0) scale(1) rotate(0); opacity: 1; }
}

@keyframes lkPop2 {
    from { transform: scale(.4); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

@keyframes lkRise2 {
    from { transform: translateY(8px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

/* typewriter caret */
.lk-res-title.is-typing::after,
.lk-res-sub.is-typing::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 3px;
    vertical-align: -.12em;
    background: var(--res);
    animation: lkCaret .7s steps(1) infinite;
}

@keyframes lkCaret {
    50% {
        opacity: 0;
    }
}

@keyframes lkPop {
    from {
        transform: scale(.4);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes lkDraw {
    from {
        opacity: 1;
    }

    to {
        opacity: 1;
        stroke-dashoffset: 0;
    }
}

@keyframes lkRipple {
    from {
        transform: scale(1);
        opacity: .6;
    }

    to {
        transform: scale(1.9);
        opacity: 0;
    }
}

@keyframes lkSpark {
    0% {
        transform: rotate(var(--a)) translateY(-30px) scale(.4);
        opacity: 1;
    }

    100% {
        transform: rotate(var(--a)) translateY(-62px) scale(0);
        opacity: 0;
    }
}

@keyframes lkRise {
    from {
        transform: translateY(8px);
        opacity: 0;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

@keyframes lkShake {

    0%,
    100% {
        transform: translateX(0);
    }

    18% {
        transform: translateX(-7px);
    }

    36% {
        transform: translateX(6px);
    }

    54% {
        transform: translateX(-4px);
    }

    72% {
        transform: translateX(3px);
    }
}

/* validation / ambiguous-ID nudge on the whole card */
.lk-modal.show .lk-card.lk-nudge {
    animation: lkShake .4s ease-in-out;
}

/* After a match: the Student Identification group glows once so the filled-in record is easy to spot */
#sidebar .group.lk-arrive {
    animation: lkArrive 2.1s ease-out both;
}

#sidebar .group.lk-arrive .group-icon {
    animation: cgTick .7s cubic-bezier(.34, 1.4, .5, 1) .15s both;
}

@keyframes lkArrive {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--gc-glow, 95, 192, 180), .55);
        border-color: var(--gc-check, #8FE3D7);
    }

    35% {
        box-shadow: 0 0 0 7px rgba(var(--gc-glow, 95, 192, 180), .16);
        border-color: var(--gc-check, #8FE3D7);
    }

    100% {
        box-shadow: 0 0 0 14px rgba(var(--gc-glow, 95, 192, 180), 0);
    }
}
/* Cross button: on click it spins once, changes colour, then the modal closes (see closeWithSpin in lookup-modal.js) */
.lk-x i {
    transition: transform .42s var(--ease);
}

.lk-x.is-closing {
    pointer-events: none;
    background: #c4372a;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(226, 104, 90, .28), 0 6px 14px -4px rgba(196, 55, 42, .75);
}

.lk-x.is-closing i {
    transform: rotate(360deg);
}

@media (prefers-reduced-motion: reduce) {
    .lk-result.is-search .lk-res-glass { animation-duration: .01s; }
    .lk-x i {
        transition: none;
    }
}

/* Cross button: on click it spins once, changes colour, then the modal closes (see closeWithSpin in lookup-modal.js) */
.lk-x i {
    transition: transform .42s var(--ease);
}

.lk-x.is-closing {
    pointer-events: none;
    background: #c4372a;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(226, 104, 90, .28), 0 6px 14px -4px rgba(196, 55, 42, .75);
}

.lk-x.is-closing i {
    transform: rotate(360deg);
}

@media (prefers-reduced-motion: reduce) {
    .lk-x i {
        transition: none;
    }
}

/* Lookup modal: the default hint line is not needed. Warnings (missing ID, several matching records) still show. */
#lookupHint:not(.warn) {
    display: none;
}

/* ---- Manage saved records (edit / delete localStorage records) ---- */
.lk-manage-open {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 9px 12px;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
    border: 1px dashed rgba(214, 164, 74, .4);
    border-radius: 10px;
    background: transparent;
    transition: border-color .2s var(--ease), background .2s var(--ease), color .2s;
}

.lk-manage-open i { color: var(--brass); }

.lk-manage-open:hover{
    border-color: var(--brass);
    background: rgba(214, 164, 74, .07);
    outline: none;
}

.lk-manage[hidden] { display: none; }

.lk-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(52vh, 420px);
    overflow-y: auto;
    padding: 2px 2px 2px 0;
    overscroll-behavior: contain;
}

.lk-empty {
    margin: 18px 6px;
    text-align: center;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-dim);
}

.lk-rec {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: var(--panel-2);
}

.lk-rec.is-editing {
    display: block;
    border-color: rgba(214, 164, 74, .45);
}

.lk-rec-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lk-rec-main b {
    font-size: 13.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lk-rec-main span { font-size: 12px; color: var(--text-dim); }

.lk-rec-main small {
    font-size: 11px;
    color: var(--text-faint);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lk-rec-act { display: flex; gap: 6px; flex: 0 0 auto; }

.lk-ic {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-dim);
    border: 1px solid var(--line-2);
    border-radius: 9px;
    background: transparent;
    transition: color .15s, border-color .15s, background .15s;
}

.lk-ic:hover { color: var(--brass); border-color: var(--brass); }
.lk-ic.is-del:hover,
.lk-ic.is-armed,
.lk-delall.is-armed {
    color: #fff;
    border-color: var(--danger);
    background: var(--danger);
}

.lk-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
}

.lk-f { display: flex; flex-direction: column; gap: 3px; margin: 0; }
.lk-f.wide { grid-column: 1 / -1; }
.lk-f span { font-size: 11px; color: var(--text-dim); }
.lk-f input { width: 100%; margin: 0; }
.lk-f input.is-bad { border-color: var(--danger); }

.lk-edit-act,
.lk-manage-foot {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.lk-manage-foot { justify-content: space-between; }

.lk-manage .hint { margin: 12px 0 0; }

@media (max-width: 420px) {
    .lk-edit-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   BUTTONS - formal, flat, wave hover.
   No bevel, glow or drop shadow. Resting look = plain two-tone vertical gradient.
   On hover a second tone sweeps across from the left as a curved wave
   (radial layer moved with background-position); the border and text colour
   follow. Where the fill gets darker, the text turns light.
   Loaded last so it settles all earlier export-button and brass-button rules.
   ===================================================================== */

/* brass-dark-modal */
html:not([data-theme="light"]) .btn-primary,
html:not([data-theme="light"]) #lookupBtn.btn-primary {
  background-image: radial-gradient(ellipse 55% 200% at 0% 50%, #A67A2C 0%, #86601F 78%, transparent 100%), linear-gradient(180deg, #D8AE62 0%, #C29646 100%);
  background-size: 300% 100%, 100% 100%;
  background-position: 100% 0, 0 0;
  background-repeat: no-repeat;
  background-color: #C29646;
  border-color: #A97F34;
  color: #1A1305;
  box-shadow: none;
  transition: background-position .55s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
html:not([data-theme="light"]) .btn-primary:hover:not(:disabled),
html:not([data-theme="light"]) #lookupBtn.btn-primary:hover:not(:disabled) {
  background-image: radial-gradient(ellipse 55% 200% at 0% 50%, #A67A2C 0%, #86601F 78%, transparent 100%), linear-gradient(180deg, #D8AE62 0%, #C29646 100%);
  background-size: 300% 100%, 100% 100%;
  background-position: 0 0, 0 0;
  border-color: #7E591A;
  color: #FFF3D6;
  box-shadow: none;
  transform: none;
}

/* brass-light-modal */
html[data-theme="light"] .btn-primary,
html[data-theme="light"] .info-contact-form .btn.btn-primary,
html[data-theme="light"] #lookupBtn.btn-primary {
  background-image: radial-gradient(ellipse 55% 200% at 0% 50%, #A97716 0%, #8B5E0E 78%, transparent 100%), linear-gradient(180deg, #E4B65F 0%, #CB9A33 100%);
  background-size: 300% 100%, 100% 100%;
  background-position: 100% 0, 0 0;
  background-repeat: no-repeat;
  background-color: #CB9A33;
  border-color: #B98A2A;
  color: var(--navy);
  box-shadow: none;
  transition: background-position .55s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
html[data-theme="light"] .btn-primary:hover:not(:disabled),
html[data-theme="light"] .info-contact-form .btn.btn-primary:hover:not(:disabled),
html[data-theme="light"] #lookupBtn.btn-primary:hover:not(:disabled) {
  background-image: radial-gradient(ellipse 55% 200% at 0% 50%, #A97716 0%, #8B5E0E 78%, transparent 100%), linear-gradient(180deg, #E4B65F 0%, #CB9A33 100%);
  background-size: 300% 100%, 100% 100%;
  background-position: 0 0, 0 0;
  border-color: #7A520B;
  color: #FFFFFF;
  box-shadow: none;
  transform: none;
}

/* =====================================================================
   EXPORT BUTTONS — premium wave hover
   Applies to the export buttons (Download A4 PDF, Reset, Download PNG, Print A4)
   and to modal buttons: .btn-primary, .btn-ghost, .dl-choice-btn, .reset-btn.

   HOW IT WORKS
   Two translucent waves rise through the button. A slow back wave leads and
   a rich diagonal-gradient front wave (with a soft glint) follows it. Both
   edges drift in opposite directions. Label and icon change colour as the
   fill passes.

   TO CHANGE COLOURS: edit the --eb-* variables in the two palettes below.
     --eb-bg     resting background       --eb-wave   front wave fill (gradient)
     --eb-wave2  trailing back-wave tint  --eb-fg     text colour at rest
     --eb-fg-h   text colour when filled  --eb-bd / --eb-bd-h  border rest / filled
     --eb-ic / --eb-ic-h  icon colour rest / filled (optional)
   ===================================================================== */

/* defaults used by every wave button (export row + modal buttons) */
:root {
  --eb-wave-h: 10px;     /* front wave crest height */
  --eb-wave-len: 72px;   /* front wave length */
  --eb-wave2-h: 12px;    /* back wave crest height */
  --eb-wave2-len: 120px; /* back wave length */
  --eb-rise: .8s;        /* time for the fill to rise */
  --eb-flow: 2.6s;       /* time for the front wave to drift one length */
  --eb-flow2: 3.8s;      /* time for the back wave to drift one length */
}

/* ---------- DARK palette ---------- */
html:not([data-theme="light"]) .export-actions #printBtn {
  --eb-bg: linear-gradient(180deg, #D8AE62 0%, #C29646 100%);
  --eb-wave: radial-gradient(ellipse 60% 140% at 0% 0%, rgba(255, 238, 190, .45) 0%, transparent 65%), linear-gradient(115deg, #CFA04C 0%, #B98C35 100%);
  --eb-wave2: rgba(232, 196, 116, .55);
  --eb-fg: #1A1305;  --eb-fg-h: #1A1305;
  --eb-bd: #A97F34;  --eb-bd-h: #8F6A24;
}
html:not([data-theme="light"]) .export-actions #pngBtn {
  /* amethyst: sits between the brass PDF button and the navy Print button */
  --eb-bg: linear-gradient(180deg, #6C58C8 0%, #5845AE 100%);
  --eb-wave: radial-gradient(ellipse 60% 140% at 0% 0%, rgba(222, 212, 255, .28) 0%, transparent 65%), linear-gradient(115deg, #7A66D8 0%, #5F4BB8 100%);
  --eb-wave2: rgba(139, 118, 232, .5);
  --eb-fg: #FFFFFF;  --eb-fg-h: #FFFFFF;
  --eb-bd: #8573DA;  --eb-bd-h: #B1A3F2;
}
html:not([data-theme="light"]) .export-actions .btn:not(#printBtn):not(#pngBtn) {
  --eb-bg: linear-gradient(180deg, #1A2030 0%, #141926 100%);
  --eb-wave: radial-gradient(ellipse 75% 170% at 0% 0%, rgba(214, 162, 74, .30) 0%, transparent 70%), linear-gradient(115deg, #2E2557 0%, #4A3A8C 50%, #2F2659 100%);
  --eb-wave2: rgba(108, 88, 200, .55);
  --eb-fg: #EEF1F6;  --eb-fg-h: #FFFFFF;
  --eb-bd: rgba(255, 255, 255, .14);  --eb-bd-h: rgba(177, 163, 242, .6);
  --eb-ic: #D8AE62;  --eb-ic-h: #F3D18A;
}

/* ---------- LIGHT palette ---------- */
html[data-theme="light"] .export-actions #printBtn {
  --eb-bg: linear-gradient(180deg, #E4B65F 0%, #CB9A33 100%);
  --eb-wave: radial-gradient(ellipse 60% 140% at 0% 0%, rgba(255, 240, 200, .45) 0%, transparent 65%), linear-gradient(115deg, #DDB058 0%, #C4953A 100%);
  --eb-wave2: rgba(236, 200, 122, .55);
  --eb-fg: #0F1B3D;  --eb-fg-h: #0F1B3D;
  --eb-bd: #B98A2A;  --eb-bd-h: #9A6F14;
}
html[data-theme="light"] .export-actions #pngBtn {
  --eb-bg: linear-gradient(180deg, #22346F 0%, #14224F 100%);
  --eb-wave: radial-gradient(ellipse 60% 140% at 0% 0%, rgba(170, 190, 255, .2) 0%, transparent 65%), linear-gradient(115deg, #2E48A2 0%, #1D3180 100%);
  --eb-wave2: rgba(60, 92, 190, .5);
  --eb-fg: #FFFFFF;  --eb-fg-h: #FFFFFF;
  --eb-bd: #14224F;  --eb-bd-h: #1F3584;
}
html[data-theme="light"] .export-actions .btn:not(#printBtn):not(#pngBtn) {
  --eb-bg: linear-gradient(180deg, #FFFFFF 0%, #F3F5FA 100%);
  --eb-wave: radial-gradient(ellipse 75% 170% at 0% 0%, rgba(255, 255, 255, .75) 0%, transparent 70%), linear-gradient(115deg, #F6E1A3 0%, #EDC965 50%, #F3D98C 100%);
  --eb-wave2: rgba(237, 201, 101, .6);
  --eb-fg: #0F1B3D;  --eb-fg-h: #0F1B3D;
  --eb-bd: rgba(15, 27, 61, .22);  --eb-bd-h: #C99A3B;
  --eb-ic: #8A6318;  --eb-ic-h: #0F1B3D;
}

/* ---------- MODAL buttons: primary (brass), ghost, choice cards, reset dialog ---------- */
html:not([data-theme="light"]) .btn-primary {
  --eb-bg: linear-gradient(180deg, #D8AE62 0%, #C29646 100%);
  --eb-wave: radial-gradient(ellipse 60% 140% at 0% 0%, rgba(255, 238, 190, .45) 0%, transparent 65%), linear-gradient(115deg, #CFA04C 0%, #B98C35 100%);
  --eb-wave2: rgba(232, 196, 116, .55);
  --eb-fg: #1A1305;  --eb-fg-h: #1A1305;
  --eb-bd: #A97F34;  --eb-bd-h: #8F6A24;
}
html[data-theme="light"] .btn-primary {
  --eb-bg: linear-gradient(180deg, #E4B65F 0%, #CB9A33 100%);
  --eb-wave: radial-gradient(ellipse 60% 140% at 0% 0%, rgba(255, 240, 200, .45) 0%, transparent 65%), linear-gradient(115deg, #DDB058 0%, #C4953A 100%);
  --eb-wave2: rgba(236, 200, 122, .55);
  --eb-fg: #0F1B3D;  --eb-fg-h: #0F1B3D;
  --eb-bd: #B98A2A;  --eb-bd-h: #9A6F14;
}
html:not([data-theme="light"]) .btn-ghost {
  --eb-bg: transparent;
  --eb-wave: radial-gradient(ellipse 60% 140% at 0% 0%, rgba(214, 162, 74, .26) 0%, transparent 65%), linear-gradient(115deg, rgba(214, 162, 74, .24) 0%, rgba(214, 162, 74, .12) 100%);
  --eb-wave2: rgba(214, 162, 74, .14);
  --eb-fg: var(--text);  --eb-fg-h: #FFFFFF;
  --eb-bd: var(--line-2);  --eb-bd-h: rgba(214, 162, 74, .7);
}
html[data-theme="light"] .btn-ghost {
  --eb-bg: transparent;
  --eb-wave: radial-gradient(ellipse 60% 140% at 0% 0%, rgba(255, 255, 255, .5) 0%, transparent 65%), linear-gradient(115deg, rgba(201, 154, 59, .26) 0%, rgba(201, 154, 59, .14) 100%);
  --eb-wave2: rgba(201, 154, 59, .16);
  --eb-fg: #0F1B3D;  --eb-fg-h: #0F1B3D;
  --eb-bd: var(--line-2);  --eb-bd-h: #C99A3B;
}
html:not([data-theme="light"]) .dl-choice-btn {
  --eb-bg: var(--panel-2);
  --eb-wave: radial-gradient(ellipse 60% 140% at 0% 0%, rgba(214, 162, 74, .26) 0%, transparent 65%), linear-gradient(115deg, rgba(214, 162, 74, .22) 0%, rgba(214, 162, 74, .10) 100%);
  --eb-wave2: rgba(214, 162, 74, .12);
  --eb-fg: var(--text);  --eb-fg-h: var(--text);
  --eb-bd: var(--line-2);  --eb-bd-h: rgba(214, 162, 74, .7);
}
html[data-theme="light"] .dl-choice-btn {
  --eb-bg: var(--panel-2);
  --eb-wave: radial-gradient(ellipse 60% 140% at 0% 0%, rgba(255, 255, 255, .5) 0%, transparent 65%), linear-gradient(115deg, rgba(201, 154, 59, .24) 0%, rgba(201, 154, 59, .12) 100%);
  --eb-wave2: rgba(201, 154, 59, .14);
  --eb-fg: var(--text);  --eb-fg-h: var(--text);
  --eb-bd: var(--line-2);  --eb-bd-h: #C99A3B;
}
html:not([data-theme="light"]) .reset-keep {
  --eb-bg: var(--panel-3, #1E2330);
  --eb-wave: radial-gradient(ellipse 60% 140% at 0% 0%, rgba(255, 255, 255, .16) 0%, transparent 65%), linear-gradient(115deg, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, .08) 100%);
  --eb-wave2: rgba(255, 255, 255, .08);
  --eb-fg: var(--text, #EEF1F6);  --eb-fg-h: #FFFFFF;
  --eb-bd: transparent;  --eb-bd-h: transparent;
}
html[data-theme="light"] .reset-keep {
  --eb-bg: #f1f4f9;
  --eb-wave: radial-gradient(ellipse 60% 140% at 0% 0%, rgba(255, 255, 255, .6) 0%, transparent 65%), linear-gradient(115deg, rgba(15, 27, 61, .12) 0%, rgba(15, 27, 61, .06) 100%);
  --eb-wave2: rgba(15, 27, 61, .06);
  --eb-fg: #0f1b3d;  --eb-fg-h: #0f1b3d;
  --eb-bd: transparent;  --eb-bd-h: transparent;
}
.reset-go {
  --eb-bg: #e11d48;
  --eb-wave: radial-gradient(ellipse 60% 140% at 0% 0%, rgba(255, 190, 205, .4) 0%, transparent 65%), linear-gradient(115deg, #BE123C 0%, #A10F33 100%);
  --eb-wave2: rgba(190, 18, 60, .55);
  --eb-fg: #FFFFFF;  --eb-fg-h: #FFFFFF;
  --eb-bd: transparent;  --eb-bd-h: transparent;
}
.reset-btn:hover:not(:disabled) { filter: none !important; }

/* ---------- Base button + wave layers ---------- */
.export-actions .btn,
.btn-primary,
.btn-ghost:not(#sidebar .btn-ghost),
.dl-choice-btn,
.reset-btn {
  position: relative;
  overflow: hidden;
  overflow: clip;   /* clips the wave like hidden, but keeps the button from shrinking below its label */
  isolation: isolate;
  background: var(--eb-bg) !important;
  border-color: var(--eb-bd) !important;
  color: var(--eb-fg) !important;
  transition: color .35s ease .2s, border-color .35s ease .15s, transform .15s var(--ease) !important;
}
.export-actions .btn {
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: .01em;
  box-shadow: none !important;
}

.export-actions .btn::before,
.btn-primary::before,
.btn-ghost:not(#sidebar .btn-ghost)::before,
.dl-choice-btn::before,
.reset-btn::before,
.export-actions .btn::after,
.btn-primary::after,
.btn-ghost:not(#sidebar .btn-ghost)::after,
.dl-choice-btn::after,
.reset-btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  pointer-events: none;
  will-change: transform;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='12' viewBox='0 0 48 12' preserveAspectRatio='none'%3E%3Cpath d='M0 6Q12 0 24 6T48 6V12H0Z'/%3E%3C/svg%3E"), linear-gradient(#000, #000);
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='12' viewBox='0 0 48 12' preserveAspectRatio='none'%3E%3Cpath d='M0 6Q12 0 24 6T48 6V12H0Z'/%3E%3C/svg%3E"), linear-gradient(#000, #000);
  -webkit-mask-repeat: repeat-x, no-repeat;
          mask-repeat: repeat-x, no-repeat;
  animation-play-state: paused;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

/* front wave: rich gradient fill */
.export-actions .btn::before,
.btn-primary::before,
.btn-ghost:not(#sidebar .btn-ghost)::before,
.dl-choice-btn::before,
.reset-btn::before {
  height: calc(100% + var(--eb-wave-h));
  z-index: -1;
  background: var(--eb-wave);
  transform: translateY(100%);
  transition: transform var(--eb-rise) cubic-bezier(.4, .02, .2, 1) .06s;
  -webkit-mask-size: var(--eb-wave-len) var(--eb-wave-h), 100% calc(100% - var(--eb-wave-h) + 1px);
          mask-size: var(--eb-wave-len) var(--eb-wave-h), 100% calc(100% - var(--eb-wave-h) + 1px);
  -webkit-mask-position: 0 0, 0 calc(var(--eb-wave-h) - 1px);
          mask-position: 0 0, 0 calc(var(--eb-wave-h) - 1px);
  animation-name: ebWaveFlow;
  animation-duration: var(--eb-flow);
}

/* back wave: translucent, leads the front wave, drifts the other way */
.export-actions .btn::after,
.btn-primary::after,
.btn-ghost:not(#sidebar .btn-ghost)::after,
.dl-choice-btn::after,
.reset-btn::after {
  height: calc(100% + var(--eb-wave2-h));
  z-index: -2;
  background: var(--eb-wave2);
  transform: translateY(100%);
  transition: transform calc(var(--eb-rise) * .9) cubic-bezier(.4, .02, .2, 1);
  -webkit-mask-size: var(--eb-wave2-len) var(--eb-wave2-h), 100% calc(100% - var(--eb-wave2-h) + 1px);
          mask-size: var(--eb-wave2-len) var(--eb-wave2-h), 100% calc(100% - var(--eb-wave2-h) + 1px);
  -webkit-mask-position: 0 0, 0 calc(var(--eb-wave2-h) - 1px);
          mask-position: 0 0, 0 calc(var(--eb-wave2-h) - 1px);
  animation-name: ebWaveFlowBack;
  animation-duration: var(--eb-flow2);
}

/* label + icon always above the wave layers */
.export-actions .btn > *,
.btn-primary > *,
.btn-ghost:not(#sidebar .btn-ghost) > *,
.dl-choice-btn > *,
.reset-btn > * {
  position: relative;
  z-index: 1;
}

/* hover (real pointers) / keyboard focus / touch tap (.eb-tap, added by ui-controls.js):
   waves rise and keep drifting, colours flip. Hover is limited to devices that can
   really hover, so a tap on a phone never leaves the button stuck in the hovered state. */

.export-actions .btn.eb-tap:not(:disabled),
.btn-primary.eb-tap:not(:disabled),
.btn-ghost:not(#sidebar .btn-ghost).eb-tap:not(:disabled),
.dl-choice-btn.eb-tap:not(:disabled),
.reset-btn.eb-tap:not(:disabled) {
  color: var(--eb-fg-h) !important;
  border-color: var(--eb-bd-h) !important;
}

.export-actions .btn.eb-tap:not(:disabled)::before,
.btn-primary.eb-tap:not(:disabled)::before,
.btn-ghost:not(#sidebar .btn-ghost).eb-tap:not(:disabled)::before,
.dl-choice-btn.eb-tap:not(:disabled)::before,
.reset-btn.eb-tap:not(:disabled)::before {
  transform: translateY(calc(-1 * var(--eb-wave-h)));
  animation-play-state: running;
}

.export-actions .btn.eb-tap:not(:disabled)::after,
.btn-primary.eb-tap:not(:disabled)::after,
.btn-ghost:not(#sidebar .btn-ghost).eb-tap:not(:disabled)::after,
.dl-choice-btn.eb-tap:not(:disabled)::after,
.reset-btn.eb-tap:not(:disabled)::after {
  transform: translateY(calc(-1 * var(--eb-wave2-h)));
  animation-play-state: running;
}
@media (hover: hover) {
  .export-actions .btn:hover:not(:disabled),
  .btn-primary:hover:not(:disabled),
  .btn-ghost:not(#sidebar .btn-ghost):hover:not(:disabled),
  .dl-choice-btn:hover:not(:disabled),
  .reset-btn:hover:not(:disabled) {
    color: var(--eb-fg-h) !important;
    border-color: var(--eb-bd-h) !important;
  }
  .export-actions .btn:hover:not(:disabled)::before,
  .btn-primary:hover:not(:disabled)::before,
  .btn-ghost:not(#sidebar .btn-ghost):hover:not(:disabled)::before,
  .dl-choice-btn:hover:not(:disabled)::before,
  .reset-btn:hover:not(:disabled)::before {
    transform: translateY(calc(-1 * var(--eb-wave-h)));
    animation-play-state: running;
  }
  .export-actions .btn:hover:not(:disabled)::after,
  .btn-primary:hover:not(:disabled)::after,
  .btn-ghost:not(#sidebar .btn-ghost):hover:not(:disabled)::after,
  .dl-choice-btn:hover:not(:disabled)::after,
  .reset-btn:hover:not(:disabled)::after {
    transform: translateY(calc(-1 * var(--eb-wave2-h)));
    animation-play-state: running;
  }
}

/* a tap fills a little faster so the action doesn't feel delayed */
.export-actions .btn.eb-tap,
.btn-primary.eb-tap,
.btn-ghost:not(#sidebar .btn-ghost).eb-tap,
.dl-choice-btn.eb-tap,
.reset-btn.eb-tap { --eb-rise: .85s; }

@keyframes ebWaveFlow {
  from { -webkit-mask-position: 0 0, 0 calc(var(--eb-wave-h) - 1px); mask-position: 0 0, 0 calc(var(--eb-wave-h) - 1px); }
  to   { -webkit-mask-position: var(--eb-wave-len) 0, 0 calc(var(--eb-wave-h) - 1px); mask-position: var(--eb-wave-len) 0, 0 calc(var(--eb-wave-h) - 1px); }
}
@keyframes ebWaveFlowBack {
  from { -webkit-mask-position: 0 0, 0 calc(var(--eb-wave2-h) - 1px); mask-position: 0 0, 0 calc(var(--eb-wave2-h) - 1px); }
  to   { -webkit-mask-position: calc(-1 * var(--eb-wave2-len)) 0, 0 calc(var(--eb-wave2-h) - 1px); mask-position: calc(-1 * var(--eb-wave2-len)) 0, 0 calc(var(--eb-wave2-h) - 1px); }
}

/* ---------- Icons: original Font Awesome icons (PDF, image, print, reset) ----------
   Icon colour is forced to follow the button's own colours, because older rules in
   style.css / light.css paint these icons a fixed colour (e.g. navy icon on a navy button). */
.export-actions .btn i {
  flex: none;
  font-size: 15px !important;
  opacity: 1 !important;
  color: var(--eb-ic, var(--eb-fg)) !important;
  transition: color .35s ease .2s, transform .35s var(--ease);
}

.export-actions .btn.eb-tap:not(:disabled) i {
  color: var(--eb-ic-h, var(--eb-fg-h)) !important;
  transform: scale(1.1);
}

.export-actions .btn.eb-tap:not(:disabled) i.fa-rotate-right {
  transform: rotate(180deg) scale(1.1);
}
@media (hover: hover) {
  .export-actions .btn:hover:not(:disabled) i {
    color: var(--eb-ic-h, var(--eb-fg-h)) !important;
    transform: scale(1.1);
  }
  .export-actions .btn:hover:not(:disabled) i.fa-rotate-right {
    transform: rotate(180deg) scale(1.1);
  }
}

/* press feedback */
.btn-primary:active:not(:disabled),
.export-actions .btn:active { transform: scale(.985) !important; }

/* ---------- Reduced motion: no sliding wave, just a soft fade ---------- */
@media (prefers-reduced-motion: reduce) {
  .btn-primary { transition: none !important; }
  .export-actions .btn::before,
  .btn-primary::before,
  .btn-ghost:not(#sidebar .btn-ghost)::before,
  .dl-choice-btn::before,
  .reset-btn::before,
  .export-actions .btn::after,
  .btn-primary::after,
  .btn-ghost:not(#sidebar .btn-ghost)::after,
  .dl-choice-btn::after,
  .reset-btn::after {
    transform: translateY(calc(-1 * var(--eb-wave-h)));
    opacity: 0;
    transition: opacity .25s ease;
    animation: none;
  }
  .export-actions .btn:hover:not(:disabled)::before,
  .btn-primary:hover:not(:disabled)::before,
  .btn-ghost:not(#sidebar .btn-ghost):hover:not(:disabled)::before,
  .dl-choice-btn:hover:not(:disabled)::before,
  .reset-btn:hover:not(:disabled)::before,
  .export-actions .btn:hover:not(:disabled)::after,
  .btn-primary:hover:not(:disabled)::after,
  .btn-ghost:not(#sidebar .btn-ghost):hover:not(:disabled)::after,
  .dl-choice-btn:hover:not(:disabled)::after,
  .reset-btn:hover:not(:disabled)::after,
  .export-actions .btn.eb-tap:not(:disabled)::before,
  .btn-primary.eb-tap:not(:disabled)::before,
  .btn-ghost:not(#sidebar .btn-ghost).eb-tap:not(:disabled)::before,
  .dl-choice-btn.eb-tap:not(:disabled)::before,
  .reset-btn.eb-tap:not(:disabled)::before,
  .export-actions .btn.eb-tap:not(:disabled)::after,
  .btn-primary.eb-tap:not(:disabled)::after,
  .btn-ghost:not(#sidebar .btn-ghost).eb-tap:not(:disabled)::after,
  .dl-choice-btn.eb-tap:not(:disabled)::after,
  .reset-btn.eb-tap:not(:disabled)::after { opacity: 1; }
}

/* "required fields are empty" warning icon: keep the same red/coral look in the light theme
   (light.css repaints every .thanks-icon brass, which turned this one gold) */
html[data-theme="light"] .thanks-icon.mf-icon {
  background: linear-gradient(140deg, #f0a08f, var(--danger) 60%, #9c3a2e);
  color: #fff;
}


/* =====================================================================
   WAVE HOVER for the sidebar's own buttons (Load sample, Save this student,
   Upload logo, Remove, Add entries, Add member, Match palette, Cancel ...), the
   sidebar "Lookup" button and the modal "mail fallback" buttons.
   Resting look is NOT touched - each button keeps its own original colours.
   On hover a darker wave rises through the button's own background (same
   two-wave motion as the export row); text, border and shadow stay as they were.
   ===================================================================== */
html:not([data-theme="light"]) #sidebar .btn:not(.btn-primary):not(.export-actions .btn),
html:not([data-theme="light"]) .mail-fallback .btn {
  --eb-wave: linear-gradient(115deg, rgba(0, 0, 0, .36) 0%, rgba(0, 0, 0, .24) 100%);
  --eb-wave2: rgba(0, 0, 0, .16);
}
html[data-theme="light"] #sidebar .btn:not(.btn-primary):not(.export-actions .btn),
html[data-theme="light"] .mail-fallback .btn {
  --eb-wave: linear-gradient(115deg, rgba(15, 27, 61, .15) 0%, rgba(15, 27, 61, .09) 100%);
  --eb-wave2: rgba(15, 27, 61, .07);
}
/* brass-tinted buttons (ghost buttons + Lookup) get a deeper brass wave */
html:not([data-theme="light"]) #sidebar .btn-ghost,
html:not([data-theme="light"]) #sidebar .lk-open {
  --eb-wave: linear-gradient(115deg, rgba(214, 164, 74, .34) 0%, rgba(214, 164, 74, .20) 100%);
  --eb-wave2: rgba(214, 164, 74, .16);
}
html[data-theme="light"] #sidebar .btn-ghost,
html[data-theme="light"] #sidebar .lk-open {
  --eb-wave: linear-gradient(115deg, rgba(185, 127, 20, .26) 0%, rgba(185, 127, 20, .15) 100%);
  --eb-wave2: rgba(185, 127, 20, .12);
}

#sidebar .btn:not(.btn-primary):not(.export-actions .btn),
#sidebar .lk-open,
.mail-fallback .btn {
  position: relative;
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
}
#sidebar .btn:not(.btn-primary):not(.export-actions .btn)::before,
#sidebar .lk-open::before,
.mail-fallback .btn::before,
#sidebar .btn:not(.btn-primary):not(.export-actions .btn)::after,
#sidebar .lk-open::after,
.mail-fallback .btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  pointer-events: none;
  will-change: transform;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='12' viewBox='0 0 48 12' preserveAspectRatio='none'%3E%3Cpath d='M0 6Q12 0 24 6T48 6V12H0Z'/%3E%3C/svg%3E"), linear-gradient(#000, #000);
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='12' viewBox='0 0 48 12' preserveAspectRatio='none'%3E%3Cpath d='M0 6Q12 0 24 6T48 6V12H0Z'/%3E%3C/svg%3E"), linear-gradient(#000, #000);
  -webkit-mask-repeat: repeat-x, no-repeat;
          mask-repeat: repeat-x, no-repeat;
  animation-play-state: paused;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
#sidebar .btn:not(.btn-primary):not(.export-actions .btn)::before,
#sidebar .lk-open::before,
.mail-fallback .btn::before {
  height: calc(100% + var(--eb-wave-h));
  z-index: -1;
  background: var(--eb-wave);
  transform: translateY(100%);
  transition: transform var(--eb-rise) cubic-bezier(.4, .02, .2, 1) .06s;
  -webkit-mask-size: var(--eb-wave-len) var(--eb-wave-h), 100% calc(100% - var(--eb-wave-h) + 1px);
          mask-size: var(--eb-wave-len) var(--eb-wave-h), 100% calc(100% - var(--eb-wave-h) + 1px);
  -webkit-mask-position: 0 0, 0 calc(var(--eb-wave-h) - 1px);
          mask-position: 0 0, 0 calc(var(--eb-wave-h) - 1px);
  animation-name: ebWaveFlow;
  animation-duration: var(--eb-flow);
}
#sidebar .btn:not(.btn-primary):not(.export-actions .btn)::after,
#sidebar .lk-open::after,
.mail-fallback .btn::after {
  height: calc(100% + var(--eb-wave2-h));
  z-index: -2;
  background: var(--eb-wave2);
  transform: translateY(100%);
  transition: transform calc(var(--eb-rise) * .9) cubic-bezier(.4, .02, .2, 1);
  -webkit-mask-size: var(--eb-wave2-len) var(--eb-wave2-h), 100% calc(100% - var(--eb-wave2-h) + 1px);
          mask-size: var(--eb-wave2-len) var(--eb-wave2-h), 100% calc(100% - var(--eb-wave2-h) + 1px);
  -webkit-mask-position: 0 0, 0 calc(var(--eb-wave2-h) - 1px);
          mask-position: 0 0, 0 calc(var(--eb-wave2-h) - 1px);
  animation-name: ebWaveFlowBack;
  animation-duration: var(--eb-flow2);
}
#sidebar .btn:not(.btn-primary):not(.export-actions .btn) > *,
#sidebar .lk-open > *,
.mail-fallback .btn > * {
  position: relative;
  z-index: 1;
}

#sidebar .btn:not(.btn-primary):not(.export-actions .btn).eb-tap:not(:disabled)::before,
#sidebar .lk-open.eb-tap:not(:disabled)::before,
.mail-fallback .btn.eb-tap:not(:disabled)::before {
  transform: translateY(calc(-1 * var(--eb-wave-h)));
  animation-play-state: running;
}

#sidebar .btn:not(.btn-primary):not(.export-actions .btn).eb-tap:not(:disabled)::after,
#sidebar .lk-open.eb-tap:not(:disabled)::after,
.mail-fallback .btn.eb-tap:not(:disabled)::after {
  transform: translateY(calc(-1 * var(--eb-wave2-h)));
  animation-play-state: running;
}
@media (hover: hover) {
#sidebar .btn:not(.btn-primary):not(.export-actions .btn):hover:not(:disabled)::before,
#sidebar .lk-open:hover:not(:disabled)::before,
.mail-fallback .btn:hover:not(:disabled)::before {
    transform: translateY(calc(-1 * var(--eb-wave-h)));
    animation-play-state: running;
  }
#sidebar .btn:not(.btn-primary):not(.export-actions .btn):hover:not(:disabled)::after,
#sidebar .lk-open:hover:not(:disabled)::after,
.mail-fallback .btn:hover:not(:disabled)::after {
    transform: translateY(calc(-1 * var(--eb-wave2-h)));
    animation-play-state: running;
  }
}
#sidebar .btn:not(.btn-primary):not(.export-actions .btn).eb-tap,
#sidebar .lk-open.eb-tap,
.mail-fallback .btn.eb-tap { --eb-rise: .85s; }

@media (prefers-reduced-motion: reduce) {
#sidebar .btn:not(.btn-primary):not(.export-actions .btn)::before,
#sidebar .lk-open::before,
.mail-fallback .btn::before,
#sidebar .btn:not(.btn-primary):not(.export-actions .btn)::after,
#sidebar .lk-open::after,
.mail-fallback .btn::after {
    transform: translateY(calc(-1 * var(--eb-wave-h)));
    opacity: 0;
    transition: opacity .25s ease;
    animation: none;
  }
#sidebar .btn:not(.btn-primary):not(.export-actions .btn):hover:not(:disabled)::before,
#sidebar .lk-open:hover:not(:disabled)::before,
.mail-fallback .btn:hover:not(:disabled)::before,
#sidebar .btn:not(.btn-primary):not(.export-actions .btn):hover:not(:disabled)::after,
#sidebar .lk-open:hover:not(:disabled)::after,
.mail-fallback .btn:hover:not(:disabled)::after,
#sidebar .btn:not(.btn-primary):not(.export-actions .btn).eb-tap:not(:disabled)::before,
#sidebar .lk-open.eb-tap:not(:disabled)::before,
.mail-fallback .btn.eb-tap:not(:disabled)::before,
#sidebar .btn:not(.btn-primary):not(.export-actions .btn).eb-tap:not(:disabled)::after,
#sidebar .lk-open.eb-tap:not(:disabled)::after,
.mail-fallback .btn.eb-tap:not(:disabled)::after { opacity: 1; }
}

/* ---- Sidebar form buttons: wave colours ----
   "Save this student"  : brass-tinted wave (dark + light)
   "Load sample"        : black wave in dark theme, a white-gray shade in light theme
   (Two ids so these beat the generic sidebar wave colours above - the brass .btn-ghost
    rule up there loses to them on specificity. ) */
html:not([data-theme="light"]) #sidebar #saveRecordBtn {
  --eb-wave: linear-gradient(115deg, rgba(214, 164, 74, .20) 0%, rgba(214, 164, 74, .12) 100%);
  --eb-wave2: rgba(214, 164, 74, .09);
}
/* icon colour eases back on mouse-out too (hover rules below only cover hover-in) */
#sidebar #sampleBtn i,
#sidebar #saveRecordBtn i {
  transition: color .35s ease;
}
html:not([data-theme="light"]) #sidebar #saveRecordBtn:hover:not(:disabled) i {
  color: rgb(194, 140, 54);   /* icon only goes darker; label keeps its colour */
  transition: color .3s ease .3s;
}
html:not([data-theme="light"]) #sidebar #sampleBtn:hover:not(:disabled) i {
  color: var(--brass);   /* Load sample icon turns brass on hover */
  transition: color .3s ease .3s;
}
html[data-theme="light"] #sidebar #sampleBtn:hover:not(:disabled) i {
  color: var(--brass);
  transition: color .3s ease .3s;
}
html[data-theme="light"] #sidebar #saveRecordBtn {
  --eb-wave: linear-gradient(115deg, rgba(185, 127, 20, .28) 0%, rgba(185, 127, 20, .17) 100%);
  --eb-wave2: rgba(185, 127, 20, .13);
}
html:not([data-theme="light"]) #sidebar #sampleBtn {
  --eb-wave: linear-gradient(115deg, rgba(0, 0, 0, .40) 0%, rgba(0, 0, 0, .28) 100%);
  --eb-wave2: rgba(0, 0, 0, .18);
}
html[data-theme="light"] #sidebar #sampleBtn {
  --eb-wave: linear-gradient(115deg, #E6E9F0 0%, #F0F2F7 100%);
  --eb-wave2: rgba(150, 160, 180, .16);
}

/* no bluish tap flash / stuck focus ring on touch: the wave is driven by .eb-tap (ui-controls.js),
   which also blurs the button when it is done. */
.export-actions .btn,
.btn-primary,
.btn-ghost:not(#sidebar .btn-ghost),
.dl-choice-btn,
.reset-btn,
#sidebar .btn:not(.btn-primary):not(.export-actions .btn),
#sidebar .lk-open,
.mail-fallback .btn { -webkit-tap-highlight-color: transparent; }
.export-actions .btn:focus:not(:focus-visible),
.btn-primary:focus:not(:focus-visible),
.btn-ghost:focus:not(:focus-visible),
.dl-choice-btn:focus:not(:focus-visible),
.reset-btn:focus:not(:focus-visible),
#sidebar .btn:focus:not(:focus-visible),
#sidebar .lk-open:focus:not(:focus-visible),
.mail-fallback .btn:focus:not(:focus-visible) { outline: none; }