/*
 * Incubase's own design, on the one base-camp palette (the same for every incubator).
 * Each kind of user has its own door and dashboard, told apart by which base-camp colour
 * leads, so people know they are in the right place:
 *   founders            spruce                    (theme-founder, the default)
 *   programme staff     night granite, tent orange (theme-staff)
 *   micro-entrepreneurs tent orange               (theme-micro)
 * The climb (the mountain video and the landing's range) is the motif. Geist for headings and
 * text, Geist Mono for big figures, Noto Nastaliq for Urdu. Colours and type come from partials/ib-tokens.
 *
 * Build-free on purpose (no Node on the server): plain classes, prefix "ui-".
 */

/* ---------- Themes ---------- */

:root,
.theme-founder {
    --accent: var(--ib-spruce);
    --accent-text: var(--ib-spruce);
    --accent-deep: var(--ib-spruce-deep);
    --accent-bright: var(--ib-spruce-bright);
    --accent-soft: var(--ib-spruce-soft);
    --accent-hi: var(--ib-orange);
}

.theme-staff {
    --accent: var(--ib-granite);
    --accent-text: var(--ib-granite);
    --accent-deep: var(--ib-night);
    --accent-bright: var(--ib-orange);
    --accent-soft: var(--ib-mist);
    --accent-hi: var(--ib-orange);
}

.theme-micro {
    --accent: var(--ib-orange-text);
    --accent-text: var(--ib-orange-text);
    --accent-deep: var(--ib-night);
    --accent-bright: var(--ib-sun);
    --accent-soft: var(--ib-orange-soft);
    --accent-hi: var(--ib-sun);
}

/* ---------- Page grounds and textures ---------- */

.ui-body {
    margin: 0;
    background: var(--ib-ground);
    color: var(--ib-ink);
    font-family: var(--ib-text);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

.ui-body ::selection {
    background: var(--accent);
    color: #fff;
}

.ui-body :focus-visible {
    outline: 2px solid var(--ib-spruce);
    outline-offset: 2px;
}

/* On the dark surfaces (the portal's sidebar, the door panels, the founder's hero, the range) spruce
   would vanish into the dark: focus shows in spruce-bright instead. The staff door is Filament's page,
   without .ui-body, so its panel is named on its own. */
.ui-body .ui-side :focus-visible,
.ui-body .fh-hero :focus-visible,
.ui-body .lp-range :focus-visible,
.ui-body .ib-try :focus-visible,
.ib-staff-panel :focus-visible {
    outline-color: var(--ib-spruce-bright);
}

/* A soft wash behind public pages. */
.ui-stage {
    background:
        radial-gradient(60rem 30rem at 85% -10%, rgb(15 90 69 / 0.12), transparent 60%),
        radial-gradient(50rem 28rem at -10% 10%, rgb(22 34 43 / 0.08), transparent 60%),
        linear-gradient(180deg, #eef3ef 0%, #e7eeea 100%);
}

/* The same wash on a dashboard, tinted with that user's accent. */
.ui-wash {
    background:
        radial-gradient(48rem 22rem at 100% -8rem, color-mix(in oklab, var(--accent) 9%, transparent), transparent 70%),
        linear-gradient(180deg, #eef3ef 0%, #eaf0ec 100%);
}

/* ---------- Urdu ---------- */

.urdu,
.urdu .ui-urdu-able {
    font-family: var(--ib-urdu);
}

.urdu :is(h1, h2, h3, p, label, a, button, span, li, time, summary, dt, dd):not(.latin, .latin *) {
    line-height: 2.2;
    letter-spacing: normal;
}

/* Digits, phone numbers and PINs stay in Geist on Urdu pages. */
.urdu .latin,
.latin {
    font-family: var(--ib-text);
}

.urdu .latin {
    line-height: 1.5;
}

/* Content staff wrote may be Urdu on an English page: it aligns by its own language. */
.ui-ugc {
    unicode-bidi: plaintext;
}

/* ---------- Icons ---------- */

.ib-ico {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

[dir="rtl"] .ui-flip {
    transform: rotate(180deg);
}

/* ---------- Type ---------- */

.ui-eyebrow {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0;
    color: var(--accent-text);
}

.ui-eyebrow.is-bright {
    color: var(--accent-bright);
}

.ui-eyebrow.is-muted {
    color: var(--ib-ink-soft);
}

.urdu .ui-eyebrow:not(.latin) {
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
}

.ui-h1 {
    margin: 0;
    font-family: var(--ib-display);
    font-size: clamp(1.6rem, 3vw, 2rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: var(--ib-head-tracking);
    color: var(--ib-ink);
    text-wrap: balance;
}

.urdu .ui-h1 {
    font-family: var(--ib-urdu);
    font-weight: 600;
}

.ui-lead {
    margin: 0.5rem 0 0;
    color: var(--ib-ink-soft);
    line-height: 1.6;
}

.ui-muted {
    color: var(--ib-ink-soft);
}

/* ---------- Buttons: radius 10px, 44px tall (40px small), Geist 500 15px ----------
   Primary is solid spruce on every page and door, with a faint top highlight and a soft
   spruce-tinted shadow; it lifts 1px on hover and presses to 98%. Secondary is white with a
   hairline on light grounds (is-ghost) and frosted glass on the video and dark bands (is-glass).
   An arrow (the arrow prop) only where the button goes somewhere, never on a form's submit. */

.ui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: var(--ib-btn-h);
    margin: 0;
    padding: 0 1.15rem;
    border: 0;
    border-radius: var(--ib-btn-radius);
    background: var(--ib-spruce);
    color: #fff;
    font: 500 15px/1.2 var(--ib-text);
    letter-spacing: -0.005em;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--ib-btn-shadow);
    transition: background-color 0.2s var(--ib-ease), box-shadow 0.2s var(--ib-ease), transform 0.2s var(--ib-ease), color 0.2s var(--ib-ease);
}

.ui-btn:hover {
    background: var(--ib-spruce-hover);
    color: #fff;
    box-shadow: var(--ib-btn-shadow-hover);
    transform: translateY(-1px);
}

.ui-btn:active {
    box-shadow: var(--ib-btn-shadow);
    transform: scale(0.98);
}

.ui-btn:focus-visible {
    outline: 2px solid var(--ib-spruce);
    outline-offset: 2px;
}

.ui-btn .ib-ico {
    width: 1.1rem;
    height: 1.1rem;
}

.ui-btn .ui-arrow {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s var(--ib-ease);
}

.ui-btn:hover .ui-arrow {
    transform: translateX(2px);
}

[dir="rtl"] .ui-btn .ui-arrow {
    transform: rotate(180deg);
}

[dir="rtl"] .ui-btn:hover .ui-arrow {
    transform: rotate(180deg) translateX(2px);
}

/* Secondary on a light ground: white, a hairline, granite words. */
.ui-btn.is-ghost {
    background: var(--ib-paper);
    color: var(--ib-granite);
    box-shadow: inset 0 0 0 1px var(--ib-btn-line), 0 1px 2px rgb(22 34 43 / 0.05);
}

.ui-btn.is-ghost:hover {
    background: var(--ib-ground);
    color: var(--ib-granite);
    box-shadow: inset 0 0 0 1px var(--ib-scree), 0 4px 12px -8px rgb(22 34 43 / 0.3);
}

/* Secondary on the video or a dark band: frosted glass with a light edge. */
.ui-btn.is-glass {
    background: rgb(255 255 255 / 0.12);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.3), inset 0 1px 0 rgb(255 255 255 / 0.2);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    backdrop-filter: blur(12px) saturate(140%);
}

.ui-btn.is-glass:hover {
    background: rgb(255 255 255 / 0.2);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.45), inset 0 1px 0 rgb(255 255 255 / 0.24);
}

.ui-btn.is-glass:focus-visible {
    outline-color: var(--ib-spruce-bright);
}

/* No blur where it is not supported or not wanted: a solid night fill instead. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .ui-btn.is-glass {
        background: rgb(11 20 25 / 0.72);
    }
}

@media (prefers-reduced-transparency: reduce) {
    .ui-btn.is-glass {
        background: rgb(11 20 25 / 0.82);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

/* A text-only action, for the quiet way in. */
.ui-btn.is-quiet {
    padding-inline: 0.75rem;
    background: transparent;
    color: var(--ib-ink-soft);
    box-shadow: none;
}

.ui-btn.is-quiet:hover {
    background: rgb(22 34 43 / 0.05);
    color: var(--ib-ink);
    box-shadow: none;
    transform: none;
}

.ui-btn.is-block {
    width: 100%;
}

.ui-btn.is-lg {
    padding-inline: 1.35rem;
    font-size: 16px;
}

.ui-btn.is-sm {
    min-height: var(--ib-btn-h-sm);
    padding-inline: 0.9rem;
    font-size: 14px;
}

.ui-btn[aria-busy="true"] {
    opacity: 0.8;
    cursor: progress;
}

.ui-btn:disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* ---------- Fields: a visible label on every input, the error under its own field ---------- */

.ui-form {
    display: grid;
    gap: 1.25rem;
    margin: 2rem 0 0;
}

.ui-field {
    display: block;
    min-width: 0;
}

.ui-label {
    display: block;
    margin: 0 0 0.4rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ib-ink);
}

