/* ===================================================================
   AI Staff Dashboard — Application Frame
   -------------------------------------------------------------------
   Everything the dashboard adds on top of the Gecko design system.

   Two rules govern this file:

     1. It only ever LAYS OUT. Color, spacing, type and component
        styling all come from gecko.css through its custom properties;
        nothing here invents a value the design system already owns.
     2. It is the ONLY place the dashboard styles anything. There is
        not one inline style attribute anywhere in the application,
        which is what allows the Content-Security-Policy to forbid
        inline styles outright rather than permitting them and hoping.

   Class prefix: gk- (Gecko Kit), to stay clearly distinct from the
   design system's own gecko- prefix.
   =================================================================== */

/* ===================================================================
   1. Page Frame
   =================================================================== */

/* -- Outer container -------------------------------------------- */
.gecko-ui .gk-page {
    padding-block: var(--gecko-space-5) var(--gecko-space-7);
}

/* -- Sidebar and content, side by side -------------------------- */
.gecko-ui .gk-shell {
    display: flex;
    gap: var(--gecko-space-5);
    align-items: flex-start;
}

/* The menu's card keeps a fixed width and follows the reader down
   the page; the main column takes whatever is left. min-width:0 is
   what stops a wide table from forcing the whole layout wider. */
.gecko-ui .gk-navcard {
    width: 220px;
    flex: 0 0 220px;
    position: sticky;
    top: var(--gecko-space-4);
    padding: var(--gecko-space-3);
}

/* Inside its card the menu is just a stack of links; the card owns
   the width, the padding and the position. */
.gecko-ui .gk-nav {
    width: 100%;
}

.gecko-ui .gk-main {
    flex: 1;
    min-width: 0;
}

/* -- The inlined icon sprite ------------------------------------ */
/* A definitions block, never a picture. It is emitted with width and
   height attributes of zero rather than an inline style, because the
   Content-Security-Policy forbids inline styles; this rule takes it
   out of the layout entirely. Symbols referenced by <use> still
   render normally — a hidden sprite is the standard technique. */
.gecko-ui .gk-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ===================================================================
   2. Header Bar
   =================================================================== */

/* -- Right-hand cluster: staff switcher, freshness, user, sign out -- */
.gecko-ui .gk-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--gecko-space-4);
}

.gecko-ui .gk-actions a {
    color: var(--gecko-brand-contrast);
}

/* -- One icon-and-label pair in the header ---------------------- */
.gecko-ui .gk-who {
    display: inline-flex;
    align-items: center;
    gap: var(--gecko-space-2);
}

/* -- The AI staff member switcher ------------------------------- */
/* Only rendered once a second staff member is configured. */
.gecko-ui .gk-switcher {
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--gecko-space-2);
}

/* ===================================================================
   3. Page Headings
   -------------------------------------------------------------------
   The heading is given room beneath it so that the title reads as a
   heading over what follows rather than as the first line of it.
   =================================================================== */

.gecko-ui .gk-pagehead {
    /* Nothing. That is the point, and it took two attempts to see it.

       .gecko-stack already puts 16px between the header bar and the
       shell below it, and another 16px between this heading and
       whatever follows. So the band either side of the heading row is
       already even, and the row starts level with the top of the
       navigation card beside it. Any margin or padding added here is
       a third gap on a side that already had one.

       A margin-bottom would not even be that: it would collapse
       against the 16px the next element already carries and take
       effect only if it were larger. */
    margin: 0;
}

.gecko-ui .gk-title {
    margin: 0 0 var(--gecko-space-1);
}

/* -- The explanatory sentence under a heading, and other prose
      that must not inherit a stray margin ------------------------ */
.gecko-ui .gk-lede {
    margin: 0;
}

/* ===================================================================
   4. Statistics
   =================================================================== */

/* -- Footnote beneath a statistic tile -------------------------- */
.gecko-ui .gk-foot {
    color: var(--gecko-text-muted);
    font-size: var(--gecko-fs-sm);
    margin: var(--gecko-space-2) 0 0;
}

