/* The site's one pill button. Every pill button has the same size whatever its label: 39px high (a 23px line with 8px
   above and below it) and --pill-width wide, the label 20px bold and centered. --pill-width is the one value to change:
   at 188px the widest label meant for it, "Assign Licenses" (147.8px of text), keeps 20px clear on each side. A longer
   label widens its button and keeps 20px each side; one wider than the space the button stands in wraps. On a screen
   too narrow for --pill-width (under 220px), a button is the screen's width less 16px each side.
   The selectors name the element as well as the class, so these rules win over the older button rules in main.css,
   main-subscribe.css, custom-default.css, licenses.css and account.css, whatever order a page loads those in, and
   over a browser's saved copy of them. The buying page's large buttons, and the buttons of the window its group card's
   button opens, take the same size by their own rules at the end of this file. */
:root {
    --pill-width: 188px;
}

button.button-simple, input.button-simple, button.button-simple-off, button.button-red, button.button-green,
button.popup_button, button.popup_button_ok, button.popup_button_cancel, button.standart_button {
    box-sizing: border-box;
    width: auto;
    min-width: min(var(--pill-width), calc(100vw - 32px));
    max-width: 100%;
    padding: 8px 20px;
    font-size: 20px;
    line-height: 23px;
    font-weight: bold;
    text-align: center;
    white-space: normal;
}

/* A button in a table row is no wider than its cell */
td button.button-simple, td input.button-simple, td button.button-simple-off, td button.button-red, td button.button-green {
    min-width: min(var(--pill-width), 100%);
}

/* The cell that holds the download arrow beside View (the Billing tab of a school's Licenses page): a button there is
   narrower than its cell by 50px, the room the arrow takes beside it (the button's own 10px margin, a space and the
   30px arrow), so the arrow stands beside View and not under it. In a cell too narrow for View's label and the arrow
   together, the arrow stands under View. */
td:has(a[href="#DOWNLOAD"]) button.button-simple {
    min-width: min(var(--pill-width), calc(100% - 50px));
}

/* A window's buttons are drawn at their own size, and the row's 12px gap (.popup-actions) is the only space beside
   and between them. */
button.popup_button, button.popup_button_ok, button.popup_button_cancel {
    transform: none;
}

.popup-actions button.popup_button {
    max-width: 100%;
}

.popup-text > .popup-actions > * + button.popup_button {
    margin-left: 0;
}

.popup-text > .popup-actions:has(> button.popup_button) {
    row-gap: 12px;
}

/* A pill button at work (pillWorkStart in api.js): while the site works on what a person asked for with it, the button
   keeps its blue and its white label although it is switched off, and a ring turns at its left end, steadily, once a
   second, for the whole of the wait. The ring is 18px across, its left edge 14px from the button's left edge, centered
   top to bottom. It is placed over the button, not beside the label, so the label stays centered and the button keeps
   its size. No rule stops the turning for a browser set to show less movement: the label for the wait says the same
   thing without movement. The blue is the pill button's own (custom-default.css). A window's Pay Now (popup_button,
   #33l6ay4l) takes the same ring. */
button.button-simple.pill-at-work, button.button-simple.pill-at-work:disabled,
button.popup_button.pill-at-work, button.popup_button.pill-at-work:disabled {
    position: relative;
    background: #1E80FE;
    color: #FFFFFF;
}

button.button-simple.pill-at-work::before, button.popup_button.pill-at-work::before {
    content: "";
    box-sizing: border-box;
    position: absolute;
    left: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: pill-at-work-turn 1s linear infinite;
}

@keyframes pill-at-work-turn {
    to {
        transform: rotate(360deg);
    }
}

/* The same sign where it is not on a pill button (workSubmit in api.js): beside a switch, in place of its ON or OFF, a
   blue ring of the same size, turning at the same speed, on the page's white */
span.pill-at-work {
    position: relative;
}

span.pill-at-work::before {
    content: "";
    box-sizing: border-box;
    position: absolute;
    left: 0;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border: 3px solid rgba(30, 128, 254, 0.25);
    border-top-color: #1E80FE;
    border-radius: 50%;
    animation: pill-at-work-turn 1s linear infinite;
}

/* A window's button switched off for the length of a wait (the others of pillWorkStart in api.js), such as Okay beside
   Pay Now: the site's look for a button that cannot be pressed (.button-simple:disabled in main-subscribe.css), gray
   with a gray label, for the length of the wait only. It stays in its place and keeps its size. */