.urdu .ui-label {
    font-size: 1rem;
}

.ui-control {
    position: relative;
}

.ui-control > .ib-ico {
    position: absolute;
    top: 50%;
    inset-inline-start: 0.95rem;
    width: 1.1rem;
    height: 1.1rem;
    transform: translateY(-50%);
    color: var(--ib-ink-faint);
    pointer-events: none;
}

.ui-input {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-height: 3rem;
    margin: 0;
    padding: 0.7rem 1rem;
    border: 1px solid var(--ib-line);
    border-radius: 0.75rem;
    background: var(--ib-paper);
    color: var(--ib-ink);
    font: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ui-control > .ib-ico ~ .ui-input {
    padding-inline-start: 2.8rem;
}

.ui-control.has-end .ui-input {
    padding-inline-end: 3.2rem;
}

.ui-input::placeholder {
    color: var(--ib-ink-faint);
}

.ui-input:hover {
    border-color: color-mix(in srgb, var(--ib-line) 60%, var(--ib-ink-faint));
}

.ui-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.ui-input[aria-invalid="true"] {
    border-color: color-mix(in srgb, var(--ib-danger) 70%, #fff);
}

.ui-input.is-pin {
    font-size: 1.5rem;
    letter-spacing: 0.6em;
    text-align: center;
    text-indent: 0.6em;
}

textarea.ui-input {
    min-height: 7rem;
    resize: vertical;
    line-height: 1.6;
}

.ui-end {
    position: absolute;
    top: 50%;
    inset-inline-end: 0.35rem;
    display: inline-flex;
    width: 2.6rem;
    height: 2.6rem;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 0.6rem;
    background: transparent;
    color: var(--ib-ink-faint);
    cursor: pointer;
}

.ui-end:hover {
    background: var(--accent-soft);
    color: var(--accent-text);
}

.ui-error {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin: 0.45rem 0 0;
    font-size: 0.875rem;
    color: var(--ib-danger);
}

.ui-error .ib-ico {
    width: 1rem;
    height: 1rem;
    margin-top: 0.15rem;
}

.ui-hint {
    margin: 0.45rem 0 0;
    font-size: 0.85rem;
    color: var(--ib-ink-soft);
}

.ui-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.75rem;
    font-size: 0.875rem;
    color: var(--ib-ink-soft);
    cursor: pointer;
}

.ui-check input {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    accent-color: var(--accent);
}

/* Notices at the top of a form. */
.ui-note {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 1.25rem 0 0;
    padding: 0.85rem 1rem;
    border-radius: 0.85rem;
    font-size: 0.92rem;
    line-height: 1.55;
}

.ui-note .ib-ico {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.12rem;
}

.ui-note.is-ok {
    background: var(--ib-teal-soft);
    color: var(--ib-teal-deep);
}

.ui-note.is-bad {
    background: var(--ib-danger-soft);
    color: var(--ib-danger);
}

.ui-note.is-warn {
    background: var(--ib-ember-soft);
    color: var(--ib-ink);
}

/* ---------- Badges ---------- */

.ui-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    background: var(--ib-paper);
    box-shadow: inset 0 0 0 1px var(--ib-line);
    color: var(--ib-ink-soft);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.urdu .ui-badge:not(.latin) {
    font-size: 0.875rem;
}

.ui-badge.is-accent {
    background: var(--accent-soft);
    box-shadow: none;
    color: var(--accent-deep);
}

.ui-badge.is-teal {
    background: var(--ib-teal-soft);
    box-shadow: none;
    color: var(--ib-teal-deep);
}

.ui-badge.is-plum {
    background: var(--ib-plum-soft);
    box-shadow: none;
    color: var(--ib-ink);
}

.ui-badge.is-ember {
    background: var(--ib-ember-soft);
    box-shadow: none;
    color: var(--ib-ember-text);
}

.ui-badge.is-danger {
    background: var(--ib-danger-soft);
    box-shadow: none;
    color: var(--ib-danger);
}

.ui-badge.is-sand {
    background: var(--ib-sand);
    box-shadow: none;
    color: var(--ib-ink);
}

/* ---------- Cards: paper, a soft lift, an icon header in the page's accent ---------- */

.ui-card {
    min-width: 0;
    padding: 1.25rem;
    border: 1px solid var(--ib-line);
    border-radius: var(--ib-radius);
    background: var(--ib-paper);
    box-shadow: 0 1px 2px rgb(22 34 43 / 0.04), 0 14px 34px -26px rgb(22 34 43 / 0.28);
    scroll-margin-top: 6rem;
}

@media (min-width: 640px) {
    .ui-card {
        padding: 1.5rem;
    }
}

@media (min-width: 768px) {
    .ui-card {
        padding: 1.75rem;
    }
}

.ui-card-head {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0 0 1.25rem;
}

.ui-card-ico {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    color: var(--card-ico, var(--accent-text));
}

.ui-card-title {
    margin: 0;
    font-family: var(--ib-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ib-ink);
    letter-spacing: var(--ib-head-tracking);
}

.urdu .ui-card-title {
    font-family: var(--ib-urdu);
    font-size: 1.25rem;
}

.ui-card-actions {
    margin-inline-start: auto;
}

/* Rows inside a card, on hairlines. */
.ui-rows > * + * {
    border-top: 1px solid var(--ib-line);
}

.ui-row {
    padding: 0.85rem 0;
}

.ui-row:first-child {
    padding-top: 0;
}

.ui-row:last-child {
    padding-bottom: 0;
}

/* ---------- Stat tiles: a label, its icon, one big figure, a bar, a line ---------- */

.ui-tile {
    position: relative;
}

.ui-tile-label {
    margin: 0;
    padding-inline-end: 2.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ib-ink-soft);
}