/* -- A quieter qualifier sitting inside a headline number -------- */
/* For example the "3 high" that follows an open-item count. */
.gecko-ui .gk-statfoot {
    color: var(--gecko-text-muted);
    font-size: var(--gecko-fs-sm);
    font-weight: 400;
}

/* -- Label line that carries a small leading icon ---------------- */
.gecko-ui .gk-stat-label {
    display: inline-flex;
    align-items: center;
    gap: var(--gecko-space-2);
}

/* -- The four-up statistics row on the overview ------------------ */
.gecko-ui .gk-stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: var(--gecko-space-4);
    margin: 0;
}

/* ===================================================================
   5. Volume Trend
   -------------------------------------------------------------------
   Falling volume is good news, so it takes the success color. The
   direction is also stated in words ("Improving", "More to Clear"),
   because color must never be the only carrier of meaning.
   =================================================================== */

.gecko-ui .gk-trend {
    margin-top: var(--gecko-space-4);
    padding-top: var(--gecko-space-3);
    border-top: 1px solid var(--gecko-border);
    font-weight: 700;
    font-size: var(--gecko-fs-md);
}

.gecko-ui .gk-trend--down { color: var(--gecko-success); }     /* Fewer messages. */
.gecko-ui .gk-trend--up   { color: var(--gecko-error); }       /* More to clear. */
.gecko-ui .gk-trend--flat { color: var(--gecko-text-muted); }  /* No real change. */

.gecko-ui .gk-trend-detail {
    font-size: var(--gecko-fs-sm);
    margin-top: var(--gecko-space-1);
}

/* ===================================================================
   6. Tables
   =================================================================== */

/* -- A secondary line beneath the main value in a cell ----------- */
/* Used for an email address under a sender name, or the suggested
   action under a subject. */
.gecko-ui .gk-sub {
    display: block;
}

/* -- Cells holding free text that must not stretch the table ----- */
.gecko-ui .gk-cell-wide { max-width: 340px; }
.gecko-ui .gk-cell-note { max-width: 280px; }

/* -- A link on its own line below a table ------------------------ */
.gecko-ui .gk-linkrow {
    margin: var(--gecko-space-4) 0 0;
}

/* ===================================================================
   7. Cards
   =================================================================== */

/* -- A form or explanation that should not run the full width ---- */
/* Long input rows are harder to scan; 640px keeps a label and its
   field within one comfortable eye movement. */
.gecko-ui .gk-card--narrow {
    max-width: 640px;
}

/* -- Timestamp above an error transcript ------------------------- */
.gecko-ui .gk-err-time {
    margin: 0 0 var(--gecko-space-3);
}

/* ===================================================================
   8. Sign-In Screen
   -------------------------------------------------------------------
   The only page with no navigation, so it centers its single card in
   the viewport instead.
   =================================================================== */

.gecko-ui .gk-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--gecko-space-5);
}

/* Fixed on a laptop, full width on a phone. */
.gecko-ui .gk-login__card {
    width: min(380px, 100%);
}

/* ===================================================================
   9. Narrow Screens
   -------------------------------------------------------------------
   782px is the WordPress admin breakpoint, which the Gecko design
   system follows, so the dashboard folds at the same width as every
   Gecko plugin screen.
   =================================================================== */

@media (max-width: 782px) {

    /* -- Navigation moves above the content ---------------------- */
    .gecko-ui .gk-shell {
        flex-direction: column;
    }

    .gecko-ui .gk-navcard {
        width: 100%;
        flex: 0 0 auto;
        position: static;
    }

    /* -- Header actions wrap rather than overflow ---------------- */
    .gecko-ui .gk-actions {
        flex-wrap: wrap;
        gap: var(--gecko-space-3);
    }
}