button.popup_button.pill-work-off, button.popup_button.pill-work-off:hover {
    background: #d1d5d9;
    color: #808080;
    cursor: default;
    transform: none;
}

/* The cross at the top right of a window while the site works on what was asked in the window (pillWorkHoldWindow in
   api.js): gray, the gray of the label of a button that cannot be pressed, and it cannot be pressed. It is red and works
   again when the wait ends. Nothing moves: only its color and whether it can be pressed change. */
div.subscribe-modal-exit.pill-work-exit-off {
    cursor: default;
    pointer-events: none;
}

div.subscribe-modal-exit.pill-work-exit-off img {
    filter: grayscale(1);
}

/* A pill button whose label for the wait does not fit beside the ring (workSubmit in api.js): the ring alone, in the
   button's middle */
button.button-simple.pill-at-work.pill-work-ring-only::before {
    left: 50%;
    margin-left: -9px;
}

/* The buying page's large buttons (Subscribe and Upgrade on the plan cards, Quote or Buy on the group card, and the red
   trial button above and inside the Premium card) are pill buttons of the one size too: 39px high, --pill-width wide, the
   label 20px bold and centered on one line. They are div elements, centered in their card; the !important padding wins
   over .subscribe-p63 in main-subscribe.css, which is itself !important. The window that Quote or Buy opens has its own
   buttons, Request Quote, Submit PO and the two Buy Now buttons (button.button-school); they take the same size, each
   centered in its column and keeping its colors. */
div.subscribe-main-card-subscribe, button.button-school.subscribe-main-card-subscribe,
button.button-school.subscribe-modal-select-item-request {
    box-sizing: border-box;
    width: min(var(--pill-width), calc(100vw - 32px));
    min-height: 39px;
    max-height: none;
    margin-left: auto;
    margin-right: auto;
    padding: 8px 20px !important;
    font-size: 20px;
    line-height: 23px;
    font-weight: bold;
    text-align: center;
}

div.subscribe-main-card-subscribe.subscribe-gold {
    font-weight: bold;
}

/* Request Quote and Submit PO in the group window have a blue edge: the 1px edge is inside the 39px, so their space
   round the label is 1px less on each side. */
button.button-school.subscribe-modal-select-item-request {
    padding: 7px 19px !important;
}

/* With the red trial button 9px lower than before (39px, was 48px), the space under its line "No payment information
   required" above the Premium card grows by 11px where the three cards stand side by side, so the red block above the
   card still takes 84px and the Premium card's top is level with the cards beside it (the 84px of
   .subscribe-premium-no-trial in main-subscribe.css, for a teacher with no red button, then lines up the same way). */
@media (min-width: 855px) {
    .subscribe-premium > .subscribe-d-center > .subscribe-no-payment {
        margin-bottom: 21px !important;
    }
}

/* #33l6bh, Ted's 3a (2 Nov 2026, picture 5606): the one exception to the one size, for a window with three buttons only
   (button.pill-of-three: the Renew window of licenses that ended, with Pay Now, Submit PO and Cancel, and the Renew
   window with no card on file, with Add Card, Submit PO and Cancel). The three stand on one line inside the window in
   three equal columns, each a third of the row less its two 12px gaps (135px in a window of the usual 510px), the label
   20px bold with at least 12px clear on each side. While a button is at work (workSubmit in api.js) its label for the
   wait starts clear of the ring, at once rather than eased, so that workSubmit's test of whether the label fits reads
   the button as it will stand; where the label does not fit, the ring stands alone in the button's middle
   (pill-work-ring-only). On a screen under 500px wide, a phone's, the row is too narrow for three labels on one line:
   the three stand one under the other, each of the one size, centered in the window (Ted, 2 Nov 2026: "center the
   buttons on mobile"). A window with two buttons is unchanged. */
@media (min-width: 500px) {
    .popup-text > .popup-actions:has(.pill-of-three) {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .popup-text > .popup-actions button.button-simple.pill-of-three {
        width: 100%;
        min-width: 0;
        padding-left: 12px;
        padding-right: 12px;
    }

    .popup-text > .popup-actions button.button-simple.pill-of-three.pill-at-work {
        padding-left: 36px;
        transition: none;
    }
}

@media (max-width: 499px) {
    .popup-text > .popup-actions:has(.pill-of-three) {
        flex-direction: column;
        align-items: center;
    }
}