.urdu .ui-tile-label:not(.latin) {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
}

.ui-tile-ico {
    position: absolute;
    top: 0;
    inset-inline-end: 0;
    color: var(--accent-text);
}

.ui-tile-value {
    margin: 0.75rem 0 0;
    font-family: var(--ib-display);
    font-size: 2.2rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: var(--ib-head-tracking);
    color: var(--ib-ink);
    font-variant-numeric: tabular-nums;
}

/* A bare figure (a count, a share, money) in Geist Mono; a date or "5 of 11" stays in Geist. */
.ui-tile-value.is-figure {
    font-family: var(--ib-mono);
    font-weight: 500;
    letter-spacing: -0.03em;
}

.ui-tile-value.is-warm {
    color: var(--ib-ember-text);
}

.ui-tile-value.is-accent {
    color: var(--accent-text);
}

.ui-tile-value small {
    font-size: 1.15rem;
    color: var(--ib-ink-soft);
}

.ui-tile-text {
    margin: 0.75rem 0 0;
    font-family: var(--ib-display);
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: var(--ib-head-tracking);
}

.ui-tile-meta {
    margin: 0.75rem 0 0;
    font-size: 0.875rem;
    color: var(--ib-ink-soft);
}

.ui-bar {
    height: 0.45rem;
    margin: 1rem 0 0;
    overflow: hidden;
    border-radius: 999px;
    background: var(--ib-sand);
}

.ui-bar > i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
    transform-origin: left center;
    animation: ui-fill 0.5s var(--ib-ease) 0.2s both;
}

[dir="rtl"] .ui-bar > i {
    transform-origin: right center;
}

.ui-bar > i.is-warm {
    background: var(--ib-ember-text);
}

/* ---------- Layout helpers ---------- */

.ui-grid {
    display: grid;
    gap: 1.25rem;
}

.ui-grid.is-3 {
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.ui-grid.is-2 {
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
}

.ui-grid.is-main {
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1100px) {
    .ui-grid.is-main {
        grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
        align-items: start;
    }
}

.ui-stack {
    display: grid;
    gap: 1.25rem;
    align-content: start;
    min-width: 0;
}

/* The page's entrance: blocks fade up 8px out of a short blur, one after another, 60ms apart
   (style="--i: 2"). Under reduced motion they are simply there. */
.ui-rise {
    animation: ui-rise 0.5s var(--ib-ease) both;
    animation-delay: calc(var(--i, 0) * 60ms);
}

@keyframes ui-rise {
    from {
        opacity: 0;
        transform: translateY(8px);
        filter: blur(6px);
    }
}

@keyframes ui-fill {
    from {
        transform: scaleX(0);
    }
}

/* ---------- Language switch: اردو | English ---------- */

.ui-lang {
    display: inline-flex;
    flex-shrink: 0;
    padding: 0.25rem;
    border-radius: 999px;
    background: var(--ib-paper);
    box-shadow: inset 0 0 0 1px var(--ib-line), 0 1px 2px rgb(22 34 43 / 0.06);
    direction: ltr;
}

.ui-lang button {
    min-height: 2.25rem;
    padding: 0 0.95rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ib-ink-soft);
    font: inherit;
    font-family: var(--ib-text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.ui-lang button.is-ur {
    font-family: var(--ib-urdu);
}

.ui-lang button[aria-pressed="true"] {
    background: var(--accent);
    color: #fff;
}

.ui-lang button:not([aria-pressed="true"]):hover {
    background: var(--accent-soft);
    color: var(--ib-ink);
}

/* =====================================================================
   The shell: a sidebar in the user's colour, a slim top bar, the page.
   On a phone the sidebar is a drawer behind the menu button.
   ===================================================================== */

.ui-shell {
    min-height: 100vh;
    min-height: 100dvh;
}

@media (min-width: 1024px) {
    .ui-shell {
        display: grid;
        grid-template-columns: 17rem minmax(0, 1fr);
    }
}

.ui-side {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 50;
    width: min(18rem, 86vw);
    background: var(--accent-deep);
    color: rgb(255 255 255 / 0.75);
    transition: transform 0.3s var(--ib-ease), visibility 0.3s;
}

@media (max-width: 1023.98px) {
    .ui-side {
        transform: translateX(-100%);
        visibility: hidden;
    }

    [dir="rtl"] .ui-side {
        transform: translateX(100%);
    }

    .ui-side.is-open {
        transform: none;
        visibility: visible;
    }
}

@media (min-width: 1024px) {
    .ui-side {
        position: static;
        width: auto;
    }
}

.ui-side-in {
    position: relative;
    display: flex;
    height: 100%;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
}

@media (min-width: 1024px) {
    .ui-side-in {
        position: sticky;
        top: 0;
        height: 100vh;
        height: 100dvh;
    }
}

.ui-side-top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem 0.75rem;
}

.ui-side-top a {
    color: #fff;
    text-decoration: none;
}

.ui-side-role {
    position: relative;
    margin: 0;
    padding: 0 1.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--accent-bright);
}