/* ===================================================================
   10. Table Rows
   -------------------------------------------------------------------
   Every cell is top aligned. A subject and its suggested action can
   run to three lines while the priority beside it is one word, and
   centering those against each other makes a table of unequal rows
   very hard to scan.
   =================================================================== */

.gecko-ui .gecko-table td {
    vertical-align: top;
}

/* ===================================================================
   11. The Staff Directory
   -------------------------------------------------------------------
   The home page, and the only screen that belongs to no member of
   staff. One tile each, sized so that several sit comfortably across
   a wide monitor and one fills a phone.

   THE WHOLE TILE IS THE LINK. It is an <a> carrying the card class,
   so there is no button inside it to aim at and exactly one focus
   stop per member of staff. Everything the design system would
   normally give a link — the underline, the link color — is undone
   here, because a tile is not a sentence with a word in it.
   =================================================================== */

.gecko-ui .gk-main--wide {
    width: 100%;
}

.gecko-ui .gk-staff-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--gecko-space-4);
    margin: 0 0 var(--gecko-space-5);
}

/* -- The tile itself --------------------------------------------- */
/* The portrait is exactly as tall as the two lines beside it. That
   height is stated once here, as the sum of the two line boxes and
   the gap between them, so it is derived from the type scale rather
   than guessed at — change the scale and the portrait follows. It is
   written as a sum rather than left to the flexbox to stretch,
   because stretching a square whose width then depends on its height
   makes the container's size depend on itself. */
.gecko-ui .gk-staffcard {
    --gk-portrait: calc(
        (var(--gecko-fs-lg) * 1.3)      /* the name's line box */
        + var(--gecko-space-1)          /* the gap beneath it */
        + (var(--gecko-fs-sm) * 1.4)    /* the role's line box */
    );

    display: block;
    color: var(--gecko-text);
    text-decoration: none;
    transition: border-color var(--gecko-transition, 300ms ease),
                box-shadow var(--gecko-transition, 300ms ease);
}

/* Hover and keyboard focus say the same thing, because a tile that
   only answers the mouse is a tile a keyboard user cannot read.

   The color is restated here, and not by accident: the design
   system turns a link's text to the brand color on hover, and
   because the tile IS the link every child that has not been given
   a color of its own would inherit it. That turned the name and
   the four numbers blue while the labels beside them stayed gray.
   The border and the shadow carry the hover; the words do not
   change color. */
.gecko-ui .gk-staffcard:hover,
.gecko-ui .gk-staffcard:focus-visible {
    border-color: var(--gecko-brand);
    box-shadow: var(--gecko-shadow-lg, var(--gecko-shadow));
    color: var(--gecko-text);
}

.gecko-ui .gk-staffcard:focus-visible {
    outline: var(--gecko-focus-outline);
    outline-offset: 2px;
}

/* -- Portrait, name and condition, on one row -------------------- */
/* The badge is pushed to the far end and pinned to the top, which
   puts it in the tile's top right corner however long the name runs
   and without taking it out of the flow. */
.gecko-ui .gk-staffcard__head {
    display: flex;
    align-items: flex-start;
    gap: var(--gecko-space-3);
    margin: 0 0 var(--gecko-space-4);
}

.gecko-ui .gk-staffcard__photo {
    flex: 0 0 auto;
    width: var(--gk-portrait);
    height: var(--gk-portrait);
    border-radius: 50%;
    object-fit: cover;
    background: var(--gecko-gray-200);
}

/* The stand-in when a member has no portrait on file: their
   initials, in the same circle the photograph would have filled. */
.gecko-ui .gk-staffcard__photo--none {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gecko-text-muted);
    font-size: var(--gecko-fs-md);
    font-weight: 700;
}

.gecko-ui .gk-staffcard__who {
    display: block;
    min-width: 0;
}

/* The two line heights below are what --gk-portrait is calculated
   from, so they are stated rather than inherited. */