.urdu .ui-side-role {
    font-size: 1rem;
    letter-spacing: normal;
    text-transform: none;
}

.ui-icon-btn {
    display: inline-flex;
    width: 2.75rem;
    height: 2.75rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0.75rem;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.ui-icon-btn:hover {
    background: rgb(255 255 255 / 0.1);
}

.ui-side .ui-icon-btn {
    color: rgb(255 255 255 / 0.8);
}

@media (min-width: 1024px) {
    .ui-side .ui-icon-btn,
    .ui-top .ui-menu-btn {
        display: none;
    }
}

.ui-nav {
    position: relative;
    flex: 1;
    margin: 1rem 0 0;
    padding: 0 0.75rem;
}

.ui-nav ul {
    display: grid;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ui-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.75rem;
    padding: 0 0.75rem;
    border-radius: 0.75rem;
    color: rgb(255 255 255 / 0.75);
    font-size: 0.94rem;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.urdu .ui-nav a {
    font-size: 1.05rem;
}

.ui-nav a .ib-ico {
    width: 1.15rem;
    height: 1.15rem;
    color: rgb(255 255 255 / 0.5);
    transition: color 0.2s;
}

.ui-nav a:hover {
    background: rgb(255 255 255 / 0.06);
    color: #fff;
}

.ui-nav a:hover .ib-ico,
.ui-nav a[aria-current] .ib-ico {
    color: var(--accent-bright);
}

.ui-nav a[aria-current] {
    background: rgb(255 255 255 / 0.1);
    color: #fff;
}

.ui-nav-count {
    margin-inline-start: auto;
    min-width: 1.4rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: var(--ib-ember);
    color: var(--ib-ink-deep);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4rem;
    text-align: center;
}

.ui-me {
    position: relative;
    margin: 0.75rem;
    padding: 0.75rem;
    border-radius: 1rem;
    background: rgb(255 255 255 / 0.06);
}

.ui-me-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.25rem;
}

.ui-avatar {
    display: inline-flex;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--accent-bright);
    color: var(--accent-deep);
    font-family: var(--ib-text);
    font-size: 0.875rem;
    font-weight: 600;
}

.ui-me-name {
    display: block;
    overflow: hidden;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ui-me-sub {
    display: block;
    overflow: hidden;
    font-size: 0.75rem;
    color: rgb(255 255 255 / 0.6);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ui-me-out {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 2.75rem;
    margin: 0.5rem 0 0;
    padding: 0 0.75rem;
    border: 0;
    border-radius: 0.75rem;
    background: transparent;
    color: rgb(255 255 255 / 0.75);
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
}

.ui-me-out:hover {
    background: rgb(255 255 255 / 0.1);
    color: #fff;
}

[dir="rtl"] .ui-me-out .ib-ico {
    transform: rotate(180deg);
}

.ui-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgb(22 34 43 / 0.45);
    backdrop-filter: blur(2px);
}

.ui-backdrop[hidden] {
    display: none;
}

@media (min-width: 1024px) {
    .ui-backdrop {
        display: none;
    }
}

.ui-main {
    min-width: 0;
}

.ui-top {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1.25rem;
    border-bottom: 1px solid var(--ib-line);
    background: rgb(238 243 239 / 0.86);
    backdrop-filter: blur(16px);
}

@media (min-width: 1024px) {
    .ui-top {
        padding: 0.9rem 2rem;
    }
}

.ui-top .ui-menu-btn {
    color: var(--ib-ink);
}

.ui-top .ui-menu-btn:hover {
    background: var(--accent-soft);
}

.ui-top-words {
    min-width: 0;
}

.ui-top-title {
    margin: 0.1rem 0 0;
    overflow: hidden;
    font-family: var(--ib-display);
    font-size: clamp(1.2rem, 2.4vw, 1.55rem);
    font-weight: 600;
    line-height: 1.2;
    color: var(--ib-ink);
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: var(--ib-head-tracking);
}

.urdu .ui-top-title {
    font-family: var(--ib-urdu);
    line-height: 1.8;
}

.ui-top-end {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-inline-start: auto;
}

.ui-content {
    padding: 1.5rem 1.25rem 4rem;
}

@media (min-width: 1024px) {
    .ui-content {
        padding: 2rem 2rem 4rem;
    }
}

.ui-content-in {
    max-width: 78rem;
    margin: 0 auto;
}

/* ---------- The public front door ---------- */

.ui-pub-top {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid color-mix(in srgb, var(--ib-line) 70%, transparent);
    background: rgb(238 243 239 / 0.8);
    backdrop-filter: blur(20px);
}

.ui-pub-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
}

@media (min-width: 768px) {
    .ui-pub-nav {
        padding-inline: 2.5rem;
    }
}

.ui-pub-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

@media (min-width: 768px) {
    .ui-pub-wrap {
        padding-inline: 2.5rem;
    }
}

/* A programme's door on the front page: the dark copy drops open on hover or focus. */
.ui-prog {
    position: relative;
    display: flex;
    min-height: 19rem;
    flex-direction: column;
    overflow: hidden;
    padding: 2rem;
    border: 1px solid var(--ib-line);
    border-radius: 1.25rem;
    background: var(--ib-paper);
    box-shadow: 0 1px 2px rgb(22 34 43 / 0.04), 0 22px 50px -34px rgb(22 34 43 / 0.4);
    color: var(--ib-ink);
    text-decoration: none;
}

@media (min-width: 768px) {
    .ui-prog {
        padding: 2.5rem;
    }
}

.ui-prog-ico {
    display: inline-flex;
    width: 3rem;
    height: 3rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.85rem;
    background: var(--accent-soft);
    color: var(--accent-text);
}

.ui-prog h3 {
    margin: 0.5rem 0 0;
    font-family: var(--ib-display);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: var(--ib-head-tracking);
}

.ui-prog p {
    max-width: 26rem;
    margin: 0.75rem 0 0;
    color: var(--ib-ink-soft);
    line-height: 1.6;
}

.ui-prog .ui-btn {
    align-self: flex-start;
    margin-top: auto;
}

.ui-prog-urdu {
    margin: 0.4rem 0 0;
    font-family: var(--ib-urdu);
    font-size: 1.4rem;
    line-height: 1.9;
    color: var(--ib-ink);
}

.ui-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.25rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--ib-line);
    border-radius: 1.25rem;
    background: rgb(255 255 255 / 0.65);
}

.ui-strip b {
    display: block;
    font-family: var(--ib-display);
    font-size: 1.15rem;
    letter-spacing: var(--ib-head-tracking);
}

.ui-strip span {
    font-size: 0.9rem;
    color: var(--ib-ink-soft);
}

.ui-strip .ui-btn {
    margin-inline-start: auto;
}

.ui-figures {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 1.5rem;
    margin: 0;
    padding: 2.5rem 0;
    border-top: 1px solid var(--ib-line);
}

.ui-figures dt {
    font-size: 0.9rem;
    color: var(--ib-ink-soft);
}

.ui-figures dd {
    margin: 0;
    font-family: var(--ib-display);
    font-size: clamp(2.2rem, 4vw, 3rem);
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: var(--ib-head-tracking);
}

.ui-figures div {
    display: flex;
    flex-direction: column-reverse;
    gap: 0.3rem;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .ui-rise,
    .ui-bar > i {
        animation: none;
    }

    .ui-side,
    .ui-btn {
        transition: none;
    }
}

/* ---------- Door details: the emailed link, the divider, the small print ---------- */

.ui-more {
    margin: 1.25rem 0 0;
    border-radius: 0.85rem;
    background: rgb(255 255 255 / 0.55);
    box-shadow: inset 0 0 0 1px var(--ib-line);
}

.ui-more > summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 2.75rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ib-ink);
    cursor: pointer;
    list-style: none;
}

.ui-more > summary::-webkit-details-marker {
    display: none;
}

.ui-more > summary .ib-ico {
    width: 1.05rem;
    height: 1.05rem;
    color: var(--accent-text);
}

.ui-more > summary .ui-chev {
    margin-inline-start: auto;
    color: var(--ib-ink-faint);
    transition: transform 0.2s var(--ib-ease);
}

.ui-more[open] > summary .ui-chev {
    transform: rotate(90deg);
}

.ui-more-body {
    padding: 0 1rem 1rem;
}

.ui-more-body .ui-form {
    gap: 0.85rem;
    margin-top: 0.75rem;
}

.ui-or {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin: 1.75rem 0 0;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ib-ink-soft);
}

.ui-or::before,
.ui-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--ib-line);
}

.ui-tile.is-link {
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.2s, transform 0.2s;
}

.ui-tile.is-link:hover {
    box-shadow: 0 0 0 1px var(--accent), 0 18px 40px -28px rgb(22 34 43 / 0.45);
}

/* The reveal button's two icons: the open eye until the password shows. */
.ui-end .is-hide,
.ui-end[aria-pressed="true"] .is-show {
    display: none;
}

.ui-end[aria-pressed="true"] .is-hide {
    display: block;
}

/* =====================================================================
   The landing page: the incubator's front door.
   ===================================================================== */

.lp-mark {
    display: inline-flex;
    align-items: center;
    color: var(--ib-ink);
    text-decoration: none;
}

.lp-mark img {
    display: block;
    height: 2.6rem;
    width: auto;
}

.lp-mark img.ib-logo-stacked {
    height: 3.6rem;
}

.lp-name {
    font-family: var(--ib-display);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: var(--ib-head-tracking);
}

@media (prefers-reduced-motion: no-preference) {
    .lp-pulse {
        transform-box: fill-box;
        transform-origin: center;
        animation: lp-pulse 2.4s ease-in-out infinite;
    }

    @keyframes lp-pulse {
        50% {
            transform: scale(1.35);
            opacity: 0.5;
        }
    }
}

/* ---------- The shell beside the portal's page styles (incubase-ui.css) ---------- */

.ui-shell .ui-content {
    max-width: none;
    margin: 0;
}

.ui-shell .ui-icon-btn {
    padding: 0;
    box-shadow: none;
}

.ui-me a.ui-me-out {
    text-decoration: none;
}

.ui-me form {
    margin: 0;
}

.ui-guest-main {
    padding-block: 2rem 4rem;
}

.ui-shell .ib-foot {
    margin-top: 0;
}

/* =====================================================================
   The founder's home (portal/dashboard, portal/partials/home-top): the startup on a spruce
   band with its week trail, four tiles, then cards; one column on a phone.
   ===================================================================== */

.ui-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* The founder's band: the startup, its week trail and four glass tiles, over the incubator's own
   sign-in photo blurred and darkened (no video in the app), under the desk's gradient and glow
   (App\Support\DeskTint; spruce where none is set). Words on it are white or near white. */