.gecko-ui .gk-staffcard__name {
    display: block;
    font-size: var(--gecko-fs-lg);
    font-weight: 700;
    line-height: 1.3;
}

.gecko-ui .gk-staffcard__role {
    display: block;
    margin-top: var(--gecko-space-1);
    color: var(--gecko-text-muted);
    font-size: var(--gecko-fs-sm);
    line-height: 1.4;
}

.gecko-ui .gk-staffcard__badge {
    margin-left: auto;
    flex: 0 0 auto;
}

/* -- The figures ------------------------------------------------- */
/* Two columns, so the numbers line up between one member's tile and
   the next. Each number sits above what it counts. */
.gecko-ui .gk-staffcard__stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gecko-space-4) var(--gecko-space-3);
}

.gecko-ui .gk-staffstat {
    display: block;
    min-width: 0;
}

/* Deliberately smaller than the tile's title: the name is what the
   reader is looking for, and the figures are what they read next. */
.gecko-ui .gk-staffstat__num {
    display: block;
    font-size: var(--gecko-fs-md);
    font-weight: 700;
    line-height: 1.2;
}

.gecko-ui .gk-staffstat__label {
    display: block;
    margin-top: var(--gecko-space-1);
    color: var(--gecko-text-muted);
    font-size: var(--gecko-fs-sm);
}

/* -- What a tile says when the member has never run -------------- */
.gecko-ui .gk-staffcard__note {
    display: block;
    color: var(--gecko-text-muted);
    font-size: var(--gecko-fs-sm);
}

/* ===================================================================
   12. Navigation Dividers
   -------------------------------------------------------------------
   A single rule between each of the menu's three parts: home, then
   whatever belongs to the page being looked at, then the application
   itself. The line is what makes those boundaries visible rather than
   something the reader has to infer from the labels.
   =================================================================== */

.gecko-ui .gk-nav__divider {
    border: 0;
    border-top: 1px solid var(--gecko-border);
    margin: var(--gecko-space-3) 0;
}

/* ===================================================================
   13. Model Rates
   -------------------------------------------------------------------
   Two small numbers per row on the platform settings page. Narrow
   inputs, because a price is never long and a full-width field
   invites the wrong kind of value.
   =================================================================== */

.gecko-ui .gk-raterow {
    display: flex;
    align-items: center;
    gap: var(--gecko-space-3);
    flex-wrap: nowrap;
}

.gecko-ui .gk-raterow > .gecko-label {
    min-width: 4.5rem;
    margin: 0;
}

.gecko-ui .gk-rateinputs {
    display: flex;
    align-items: center;
    gap: var(--gecko-space-2);
}

.gecko-ui .gk-ratelabel {
    color: var(--gecko-text-muted);
    font-size: var(--gecko-fs-sm);
}

.gecko-ui .gk-rateinput {
    width: 55px;
    text-align: center;

    /* No horizontal padding on the left, one pixel on the right, and the
       asymmetry is deliberate.

       text-align: center centers the text RUN, and a run is measured in
       advance widths. Ink is not centered inside its advance width: Arial's
       digits carry a slightly wider bearing on the left than on the right,
       so a run that is perfectly centered as a box shows ink that is not.
       Measured on the live page, every one of the eight figures sat between
       0 and 1px right of its field's center, and not one sat left.

       One pixel here moves the run a pixel left and the ink half a pixel
       with it, which lands the ink on the center: the mean offset across the
       eight fields goes from +0.44px to -0.06px. Two pixels overshoots to
       -0.56px, which is as wrong as leaving it alone.

       This is a property of the typeface rather than of the screen, so it
       holds at every pixel density and every zoom level. Change the font
       and this pixel needs measuring again. */
    padding-left: 0;
    padding-right: 1px;

    /* And no spin buttons. They sit inside the content box on the right, so
       where they appear the digits center in what is left of the field
       instead of in the field. Refused in every engine rather than relying
       on one property that not all of them honor anymore. */
    appearance: textfield;
    -moz-appearance: textfield;
}

.gecko-ui .gk-rateinput::-webkit-outer-spin-button,
.gecko-ui .gk-rateinput::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* ===================================================================
   14. The Staff Group
   -------------------------------------------------------------------
   "AI Staff" is a label that opens, not a link. A native <details>
   disclosure gives the behavior, the keyboard handling and the
   screen-reader announcement without a line of script, which matters
   here because the Content-Security-Policy forbids inline script.

   Two levels of indent, and only two: the staff themselves, and the
   sections belonging to whichever of them is being looked at.
   =================================================================== */

.gecko-ui .gk-navgroup {
    margin: 0;
}

/* The label. Not clickable-looking, because it goes nowhere — but it
   still needs a pointer and a focus ring, because it does something. */
.gecko-ui .gk-navgroup__label {
    display: flex;
    align-items: center;
    gap: var(--gecko-space-2);
    padding: var(--gecko-space-2) var(--gecko-space-3);
    font-weight: 700;
    color: var(--gecko-text);
    cursor: pointer;
    border-radius: var(--gecko-radius-sm, 6px);
    list-style: none;
}

.gecko-ui .gk-navgroup__label:hover {
    /* The same two declarations the design system uses for
       .gecko-nav__item:hover, repeated rather than invented, so that
       every hover in this menu is literally the same color. The flat
       value is the fallback for browsers without color-mix(). */
    background: var(--gecko-border);
    background: color-mix(in srgb, var(--gecko-text) 9%, var(--gecko-surface));
    color: var(--gecko-text);
}

.gecko-ui .gk-navgroup__label:focus-visible {
    outline: var(--gecko-focus-outline);
    outline-offset: 2px;
}

/* The default disclosure triangle is replaced with one that sits at
   the end of the row, where the eye expects a control rather than a
   bullet. */
.gecko-ui .gk-navgroup__label::-webkit-details-marker {
    display: none;
}

.gecko-ui .gk-navgroup__label::after {
    content: "";
    margin-left: auto;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--gecko-text-muted);
    transition: transform var(--gecko-transition, 300ms ease);
}

.gecko-ui .gk-navgroup[open] > .gk-navgroup__label::after {
    transform: rotate(180deg);
}

/* One member of staff. The two indents were reduced a step when the
   menu moved into a card, because the card's own padding already
   sets the whole menu in from the edge and the deeper values left a
   section name such as "Accountability Tracker" no room to sit on
   one line. */
.gecko-ui .gk-navgroup__item {
    padding-left: var(--gecko-space-5);
}

/* That member's own sections, one step further in. */
.gecko-ui .gk-navgroup__sub {
    padding-left: var(--gecko-space-6);
    font-size: var(--gecko-fs-sm);
}

.gecko-ui .gk-navgroup__empty {
    margin: 0;
    padding: var(--gecko-space-2) var(--gecko-space-5);
    color: var(--gecko-text-muted);
    font-size: var(--gecko-fs-sm);
}

/* ===================================================================
   15. The Person's Menu
   -------------------------------------------------------------------
   The signed-in person's name in the header, which opens to offer
   User Profile and Logout.

   It opens on :hover for the mouse and on :focus-within for the
   keyboard, which is why there is no script here and none is needed:
   tabbing to the name reveals the menu, and tabbing on moves through
   its two items. Anything that required JavaScript would also have
   required loosening the Content-Security-Policy.

   The list sits on the page surface rather than on the header's brand
   color, so its items take the ordinary text color and must say so
   — .gk-actions a paints its links in the header's contrast color,
   which would be white on white in here.
   =================================================================== */

.gecko-ui .gk-usermenu {
    position: relative;
}

/* Not a link, so no pointer cursor — but it does something, so it
   keeps its focus ring. */
.gecko-ui .gk-usermenu__label {
    cursor: default;
}