.fh-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin: 0 0 1.25rem;
    padding: 1.5rem 1.25rem 1.25rem;
    border-radius: 1.25rem;
    background: var(--desk-from, var(--ib-founder-a));
    color: var(--ib-founder-ink);
    box-shadow: 0 26px 48px -34px rgb(6 36 28 / 0.8);
}

.fh-hero::before {
    content: "";
    position: absolute;
    inset: -3rem;
    z-index: -2;
    background: var(--ib-hero-photo, none) 50% 55% / cover no-repeat;
    filter: blur(28px) saturate(1.1) brightness(0.5);
    pointer-events: none;
}

.fh-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(40rem 22rem at var(--desk-glow-at, 100% 0%), var(--desk-glow, rgb(127 220 180 / 0.18)), transparent 70%),
        linear-gradient(135deg,
            color-mix(in srgb, var(--desk-from, var(--ib-founder-a)) 90%, transparent) 0%,
            color-mix(in srgb, var(--desk-to, var(--ib-spruce-deep)) 84%, transparent) 100%);
    pointer-events: none;
}

@media (min-width: 640px) {
    .fh-hero {
        padding: 2rem 2rem 1.5rem;
    }
}

.fh-eyebrow {
    margin: 0 0 0.45rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ib-spruce-bright);
}

.ui-shell .fh-name {
    max-width: 18ch;
    margin: 0;
    font-size: clamp(1.9rem, 4vw, 2.5rem);
    line-height: 1.08;
    letter-spacing: var(--ib-head-tracking);
    color: #fff;
}

/* The week trail on the band: walked weeks in spruce-bright, this week in tent orange. */
.fh-hero .rt {
    display: block;
    margin: 1.4rem 0 0;
    padding: 1rem 1rem 0.75rem;
    border-radius: 0.95rem;
    background: rgb(255 255 255 / 0.07);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1);
    color: #fff;
    text-decoration: none;
    transition: background-color 0.25s var(--ib-ease);
}

.fh-hero .rt:hover {
    background: rgb(255 255 255 / 0.11);
}

.fh-hero .rt:focus-visible {
    outline: 2px solid var(--ib-spruce-bright);
    outline-offset: 3px;
}

.rt-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1.4rem;
}

.rt-head b {
    font: 500 2rem/1 var(--ib-mono);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: #fff;
}

.rt-of {
    font: 500 1.05rem/1 var(--ib-mono);
    font-variant-numeric: tabular-nums;
    color: rgb(239 250 245 / 0.75);
}

.rt-span {
    margin-left: auto;
    font-size: 0.8rem;
    color: rgb(239 250 245 / 0.75);
}

.rt-track {
    display: grid;
    align-items: end;
    gap: 3px;
}

.rt-w {
    position: relative;
    min-width: 0;
}

.rt-marks {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 2px;
    height: 1.1rem;
    margin-bottom: 4px;
}

.rt-s {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ib-spruce-bright);
}

.rt-d {
    display: inline-block;
    width: 0;
    height: 0;
    border-right: 4px solid transparent;
    border-bottom: 7px solid var(--ib-orange);
    border-left: 4px solid transparent;
}

.rt-d.done {
    border-bottom-color: rgb(239 250 245 / 0.45);
}

.rt-seg {
    height: 8px;
    border-radius: 999px;
    background: rgb(255 255 255 / 0.16);
}

.rt-w.past .rt-seg {
    background: var(--ib-spruce-bright);
}

.rt-w.now .rt-seg {
    height: 12px;
    background: var(--ib-orange);
}

.rt-w.now::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: calc(50% - 6px);
    width: 12px;
    height: 12px;
    margin-bottom: -0.05rem;
    border-radius: 50%;
    background: var(--ib-orange);
    box-shadow: 0 0 0 3px var(--ib-spruce-deep);
}

.rt-m {
    height: 1rem;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    color: rgb(239 250 245 / 0.72);
}

.rt-key {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    margin: 0.6rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.75rem;
    color: rgb(239 250 245 / 0.75);
}

.rt-key li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Four glass tiles on the band: two-up on a phone, four across on a wide screen. A little white
   over the blurred band, a light edge and a top highlight; solid night where the blur is
   unsupported or less transparency is asked for. */
.fh-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1.25rem 0 0;
}

.fh-tiles .ui-tile {
    border: 0;
    border-radius: 14px;
    background: rgb(255 255 255 / 0.08);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14), inset 0 1px 0 rgb(255 255 255 / 0.12);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    color: #fff;
}

@media (max-width: 767.98px) {
    .fh-tiles .ui-tile {
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
    }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .fh-tiles .ui-tile {
        background: rgb(6 36 28 / 0.6);
    }
}

@media (prefers-reduced-transparency: reduce) {
    .fh-tiles .ui-tile {
        background: rgb(6 36 28 / 0.75);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

@media (min-width: 1100px) {
    .fh-tiles {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1rem;
    }
}

.fh-tiles .ui-tile {
    padding: 1rem;
    text-decoration: none;
    color: inherit;
}

@media (min-width: 640px) {
    .fh-tiles .ui-tile {
        padding: 1.2rem 1.25rem;
    }
}

.fh-tiles .ui-tile.is-link {
    transition: box-shadow 0.25s var(--ib-ease), transform 0.25s var(--ib-ease);
}

.fh-tiles .ui-tile.is-link:hover {
    background: rgb(255 255 255 / 0.12);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.24), inset 0 1px 0 rgb(255 255 255 / 0.14), 0 18px 40px -24px rgb(6 20 25 / 0.7);
    transform: translateY(-2px);
}

.fh-tiles .ui-tile-label {
    padding-inline-end: 1.75rem;
    font-size: 0.8125rem;
    color: rgb(255 255 255 / 0.86);
}

.fh-tiles .ui-tile-ico {
    top: 1rem;
    inset-inline-end: 1rem;
    width: 1.25rem;
    height: 1.25rem;
    color: var(--desk-accent, var(--ib-spruce-bright));
}

@media (min-width: 640px) {
    .fh-tiles .ui-tile-ico {
        top: 1.2rem;
        inset-inline-end: 1.25rem;
    }
}

.fh-tiles .ui-tile-value {
    margin-top: 0.6rem;
    font-size: clamp(1.7rem, 4vw, 2.2rem);
    color: #fff;
}

.fh-tiles .ui-tile-value small {
    color: rgb(255 255 255 / 0.74);
}

/* Below the policy or the gate: tent orange, which holds 4.5:1 on the band. */
.fh-tiles .ui-tile-value.is-warm {
    color: var(--ib-orange);
}

.fh-tiles .ui-bar {
    background: rgb(255 255 255 / 0.16);
}

.fh-tiles .ui-bar > i {
    background: var(--ib-spruce-bright);
}

.fh-tiles .ui-bar > i.is-warm {
    background: var(--ib-orange);
}

/* Bare figures in Geist Mono (the .latin guard is for Urdu pages, where the text face changes). */
.fh-tiles .ui-tile-value.is-figure .latin {
    font-family: var(--ib-mono);
    letter-spacing: -0.03em;
}

.fh-tiles .ui-tile-meta {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    line-height: 1.45;
    color: rgb(255 255 255 / 0.8);
    overflow-wrap: anywhere;
}

.fh-clip {
    display: -webkit-box;
    overflow: hidden;
    font-weight: 600;
    color: #fff;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* A bar with the line it must clear: the policy or the gate. */
.fh-gauge {
    position: relative;
    overflow: visible;
    margin-top: 0.75rem;
}

.fh-gauge > b {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    margin-left: -1px;
    border-radius: 2px;
    background: #fff;
}

/* The cards: two columns from a wide screen, Do next across the top. */
.fh-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 1100px) {
    .fh-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
    }

    .fh-wide {
        grid-column: 1 / -1;
    }
}