.gecko-ui .gk-usermenu__label:focus-visible {
    outline: var(--gecko-focus-outline);
    outline-offset: 2px;
}

/* The same triangle the staff group in the left menu uses, so the
   two "this opens" marks in the app are one mark. */
.gecko-ui .gk-usermenu__caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    margin-left: var(--gecko-space-1);
}

.gecko-ui .gk-usermenu__list {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 30;
    display: none;
    min-width: 180px;
    margin-top: var(--gecko-space-2);
    padding: var(--gecko-space-2);
    background: var(--gecko-surface);
    border: 1px solid var(--gecko-border);
    border-radius: var(--gecko-radius);
    box-shadow: var(--gecko-shadow-lg, var(--gecko-shadow));
}

/* The gap between the name and the list would otherwise be a dead
   strip that closes the menu as the pointer crosses it. This bridges
   it without moving anything. */
.gecko-ui .gk-usermenu__list::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--gecko-space-2) * -1);
    height: var(--gecko-space-2);
}

.gecko-ui .gk-usermenu:hover .gk-usermenu__list,
.gecko-ui .gk-usermenu:focus-within .gk-usermenu__list {
    display: block;
}

.gecko-ui .gk-actions .gk-usermenu__item {
    display: flex;
    align-items: center;
    gap: var(--gecko-space-2);
    padding: var(--gecko-space-2) var(--gecko-space-3);
    border-radius: var(--gecko-radius-sm, 6px);
    color: var(--gecko-text);
    text-decoration: none;
    white-space: nowrap;
}

.gecko-ui .gk-actions .gk-usermenu__item:hover {
    /* The same two declarations the design system uses for
       .gecko-nav__item:hover, so every hover in the app is the same
       color. The flat value is the fallback for browsers without
       color-mix(). */
    background: var(--gecko-border);
    background: color-mix(in srgb, var(--gecko-text) 9%, var(--gecko-surface));
    color: var(--gecko-text);
}

/* ===================================================================
   16. The Page Heading's Actions
   -------------------------------------------------------------------
   A page whose whole form is saved by one button puts that button at
   the end of the title's own line, where it reads as belonging to the
   page rather than to the last card on it. A heading with no actions
   is a flex row with one child, which lays out exactly as it did
   before.
   =================================================================== */

.gecko-ui .gk-pagehead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gecko-space-4);
    flex-wrap: wrap;
}

.gecko-ui .gk-pagehead__text {
    min-width: 0;
}

/* The title is a row of two things now: the icon its menu item uses,
   and the words. inline-flex rather than flex so the heading is still
   only as wide as its contents, which is what lets the Save button be
   pushed to the far end by the row above. */
.gecko-ui .gk-pagehead__text .gk-title {
    display: inline-flex;
    align-items: center;
    gap: var(--gecko-space-3);
}

/* The icon is a shape, not a letter, so it is not given the optical
   nudge the words need — it is centered already. */
.gecko-ui .gk-title > .gecko-icon {
    flex: 0 0 auto;
    position: relative;
    top: -0.042em;
}

/* The title's bottom margin exists to separate it from a lede. With
   no lede it was making the text block taller than the button beside
   it, which put the two out of line with each other. */
.gecko-ui .gk-pagehead__text .gk-title:only-child {
    margin-bottom: 0;
}

.gecko-ui .gk-pagehead__actions {
    flex: 0 0 auto;
    margin-left: auto;
}

/* -- The last pixel ------------------------------------------------ */
/* The two boxes are centered on each other exactly; align-items does
   that much correctly. But a line box is not what an eye reads. A 24px
   heading reserves room under its baseline for descenders, and that
   room counts toward the box while carrying no ink, so the letters
   ride high against a 14px button label whose box has almost none.

   Measured, not guessed: on a lossless capture of this very heading,
   the capital A spans rows whose center sits 1px above the center of
   the S in Save. Capitals on both sides on purpose — centering on the
   full ink extent would drag the heading around by a pixel whenever
   its wording gained or lost a descender.

   In em rather than px on purpose too: --gecko-fs-xl is a clamp, so
   the heading is not always 24px, and a pixel correction would be
   right at one window width and wrong at every other. */
.gecko-ui .gk-pagehead__text .gk-title:only-child {
    position: relative;
    top: 0.042em;
}

/* ===================================================================
   17. The Color Picker
   -------------------------------------------------------------------
   The swatch and the hex value it currently holds, side by side. The
   value is text rather than a second input because there is no script
   to keep two fields agreeing with each other.
   =================================================================== */

.gecko-ui .gk-colorrow {
    display: flex;
    align-items: center;
    gap: var(--gecko-space-3);
}

.gecko-ui .gk-color {
    width: 56px;
    height: 40px;
    padding: 2px;
    border: 1px solid var(--gecko-border);
    border-radius: var(--gecko-radius-sm, 6px);
    background: var(--gecko-surface);
    cursor: pointer;
}

.gecko-ui .gk-colorvalue {
    font-size: var(--gecko-fs-sm);
    color: var(--gecko-text-muted);
    letter-spacing: 0.04em;
}

/* ===================================================================
   18. Two Cards Across
   -------------------------------------------------------------------
   App Settings holds two short cards. Side by side they read as one
   screen; stacked they read as a list with a lot of white space down
   the right. One column below the fold-over width, where half of a
   phone is not a card.

   No align-items here. A grid row stretches its items to match by
   default, which is exactly what two cards side by side should do, and
   naming align-items: start was the one thing stopping it.
   =================================================================== */