.fh-grid > .ui-card,
.fh-wide > .ui-card,
.fh-reports {
    margin: 0;
}

.fh-reports {
    margin-bottom: 1rem;
}

.ui-card .ui-card-actions {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-text);
    text-decoration: none;
}

.ui-card a.ui-card-actions:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.fh-empty {
    margin: 0;
    color: var(--ib-ink-soft);
}

.fh-lead {
    margin: 0;
}

.fh-note {
    margin: 0.4rem 0 0;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--ib-ink-soft);
}

.fh-rows {
    margin-top: 0.75rem;
}

.fh-row {
    padding: 0.75rem 0;
    border-top: 1px solid var(--ib-line);
}

.fh-row:first-child {
    padding-top: 0;
    border-top: 0;
}

.fh-row .meta {
    font-size: 0.82rem;
    color: var(--ib-ink-soft);
}

.fh-link {
    color: var(--ib-ink);
    text-decoration: underline;
    text-decoration-color: var(--ib-line);
    text-underline-offset: 3px;
}

.fh-link:hover {
    color: var(--accent-text);
    text-decoration-color: currentColor;
}

.fh-nowrap {
    white-space: nowrap;
}

.fh-card .kpi {
    grid-template-columns: minmax(0, 1fr) 6rem 3rem;
}

/* Attendance rows have no bar: the session, then its state. */
.fh-card .fh-att .kpi {
    grid-template-columns: minmax(0, 1fr) auto;
}

.fh-card .fh-att .kpi > :nth-child(2) {
    display: none;
}

@media (max-width: 480px) {
    .fh-card .kpi {
        grid-template-columns: minmax(0, 1fr) 3.5rem;
    }

    .fh-card .kpi > .bar {
        display: none;
    }
}

/* Graduation standing: the dark spruce panel at the head of the KPI card. */
.fh-card .standing {
    margin: 0 0 0.5rem;
    padding: 1.1rem 1.2rem 1.15rem;
    border-radius: 0.9rem;
}

.fh-card .standing .score span {
    font-size: 1.1rem;
}

.fh-lib {
    margin: 0;
    padding: 0;
    list-style: none;
}

.fh-lib li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    padding: 0.6rem 0;
    border-top: 1px solid var(--ib-line);
    font-size: 0.92rem;
}

.fh-lib li:first-child {
    padding-top: 0;
    border-top: 0;
}

.fh-lib a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--accent-text);
    font-weight: 500;
    text-decoration: none;
}

.fh-lib a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.fh-lib .meta {
    font-size: 0.8rem;
    color: var(--ib-ink-soft);
}

.fh-ext {
    width: 0.9rem;
    height: 0.9rem;
}

.fh-sub {
    margin: 0 0 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ib-ink-soft);
}

.fh-sub:not(:first-of-type) {
    margin-top: 1.25rem;
}

.fh-report {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--ib-line);
}

.fh-sub + .fh-report {
    padding-top: 0;
    border-top: 0;
}

/* Do next: the countdown is the loudest thing on the row; the tone says how close it is. */
.dn-row {
    display: grid;
    grid-template-columns: 5rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    margin-bottom: 8px;
    padding: 0.85rem 1rem 0.85rem 1.2rem;
}

.dn-row:last-child {
    margin-bottom: 0;
}

.dn-count b {
    display: block;
    font: 500 1.85rem/1 var(--ib-mono);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: var(--tone-ink);
}

.dn-count span {
    font-size: 0.78rem;
    color: var(--ib-ink-soft);
}

.dn-kind {
    display: inline-block;
    margin-right: 0.4rem;
    padding: 0.12rem 0.5rem;
    border-radius: 0.4rem;
    background: var(--ib-paper);
    color: var(--tone-ink);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    vertical-align: 2px;
}

.dn-what {
    min-width: 0;
    overflow-wrap: anywhere;
}

.dn-what .meta {
    margin-top: 0.15rem;
    font-size: 0.82rem;
    color: var(--ib-ink-soft);
}

.dn .dn-go {
    white-space: nowrap;
}

.dn .dn-go.ui-btn.is-sm {
    min-height: 2.5rem;
    padding: 0.45rem 1.1rem;
    font-size: 0.875rem;
}

.dn-clear {
    margin: 0;
    padding: 0.9rem 1rem 0.9rem 1.2rem;
    border-radius: var(--ib-radius-sm);
    background: var(--ib-spruce-soft);
    box-shadow: inset 4px 0 0 var(--ib-spruce);
}

.dn a:not(.ui-btn),
.hw-sess a,
.hw-news a:not(.ui-card-actions) {
    color: var(--ib-ink);
    text-decoration-color: var(--ib-line);
    text-underline-offset: 3px;
}