.gecko-ui .gk-settings-grid {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 782px) {
    .gecko-ui .gk-settings-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================================================
   19. A Notice That Leaves By Itself
   -------------------------------------------------------------------
   Five seconds to be read, four tenths to fade, then two seconds
   closing the space it occupied. All of it in CSS: this app had
   exactly one reason to load a script and that reason was removed, so
   a self-dismissing notice is not going to be the thing that brings
   one back.

   IT COLLAPSES BY GRID ROW, NOT BY max-height, and that is the whole
   difference between one movement and two. max-height has to be given
   a number larger than the content, so most of its travel is spent
   above the content's real height where nothing visible happens — a
   pause — and then it crosses the real height and drops everything at
   once. A grid row going 1fr to 0fr interpolates against the height
   the content actually has, so every moment of the animation moves the
   page by the same amount.

   THE NEGATIVE MARGIN AT THE END is not a fudge. .gecko-stack spaces
   its children by putting margin-top on each one after the first, so
   emptying this wrapper would still leave the next element holding its
   own margin — a gap where the notice used to be. Canceling exactly
   that much margin closes it, and because it runs on the same clock as
   the row collapse the two read as one slide.

   linear, not ease: a constant speed is what makes a two-second slide
   look deliberate rather than like it stalled at the end.
   =================================================================== */

@keyframes gk-flash-dismiss {
    0% {
        opacity: 1;
        grid-template-rows: 1fr;
        margin-bottom: 0;
    }
    16.667% {
        opacity: 0;
        grid-template-rows: 1fr;
        margin-bottom: 0;
    }
    100% {
        opacity: 0;
        grid-template-rows: 0fr;
        margin-bottom: calc(var(--gecko-space-4) * -1);
    }
}

.gecko-ui .gk-flash {
    display: grid;
    grid-template-rows: 1fr;
    animation: gk-flash-dismiss 2.4s linear 5s forwards;
}

/* What the grid row squeezes. min-height: 0 is required — a grid item
   refuses to shrink below its content without it. */
.gecko-ui .gk-flash__inner {
    overflow: hidden;
    min-height: 0;
}

/* A second notice in the same group is spaced from the first, since
   the wrapper is now what .gecko-stack sees rather than each notice. */
.gecko-ui .gk-flash__inner > * + * {
    margin-top: var(--gecko-space-3);
}

/* Asked not to be moved: the notice still goes, at the same moment,
   but without the slide. */
@media (prefers-reduced-motion: reduce) {
    .gecko-ui .gk-flash {
        animation-duration: 0.01s;
        animation-delay: 5s;
    }
}

/* ========================================================================== */
/* === 20. A Card's Information Button ==================================== */
/* ========================================================================== */

/* The button is the design system's own .gecko-table__info, which is built
   for exactly this and already carries a 44px hit area, a transparent
   background in every state, and negative vertical margins that stop that
   tall target from making its row taller. Only one thing has to change: in
   a table it sits where the cell puts it, and here it has to go to the far
   end of the header. auto on the left takes every pixel of free space in
   the flex row, which pushes the button to the right regardless of how long
   the title beside it is.

   Written against .gecko-card__header rather than the button alone so it
   outranks the shorthand margin the vendored rule sets, without depending
   on which stylesheet happens to load second. */
.gecko-ui .gecko-card__header .gk-cardinfo {
    margin-left: auto;
}

/* The explanation is a run of paragraphs. The dialog already has padding,
   so the first and last carry no margin of their own and the space goes
   between them, where it separates one answer from the next. */
.gecko-ui .gk-modalbody > p {
    margin: 0;
}

.gecko-ui .gk-modalbody > p + p {
    margin-top: var(--gecko-space-4);
}

/* ========================================================================== */
/* === 21. The Information Modal's Colored Header ========================= */
/* ========================================================================== */

/* A band across the top of the dialog in the app's own color, carrying the
   title and the close button, with the explanation on white beneath it.

   THE COLOR IS A TOKEN, NOT A HEX. --gecko-brand is #004488 until the
   Branding card says otherwise, and brand.php recomputes the whole ramp —
   including the contrast color used for the text on top — for whatever is
   chosen. A pale color therefore gets dark text without anyone deciding
   that here.

   SCOPED TO .gk-infomodal. The design system's modal belongs to the library
   and is used by name elsewhere in it; repainting .gecko-modal outright
   would change a component this application does not own. */
.gecko-ui .gk-infomodal {
    padding: 0;
}

.gecko-ui .gk-infomodal .gecko-modal__header {
    margin: 0;
    padding: var(--gecko-space-4) var(--gecko-space-5);
    background: var(--gecko-brand);
    color: var(--gecko-brand-contrast);

    /* The dialog's own rounding, restated here rather than left to overflow
       clipping, so the corners are right whether or not the explanation is
       long enough to make the dialog scroll. */
    border-top-left-radius: var(--gecko-radius-lg);
    border-top-right-radius: var(--gecko-radius-lg);
}

/* The title inherits the band's text color rather than naming one, so it
   follows the contrast calculation along with everything else. */
.gecko-ui .gk-infomodal .gecko-modal__title {
    color: inherit;
}

/* The close button is red on a white dialog, which is the design system's
   own choice and a good one. On a dark band it would be neither legible nor
   pleasant, so here it takes the band's text color, and its hover uses the
   deeper end of the same ramp rather than the error tint. */
.gecko-ui .gk-infomodal .gecko-modal__close {
    color: var(--gecko-brand-contrast);
}

.gecko-ui .gk-infomodal .gecko-modal__close:hover,
.gecko-ui .gk-infomodal .gecko-modal__close:focus-visible {
    background: var(--gecko-brand-active);
}

/* The padding the dialog gave up so the band could reach the edges. */
.gecko-ui .gk-infomodal .gk-modalbody {
    padding: var(--gecko-space-5);
}

/* No last-child rule here. It used to zero the margin on the final
   paragraph, from when an explanation was a single paragraph and the gap
   would have been trailing whitespace. Now that an explanation is a run of
   them, three classes and a pseudo-class outranked the p + p rule and took
   the gap off the last paragraph only. The paragraphs carry no margin of
   their own, so there is nothing left to correct. */