.dn a:not(.ui-btn):hover,
.hw-sess a:hover,
.hw-news a:not(.ui-card-actions):hover {
    text-decoration-color: var(--accent);
}

/* The next session and the news. */
.hw-sess {
    display: grid;
    grid-template-columns: 3.75rem minmax(0, 1fr);
    gap: 1rem;
}

.hw-when {
    height: max-content;
    padding: 0.55rem 0 0.45rem;
    border-radius: var(--ib-radius-sm);
    background: var(--ib-spruce-soft);
    text-align: center;
}

.hw-when b {
    display: block;
    font: 500 1.7rem/1 var(--ib-mono);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: var(--ib-spruce-deep);
}

.hw-when span {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ib-spruce);
}

.hw-sess h3 {
    margin: 0 0 0.2rem;
    font: 600 1.1rem/1.3 var(--ib-display);
    letter-spacing: var(--ib-head-tracking);
}

.hw-sess .meta {
    font-size: 0.85rem;
    color: var(--ib-ink-soft);
}

.hw-sess p {
    margin: 0.6rem 0 0;
    font-size: 0.9rem;
}

.hw-sess .hw-rule {
    padding-top: 0.6rem;
    border-top: 1px solid var(--ib-line);
    font-size: 0.82rem;
    color: var(--ib-ink-soft);
}

.hw-none {
    margin: 0;
    color: var(--ib-ink-soft);
}

.hw-n {
    margin-bottom: 8px;
    padding: 0.65rem 0.85rem 0.7rem 1.05rem;
}

.hw-n:last-child {
    margin-bottom: 0;
}

.hw-n .meta {
    font-size: 0.78rem;
    color: var(--ib-ink-soft);
}

.hw-n p {
    margin: 0.2rem 0 0;
    font-size: 0.88rem;
}

.hw-pin {
    padding: 0.02rem 0.45rem;
    border-radius: 999px;
    background: var(--ib-ember-soft);
    color: var(--ib-ink);
    font-weight: 600;
}

@media (max-width: 640px) {
    .dn-row {
        grid-template-columns: 4rem minmax(0, 1fr);
        gap: 0.75rem;
    }

    .dn .dn-go {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .dn-count b {
        font-size: 1.7rem;
    }

    .rt-head b {
        font-size: 1.7rem;
    }

    .rt-span {
        width: 100%;
        margin-left: 0;
    }

    .rt-marks i:nth-child(n + 2) {
        display: none;
    }

    .rt-m.crowded {
        visibility: hidden;
    }
}

/* The tiles link down the page: the heading they land on clears the sticky top bar. */
.ui-card[id],
.ui-card-title[id] {
    scroll-margin-top: 6rem;
}

@media (prefers-reduced-motion: reduce) {
    .fh-tiles .ui-tile.is-link,
    .fh-hero .rt {
        transition: none;
    }

    .fh-tiles .ui-tile.is-link:hover {
        transform: none;
    }
}

/* ---------- Error pages (errors/layout): the door's panel with the code, plain words and a way back ---------- */

.er-brand {
    font-family: var(--ib-display);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: var(--ib-head-tracking);
}

.er-big {
    margin: 0;
    font-family: var(--ib-mono);
    font-size: clamp(3.5rem, 7vw, 5.5rem);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    color: rgb(255 255 255 / 0.85);
}

.er-box {
    max-width: 30rem;
}

.er-code span {
    margin-right: 0.35rem;
    color: var(--ib-orange-text);
}

.er-lead {
    max-width: 46ch;
    margin: 0.75rem 0 1.75rem;
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--ib-ink-soft);
    text-wrap: pretty;
}

.er-ways {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.er-foot {
    justify-content: flex-start;
}

/* ---------- Skip to content: the first stop for a keyboard, out of sight until then ---------- */

.ui-skip {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 100;
    padding: 0.65rem 1.1rem;
    border-radius: var(--ib-btn-radius);
    background: var(--ib-night);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-200%);
    transition: transform 0.2s var(--ib-ease);
}

.ui-skip:focus {
    transform: none;
}

.ui-body .ui-skip:focus-visible {
    outline: 2px solid var(--ib-spruce-bright);
    outline-offset: 2px;
}

main[tabindex="-1"]:focus {
    outline: none;
}

/* ---------- Motion: blocks fade up into view, figures fade in and count up (partials/motion) ----------
   Only transform and opacity move (plus a short blur on the way in), 200 to 500ms on the house curve,
   60ms apart. html.ib-motion is set before the first paint, and only when motion is welcome
   (partials/motion-head), so nothing here runs under reduced motion. */
@media (prefers-reduced-motion: no-preference) {
    .ib-motion [data-reveal] {
        transition: opacity 0.5s var(--ib-ease), transform 0.5s var(--ib-ease), filter 0.5s var(--ib-ease);
        transition-delay: calc(var(--i, 0) * 60ms);
    }

    .ib-motion [data-reveal]:not(.is-in) {
        opacity: 0;
        transform: translateY(8px);
        filter: blur(6px);
    }

    /* The motion script never ran: show everything after a moment rather than nothing. */
    .ib-motion-wait [data-reveal]:not(.is-in) {
        animation: ib-unhide 0.01s linear 3s forwards;
    }

    .ib-motion [data-count] {
        animation: ib-fade-in 0.3s var(--ib-ease) 0.1s both;
    }
}

@keyframes ib-unhide {
    to {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

@keyframes ib-fade-in {
    from {
        opacity: 0;
    }
}

@media print {
    [data-reveal] {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
}

/* Less motion asked for: everything settles at once, and nothing lifts or presses in (the colour
   change carries the feedback). Last in the file, so it wins over every hover above. */
@media (prefers-reduced-motion: reduce) {
    .ui-body *,
    .ui-body *::before,
    .ui-body *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .ui-btn:hover,
    .ui-btn:active,
    .ui-btn:hover .ui-arrow,
    a.lp-door:hover,
    a.lp-door:active,
    .fh-tiles .ui-tile.is-link:hover {
        transform: none;
    }

    [dir="rtl"] .ui-btn:hover .ui-arrow {
        transform: rotate(180deg);
    }
}
