/* HostFi — brand, typography and component layer on top of the Jidox theme.
   Everything visual that is ours lives here: the theme supplies the shell
   (grid, sidebar mechanics, htmx wiring), this file supplies the character. */

/* ================================================================ fonts --- */

/* IBM Plex Sans Arabic, self-hosted on purpose. The theme asks for a Latin
   face — "Figtree" — which it never ships, so Arabic was rendering in whatever
   the operator's machine happened to have. Digits and identifiers are half of
   this interface, and a font that draws Arabic and Latin from one family keeps
   them on the same baseline. Served from our own host so the captive portal
   still gets it before the client is allowed onto the internet. */
@font-face {
    font-family: "HostFi Sans";
    src: url("/static/fonts/plex-arabic/arabic-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF,
        U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
    font-family: "HostFi Sans";
    src: url("/static/fonts/plex-arabic/arabic-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF,
        U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
    font-family: "HostFi Sans";
    src: url("/static/fonts/plex-arabic/arabic-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF,
        U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
    font-family: "HostFi Sans";
    src: url("/static/fonts/plex-arabic/latin-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
        U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "HostFi Sans";
    src: url("/static/fonts/plex-arabic/latin-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
        U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "HostFi Sans";
    src: url("/static/fonts/plex-arabic/latin-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
        U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* =============================================================== tokens --- */

:root {
    /* Brand: one indigo, one teal, and the tints built from them. The gradient
       is reserved for things that are the product's own voice — the mark, the
       primary action, the page title, the current page in the sidebar — so it
       never turns into decoration. */
    --hf-brand-1: #3856c0;
    --hf-brand-1-strong: #2f49ac;
    --hf-brand-2: #22c1a6;
    --hf-gradient: linear-gradient(135deg, #3856c0 0%, #2f6fd0 45%, #22c1a6 100%);
    --hf-gradient-deep: linear-gradient(135deg, #1d2a63 0%, #2b4aa5 55%, #12857a 100%);
    --hf-brand-tint: rgba(56, 86, 192, .09);
    --hf-brand-tint-strong: rgba(56, 86, 192, .16);
    /* The brand colour as *ink* — an icon, a link, the current tab. Separate
       from the fill above because the two need opposite treatment in the dark
       theme: the fill stays, the ink has to lighten to stay legible. */
    --hf-brand-ink: var(--hf-brand-1);

    /* Neutrals, in one ramp so a surface is never picked by eye. */
    --hf-canvas: #f2f5fa;
    --hf-surface: #fff;
    --hf-surface-2: #f8fafc;
    --hf-head: #f6f8fc;
    --hf-ink: #0f172a;
    --hf-ink-2: #1e293b;
    /* Secondary copy. #64748b reads at 4.7:1 on white, which is the floor for
       text this size — the lighter #94a3b8 below is decoration only. */
    --hf-ink-3: #64748b;
    --hf-muted: #64748b;
    --hf-muted-2: #94a3b8;
    /* Table column labels sit on a tinted head, which costs them a little
       contrast: dark enough to stay readable there rather than thereabouts. */
    --hf-head-ink: #5b6b84;
    --hf-line: rgba(15, 23, 42, .08);
    --hf-line-strong: rgba(15, 23, 42, .14);
    --hf-border: rgba(15, 23, 42, .08);

    /* Feedback: a text tone dark enough to read on its own tint (4.5:1), and
       the tint + border that carry the same meaning to the eye. */
    --hf-success: #15803d;
    --hf-success-bg: rgba(22, 163, 74, .09);
    --hf-success-line: rgba(22, 163, 74, .28);
    --hf-info: #0e7490;
    --hf-info-bg: rgba(14, 116, 144, .09);
    --hf-info-line: rgba(14, 116, 144, .26);
    --hf-warning: #b45309;
    --hf-warning-bg: rgba(245, 158, 11, .13);
    --hf-warning-line: rgba(217, 119, 6, .3);
    --hf-danger: #b42318;
    --hf-danger-bg: rgba(239, 68, 68, .09);
    --hf-danger-line: rgba(220, 38, 38, .28);

    /* Geometry: one radius scale and one control height, so cards, dialogs,
       inputs and buttons line up without per-component tuning. Softer corners
       at every step: a hard 8px reads as a developer tool, 9-22px as product. */
    --hf-radius-xl: 22px;
    --hf-radius: 18px;
    --hf-radius-md: 14px;
    --hf-radius-sm: 12px;
    --hf-radius-xs: 9px;
    --hf-radius-pill: 999px;
    --hf-control-h: 2.65rem;

    /* Elevation: etched hairline plus a wide, low-opacity throw. The old set was
       tight and slightly grey; this one lets a card float without looking heavy,
       which is what keeps a dense operating screen calm. */
    --hf-shadow-sm: 0 1px 1px rgba(15, 23, 42, .03), 0 1px 3px rgba(15, 23, 42, .04);
    --hf-shadow: 0 2px 4px -2px rgba(15, 23, 42, .05), 0 16px 34px -26px rgba(15, 23, 42, .3);
    --hf-shadow-lg: 0 6px 18px -10px rgba(15, 23, 42, .14), 0 40px 84px -40px rgba(15, 23, 42, .4);
    --hf-shadow-pop: 0 18px 44px -24px rgba(15, 23, 42, .34);

    /* Type: sizes that step, weights the vendored font actually has. */
    --hf-font: "HostFi Sans", "Segoe UI", system-ui, -apple-system, "Noto Naskh Arabic", Tahoma,
        sans-serif;
    --hf-font-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
    --hf-tracking-micro: .06em;

    /* Motion: fast enough to feel like a response, slow enough to read. */
    --hf-dur-1: 140ms;
    --hf-dur-2: 220ms;
    --hf-ease: cubic-bezier(.2, .8, .2, 1);

    /* Focus: one ring everywhere, so keyboard use is visible on any surface. */
    --hf-ring: 0 0 0 3px rgba(56, 86, 192, .22);
    --hf-ring-danger: 0 0 0 3px rgba(220, 38, 38, .22);
}

[data-bs-theme="dark"] {
    --hf-canvas: #0f1626;
    --hf-surface: #172033;
    --hf-surface-2: #1b2537;
    --hf-head: #1a2438;
    --hf-ink: #e8eefb;
    --hf-ink-2: #d3ddf0;
    --hf-ink-3: #96a5bf;
    --hf-muted: #96a5bf;
    --hf-muted-2: #6f7f9b;
    --hf-head-ink: #9dadc7;
    --hf-line: rgba(148, 163, 184, .16);
    --hf-line-strong: rgba(148, 163, 184, .28);
    --hf-border: rgba(148, 163, 184, .16);
    --hf-brand-tint: rgba(96, 125, 219, .16);
    --hf-brand-tint-strong: rgba(96, 125, 219, .26);
    --hf-brand-ink: #a7bdff;

    /* Tones lighten on a dark surface: the same hex that reads on white would
       sink into the card. */
    --hf-success: #6ee7a8;
    --hf-success-bg: rgba(34, 197, 94, .14);
    --hf-success-line: rgba(34, 197, 94, .3);
    --hf-info: #7dd3fc;
    --hf-info-bg: rgba(56, 189, 248, .13);
    --hf-info-line: rgba(56, 189, 248, .28);
    --hf-warning: #fbbf24;
    --hf-warning-bg: rgba(245, 158, 11, .15);
    --hf-warning-line: rgba(245, 158, 11, .32);
    --hf-danger: #fca5a5;
    --hf-danger-bg: rgba(248, 113, 113, .14);
    --hf-danger-line: rgba(248, 113, 113, .3);

    --hf-shadow-sm: 0 1px 1px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .4);
    --hf-shadow: 0 2px 5px -2px rgba(0, 0, 0, .45), 0 22px 44px -28px rgba(0, 0, 0, .8);
    --hf-shadow-lg: 0 8px 22px -12px rgba(0, 0, 0, .55), 0 48px 96px -44px rgba(0, 0, 0, .9);
    --hf-shadow-pop: 0 22px 50px -26px rgba(0, 0, 0, .85);
    --hf-ring: 0 0 0 3px rgba(96, 125, 219, .3);
}

/* ================================================================= base --- */

body {
    background: var(--hf-canvas);
    font-family: var(--hf-font);
    color: var(--hf-ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--hf-ink);
}

/* Numbers are read in columns here (traffic, counts, timestamps). Tabular
   figures stop a column of digits from shifting as the values change. */
.hf-num, .hf-kpi-value, .pagination, .hf-table .hf-num,
.hostfi-mono, code, kbd, samp {
    font-variant-numeric: tabular-nums;
}

::selection {
    background: var(--hf-brand-tint-strong);
    color: var(--hf-ink);
}

/* One visible focus treatment for every control, including the ones the theme
   strips it from. Never removed — keyboard use has to stay legible. */
:focus-visible {
    outline: none;
    box-shadow: var(--hf-ring);
    border-radius: var(--hf-radius-xs);
}

a {
    color: var(--hf-brand-ink);
    text-decoration: none;
    transition: color var(--hf-dur-1) var(--hf-ease);
}

a:hover {
    color: var(--hf-brand-1-strong);
}

[data-bs-theme="dark"] a {
    color: #93b0ff;
}

hr {
    border-color: var(--hf-line);
    opacity: 1;
}

/* Scrollbars: thin, on-brand, and only as dark as the surface they sit on. */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--hf-line-strong) transparent;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--hf-line-strong);
    border-radius: var(--hf-radius-pill);
    border: 3px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--hf-muted-2);
    background-clip: content-box;
}

::-webkit-scrollbar-track {
    background: transparent;
}

.text-muted {
    color: var(--hf-muted) !important;
}

.fs-13 { font-size: .82rem; }
.fs-12 { font-size: .76rem; }

/* ================================================================ brand --- */

.hostfi-brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    font-weight: 700;
    letter-spacing: .2px;
    color: inherit;
    text-decoration: none;
}

.hostfi-brand .hostfi-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--hf-radius-md);
    background: var(--hf-gradient);
    color: #fff;
    font-size: 19px;
    box-shadow: 0 10px 22px -10px rgba(56, 86, 192, .8), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.hostfi-brand .hostfi-name {
    font-size: 18px;
    line-height: 1.15;
}

.hostfi-brand .hostfi-name small {
    display: block;
    font-size: 10.5px;
    font-weight: 400;
    opacity: .62;
    letter-spacing: 0;
}

.logo .hostfi-brand,
.logo-topbar .hostfi-brand {
    padding-inline-start: 10px;
}

/* The sidebar is dark by design, and the brand used to inherit the page's ink
   with it: near-black on #101a33 is a 1.2:1 contrast, so «HostFi» was rendered
   every time and read never. The name carries the brand, so it is set here
   rather than left to whatever surface it happens to land on. */
.leftside-menu .hostfi-brand {
    color: #fff;
}

.leftside-menu .hostfi-brand .hostfi-name small {
    color: rgba(255, 255, 255, .72);
    opacity: 1;
}

/* The artwork behind a sign-in page is the page's background, so it has to
   cover the window. As a percentage of the body it stopped where the content
   did, leaving a band of plain canvas under the card on a tall screen. */
.hf-auth-bg {
    min-height: 100dvh;
    /* The theme owns the colour (--hf-portal-bg, emitted by the composed page);
       the fallback keeps a page readable if a theme ever omits it. */
    background: var(--hf-portal-bg, linear-gradient(135deg, #0e2a47 0%, #00459e 100%));
    background-size: cover;
    background-position: center;
}

/* =============================================================== shell --- */

/* Sidebar: the current page is a filled pill with an indicator on the reading
   edge, section names are micro-labels, and every row is a comfortable 40px
   target. */
.leftside-menu {
    background: linear-gradient(180deg, #101a33 0%, #0d1526 100%);
    border-inline-end: 1px solid rgba(255, 255, 255, .06);
}

.leftside-menu .side-nav-title {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: var(--hf-tracking-micro);
    text-transform: uppercase;
    /* A section name is a signpost, not fine print: at .38 alpha it measured
       3.5:1 against the sidebar, under AA for text this size. */
    color: rgba(255, 255, 255, .64);
    padding-inline: 1.1rem;
    margin-bottom: .35rem;
}

.leftside-menu .side-nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-height: 40px;
    margin: 2px .6rem;
    padding: .5rem .7rem;
    border-radius: var(--hf-radius-md);
    color: rgba(233, 238, 250, .8);
    font-size: .885rem;
    transition: background-color var(--hf-dur-1) var(--hf-ease),
        color var(--hf-dur-1) var(--hf-ease), transform var(--hf-dur-1) var(--hf-ease);
}

.leftside-menu .side-nav-link i {
    font-size: 1.05rem;
    width: 1.35rem;
    text-align: center;
    color: rgba(233, 238, 250, .62);
    transition: color var(--hf-dur-1) var(--hf-ease);
}

.leftside-menu .side-nav-link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.leftside-menu .side-nav-link:hover i {
    color: #fff;
}

.leftside-menu .side-nav-link.active {
    background: var(--hf-gradient);
    color: #fff;
    box-shadow: 0 12px 26px -14px rgba(56, 86, 192, .95), inset 0 1px 0 rgba(255, 255, 255, .25);
}

.leftside-menu .side-nav-link.active i {
    color: #fff;
}

.leftside-menu .leftbar-user {
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    margin-bottom: .5rem;
    padding-bottom: 1rem !important;
}

.leftside-menu .leftbar-user .avatar-sm {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, .25);
    backdrop-filter: blur(4px);
}

/* Topbar: a thin pane of glass that keeps the page title over the rows while
   they scroll under it. */
.navbar-custom {
    background: color-mix(in srgb, var(--hf-surface) 86%, transparent);
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--hf-line);
    box-shadow: none;
}

[data-bs-theme="dark"] .navbar-custom {
    background: color-mix(in srgb, var(--hf-surface) 82%, transparent);
}

.navbar-custom .topbar {
    min-height: 62px;
}

.navbar-custom .nav-link {
    color: var(--hf-muted);
    border-radius: var(--hf-radius-sm);
    padding: .4rem;
    transition: color var(--hf-dur-1) var(--hf-ease), background-color var(--hf-dur-1) var(--hf-ease);
}

.navbar-custom .nav-link:hover {
    color: var(--hf-brand-ink);
    background: var(--hf-brand-tint);
}

.navbar-custom .button-toggle-menu {
    width: 38px;
    height: 38px;
    border-radius: var(--hf-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--hf-muted);
    transition: background-color var(--hf-dur-1) var(--hf-ease), color var(--hf-dur-1) var(--hf-ease);
}

.navbar-custom .button-toggle-menu:hover {
    background: var(--hf-brand-tint);
    color: var(--hf-brand-ink);
}

.navbar-custom .app-search .form-control {
    background: var(--hf-surface-2);
    border-color: transparent;
    min-width: 260px;
}

.navbar-custom .app-search .form-control:focus {
    background: var(--hf-surface);
    border-color: var(--hf-brand-ink);
}

.navbar-custom .account-user-avatar .avatar-sm {
    width: 36px;
    height: 36px;
    box-shadow: 0 0 0 3px var(--hf-brand-tint);
}

/* The theme's own primary colour is not the product's: anywhere the shell uses
   it as a surface (the settings drawer), it wears the brand gradient instead. */
.offcanvas-header.bg-primary,
.card-header.bg-primary {
    background: var(--hf-gradient) !important;
    color: #fff;
    border-bottom: none;
}

.offcanvas {
    background: var(--hf-surface);
    border-inline-start: 1px solid var(--hf-line);
}

.offcanvas .btn-close {
    opacity: .8;
}

.offcanvas .btn-close:hover {
    opacity: 1;
}

/* Dropdowns (topbar menus, per-row menus, page-size): one surface, one
   radius, one shadow. */
.dropdown-menu {
    border: 1px solid var(--hf-line);
    border-radius: var(--hf-radius-md);
    box-shadow: var(--hf-shadow-pop);
    padding: .35rem;
    background: var(--hf-surface);
    min-width: 11rem;
}

.dropdown-item {
    border-radius: var(--hf-radius-xs);
    padding: .5rem .65rem;
    font-size: .86rem;
    color: var(--hf-ink-2);
    display: flex;
    align-items: center;
    gap: .5rem;
    transition: background-color var(--hf-dur-1) var(--hf-ease), color var(--hf-dur-1) var(--hf-ease);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--hf-brand-tint);
    color: var(--hf-brand-ink);
}

.dropdown-item.active,
.dropdown-item:active {
    background: var(--hf-gradient);
    color: #fff;
}

.dropdown-item.text-danger,
.dropdown-item.text-danger:hover {
    color: var(--hf-danger) !important;
}

.dropdown-item.text-danger:hover {
    background: var(--hf-danger-bg);
}

.dropdown-divider {
    border-color: var(--hf-line);
    margin: .3rem .2rem;
}

.dropdown-header {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: var(--hf-tracking-micro);
    text-transform: uppercase;
    color: var(--hf-muted-2);
}

/* =============================================================== tabs ---- */

.nav-tabs.nav-bordered {
    border-bottom: 1px solid var(--hf-line);
    gap: .25rem;
}

.nav-tabs.nav-bordered .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--hf-muted);
    font-weight: 600;
    font-size: .88rem;
    padding: .6rem .9rem;
    border-radius: var(--hf-radius-xs) var(--hf-radius-xs) 0 0;
    transition: color var(--hf-dur-1) var(--hf-ease), background-color var(--hf-dur-1) var(--hf-ease);
}

.nav-tabs.nav-bordered .nav-link:hover {
    color: var(--hf-brand-ink);
    background: var(--hf-brand-tint);
}

.nav-tabs.nav-bordered .nav-link.active {
    color: var(--hf-brand-ink);
    border-bottom-color: var(--hf-brand-ink);
    background: transparent;
}

/* ========================================================== page head --- */

.hf-page-head {
    position: relative;
    /* No `overflow: hidden` here on purpose: it clipped anything that overflowed
       the head — an action's dropdown menu, for one. The two soft lights are
       painted into the element's own background instead of as pseudo-elements,
       so they still stay inside the rounded corners without the clip. */
    border-radius: var(--hf-radius);
    background:
        radial-gradient(circle 260px at calc(100% - 60px) 40px,
            rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, 0) 70%),
        radial-gradient(circle 240px at 80px 100%,
            rgba(0, 0, 0, .18) 0%, rgba(0, 0, 0, 0) 70%),
        var(--hf-gradient);
    color: #fff;
    padding: 1.4rem 1.6rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--hf-shadow);
}

.hf-page-head > div {
    position: relative;
    z-index: 1;
}

.hf-page-head h4 {
    color: #fff;
    margin: 0;
    font-weight: 700;
    font-size: 1.32rem;
    letter-spacing: -.01em;
    text-shadow: 0 1px 2px rgba(9, 16, 34, .25);
}

.hf-page-head .hf-sub {
    color: rgba(255, 255, 255, .88);
    font-size: .86rem;
    margin-top: .25rem;
    max-width: 62ch;
}

.hf-page-head .breadcrumb {
    margin: 0;
    --bs-breadcrumb-divider-color: rgba(255, 255, 255, .5);
}

.hf-page-head .breadcrumb a,
.hf-page-head .breadcrumb-item,
.hf-page-head .breadcrumb-item.active {
    color: rgba(255, 255, 255, .88);
    font-size: .8rem;
}

.hf-page-head .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, .45);
}

.hf-page-head .hf-head-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

/* Actions on the gradient are glass, not solid: the page title stays the one
   thing the eye lands on. */
.hf-page-head .btn-light {
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .3);
    color: #fff;
    backdrop-filter: blur(6px);
}

.hf-page-head .btn-light:hover,
.hf-page-head .btn-light:focus {
    background: rgba(255, 255, 255, .26);
    border-color: rgba(255, 255, 255, .45);
    color: #fff;
}

.hf-page-head .form-control {
    background: rgba(255, 255, 255, .16);
    border-color: rgba(255, 255, 255, .3);
    color: #fff;
}

.hf-page-head .form-control::placeholder {
    color: rgba(255, 255, 255, .7);
}

.hf-page-head .input-group-text {
    background: rgba(255, 255, 255, .16);
    border-color: rgba(255, 255, 255, .3);
    color: #fff;
}

/* =============================================================== cards --- */

.card {
    border: 1px solid var(--hf-line);
    border-radius: var(--hf-radius);
    box-shadow: var(--hf-shadow-sm);
    background: var(--hf-surface);
    transition: box-shadow var(--hf-dur-2) var(--hf-ease), border-color var(--hf-dur-2) var(--hf-ease);
}

.card-header {
    border-bottom: 1px solid var(--hf-line);
    background: transparent;
    padding: 1rem 1.25rem;
}

.card-footer {
    border-top: 1px solid var(--hf-line);
    background: transparent;
    padding: .85rem 1.25rem;
}

.card-title {
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -.005em;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

/* The icon a card is about sits in its own tile, the same as in a dialog
   title and a form section — one look for "this is what the block is". */
.card-title > i:first-child {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--hf-radius-xs);
    background: var(--hf-brand-tint);
    color: var(--hf-brand-ink);
    font-size: .95rem;
    flex: 0 0 auto;
}

.hf-card-hover {
    transition: transform var(--hf-dur-2) var(--hf-ease), box-shadow var(--hf-dur-2) var(--hf-ease);
}

.hf-card-hover:hover {
    transform: translateY(-3px);
    box-shadow: var(--hf-shadow);
    border-color: var(--hf-brand-tint-strong);
}

/* ================================================================= KPI --- */

.hf-kpi {
    display: flex;
    align-items: center;
    gap: .95rem;
}

.hf-kpi .hf-kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--hf-radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex: 0 0 auto;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}

.hf-kpi .hf-kpi-value {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.05;
    color: var(--hf-ink);
    letter-spacing: -.02em;
}

.hf-kpi .hf-kpi-label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--hf-muted);
    margin-top: .1rem;
}

.hf-kpi .hf-kpi-hint {
    font-size: .74rem;
    color: var(--hf-muted-2);
    margin-top: .55rem;
    padding-top: .55rem;
    border-top: 1px dashed var(--hf-line);
}

.hf-icon-primary { background: rgba(56, 86, 192, .12); color: #3856c0; }
.hf-icon-info    { background: rgba(34, 193, 166, .14); color: #0f9d86; }
.hf-icon-success { background: rgba(22, 163, 74, .13);  color: #15803d; }
.hf-icon-warning { background: rgba(245, 158, 11, .16); color: #b45309; }
.hf-icon-danger  { background: rgba(239, 68, 68, .12);  color: #b42318; }

/* On a dark surface the same tints are too close to their inks to read: the
   glyphs lighten while the tiles keep their hue. */
[data-bs-theme="dark"] .hf-icon-primary { background: rgba(96, 125, 219, .2); color: #a7bdff; }
[data-bs-theme="dark"] .hf-icon-info    { background: rgba(34, 193, 166, .18); color: #5eead4; }
[data-bs-theme="dark"] .hf-icon-success { background: rgba(34, 197, 94, .18);  color: #86efac; }
[data-bs-theme="dark"] .hf-icon-warning { background: rgba(245, 158, 11, .2);  color: #fcd34d; }
[data-bs-theme="dark"] .hf-icon-danger  { background: rgba(239, 68, 68, .18);  color: #fca5a5; }

/* ============================================================= toolbar --- */

/* The strip above a table: what the list holds on one side, what can be done
   to it on the other. */
.hf-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

.hf-toolbar-group {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.hf-search {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.hf-search i {
    position: absolute;
    inset-inline-start: .7rem;
    color: var(--hf-muted-2);
    font-size: 1rem;
    pointer-events: none;
}

.hf-search .form-control {
    padding-inline-start: 2.1rem;
    min-width: 15rem;
}

.hf-search .hf-search-clear {
    position: absolute;
    inset-inline-end: .45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: var(--hf-radius-pill);
    color: var(--hf-muted);
    transition: background-color var(--hf-dur-1) var(--hf-ease), color var(--hf-dur-1) var(--hf-ease);
}

.hf-search .hf-search-clear:hover {
    background: var(--hf-danger-bg);
    color: var(--hf-danger);
}

/* =============================================================== table --- */

.hf-table {
    margin: 0;
    --bs-table-bg: transparent;
    border-color: var(--hf-line);
}

/* The container scrolls, not the page. A table wider than the screen used to
   put its horizontal scrollbar at the bottom of the *last* row — so with forty
   rows on screen there was no way to reach the right-hand columns without
   scrolling past every one of them. Bounding the height keeps that scrollbar at
   the bottom edge of the card, in view the whole time, and the sticky header
   keeps the column names over the rows as they move. */
.hf-table-wrap {
    max-height: min(72vh, 44rem);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--hf-line-strong) transparent;
}

.hf-table > :not(caption) > * > * {
    padding: .6rem .8rem;
    font-size: .85rem;
    vertical-align: middle;
    border-bottom-color: var(--hf-line);
}

.hf-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: var(--hf-tracking-micro);
    color: var(--hf-head-ink);
    font-weight: 600;
    /* Opaque: rows scroll under this, and a translucent header shows them
       through it. The `!important` is not decoration — the vendored theme
       paints every table cell with `background-color: var(--ct-table-bg)
       !important`, which resolves to transparent, and an important declaration
       beats an ordinary one whoever wrote it. Without the force the sticky
       header had no surface at all and the rows read straight through it. */
    background-color: var(--hf-head) !important;
    box-shadow: inset 0 -1px 0 var(--hf-line);
    white-space: nowrap;
    padding-block: .7rem;
}

.hf-table tbody tr {
    transition: background-color var(--hf-dur-1) var(--hf-ease);
}

.hf-table tbody tr:hover {
    background: var(--hf-brand-tint);
}

/* A hairline down the reading edge of the hovered row: the eye finds the row
   it is on without the whole line lighting up. */
[dir="rtl"] .hf-table tbody tr:hover {
    box-shadow: inset 3px 0 0 var(--hf-brand-ink);
}

[dir="ltr"] .hf-table tbody tr:hover {
    box-shadow: inset -3px 0 0 var(--hf-brand-ink);
}

.hf-table td {
    white-space: nowrap;
    color: var(--hf-ink-2);
}

/* The row an action was just taken on, kept marked while the operator reads
   the result. */
.hf-table tbody tr.is-selected {
    background: var(--hf-brand-tint-strong);
}

/* A timestamp breaks at its own space: date above, time below. Half the width
   of «2026-09-17 08:33» and quicker to run an eye down. */
.hf-table td.hf-when {
    white-space: normal;
    width: 6.6rem;
    line-height: 1.25;
}

.hf-table td.hf-num {
    font-variant-numeric: tabular-nums;
}

/* Identifiers are long by nature (a router uuid is 36 characters before it says
   anything), and a column that wide is what pushes a table off the screen. The
   full value stays reachable in the tooltip and in the row's own details. */
.hf-table td.hf-mono .hostfi-mono,
.hf-table td.hf-mono code {
    display: inline-block;
    max-width: 9.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

.hf-table tbody tr.hf-row-link {
    cursor: pointer;
}

/* The record a report names by number. It has to be findable in a table of
   hundreds of rows without a second look, so it is marked on the leading edge
   as well as tinted — a colour alone would be invisible to some readers. The
   marker lives on the first cell rather than the row so that it can be placed
   inline-start and follow the reading direction. */
.hf-table tbody tr.hf-row-broken {
    background: var(--hf-danger-bg);
}

.hf-table tbody tr.hf-row-broken > td:first-child {
    border-inline-start: 3px solid var(--hf-danger);
}

.hf-table tbody tr.hf-row-broken .hf-seq {
    color: var(--hf-danger);
    font-weight: 600;
}

/* The network hosts, coloured by the router's own flags. As with a broken
   record, the leading edge carries the same signal for a reader who cannot see
   the tint: green for a device that signed in, then orange (bypassed, maybe not
   present), yellow (bypassed on a static/fixed IP) and red (bypassed on a
   dynamic/leased address). */
.hf-table tbody tr.hf-host-authorized {
    background: var(--hf-success-bg);
}
.hf-table tbody tr.hf-host-authorized > td:first-child {
    border-inline-start: 3px solid var(--hf-success);
}

.hf-table tbody tr.hf-host-bypassed {
    background: var(--hf-warning-bg);
}
.hf-table tbody tr.hf-host-bypassed > td:first-child {
    border-inline-start: 3px solid var(--hf-warning);
}

.hf-table tbody tr.hf-host-bypassed-static {
    background: rgba(234, 179, 8, .15);
}
.hf-table tbody tr.hf-host-bypassed-static > td:first-child {
    border-inline-start: 3px solid #ca8a04;
}

.hf-table tbody tr.hf-host-bypassed-dynamic {
    background: var(--hf-danger-bg);
}
.hf-table tbody tr.hf-host-bypassed-dynamic > td:first-child {
    border-inline-start: 3px solid var(--hf-danger);
}

/* A record number leads every row of a log: monospaced, quiet, and aligned so
   the eye can run down it. */
.hf-seq {
    color: var(--hf-muted);
    font-size: .8rem;
    letter-spacing: .01em;
}

.hf-table .cell-clip {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* A slightly denser variant for dialog tables, where the row is a detail of
   something else rather than the page itself. */
.hf-table-sm > :not(caption) > * > * {
    padding: .45rem .6rem;
    font-size: .81rem;
}

.hf-cell-actions {
    display: inline-flex;
    gap: .3rem;
    justify-content: flex-end;
}

/* A wide table on a narrower screen would otherwise put the one thing the
   operator came for — the row's own buttons — past the reading edge, so the
   actions column stays pinned while the rest of the columns scroll under it.

   The background has to be forced. The vendored theme paints every cell with
   ``background-color: var(--ct-table-bg) !important``, which resolves to
   transparent; without our own ``!important`` the pinned column has no surface,
   and the columns scrolling beneath it show *through* the buttons — the row
   reads as overlapping text rather than as a column held in place. */
.hf-table-actions thead th:last-child,
.hf-table-actions tbody td:last-child {
    position: sticky;
    inset-inline-end: 0;
    z-index: 2;
    background-color: var(--hf-surface) !important;
    /* Inline-start, not a one-sided shadow: the column is pinned to the reading
       edge, and in RTL that edge is the other side of it. */
    border-inline-start: 1px solid var(--hf-line);
}

.hf-table-actions thead th:last-child {
    /* Above the sticky header it sits inside, and opaque for the same reason. */
    z-index: 4;
    background-color: var(--hf-head) !important;
}

.hf-table-actions tbody tr:hover td:last-child {
    background-color: color-mix(in srgb, var(--hf-brand-1) 5%, var(--hf-surface)) !important;
}

.hf-table-actions tbody tr.is-selected td:last-child {
    background-color: var(--hf-brand-tint-strong) !important;
}

[data-bs-theme="dark"] .hf-table-actions tbody tr:hover td:last-child {
    background-color: color-mix(in srgb, var(--hf-brand-1) 18%, var(--hf-surface)) !important;
}

/* An open row menu is lifted above the rows below it.

   The pinned actions column is a stacking context of its own (it is sticky
   and carries a z-index), and the menu opens inside it — so the menu was
   painted *under* the cells of the next rows: its items were covered by the
   buttons of the row beneath, which made the menu unreadable and its lower
   entries unclickable. The cell that owns an open menu is raised above its
   neighbours until the menu closes, and above the sticky header too, so a
   menu that flips upward is not cut by it. */
.hf-table tbody tr td.hf-menu-open,
.hf-table thead tr th.hf-menu-open {
    z-index: 30;
}

.hf-icon-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--hf-radius-sm);
    font-size: 1rem;
    border-width: 1px;
    background: transparent;
    transition: background-color var(--hf-dur-1) var(--hf-ease),
        color var(--hf-dur-1) var(--hf-ease), transform var(--hf-dur-1) var(--hf-ease);
}

.hf-icon-btn:hover {
    transform: translateY(-1px);
}

.hf-icon-btn:active {
    transform: translateY(0);
}

/* ============================================================== pager --- */

.hf-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

.hf-pager-info {
    font-size: .8rem;
    color: var(--hf-muted);
    font-variant-numeric: tabular-nums;
}

.hf-pager-info strong {
    color: var(--hf-ink);
    font-weight: 600;
}

.pagination {
    gap: .25rem;
    margin: 0;
}

.pagination .page-link {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 .55rem;
    border: 1px solid var(--hf-line);
    border-radius: var(--hf-radius-sm);
    color: var(--hf-ink-2);
    font-size: .82rem;
    font-weight: 600;
    background: var(--hf-surface);
    margin: 0;
    transition: background-color var(--hf-dur-1) var(--hf-ease),
        color var(--hf-dur-1) var(--hf-ease), border-color var(--hf-dur-1) var(--hf-ease);
}

.pagination .page-link:hover {
    background: var(--hf-brand-tint);
    border-color: var(--hf-brand-tint-strong);
    color: var(--hf-brand-ink);
}

.pagination .page-item.active .page-link {
    background: var(--hf-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 22px -12px rgba(56, 86, 192, .95);
}

.pagination .page-item.disabled .page-link {
    background: var(--hf-surface-2);
    color: var(--hf-muted-2);
    border-color: var(--hf-line);
    opacity: .7;
}

/* The gap in a long run of pages. */
.pagination .page-item.hf-gap .page-link {
    border-color: transparent;
    background: transparent;
    color: var(--hf-muted-2);
    pointer-events: none;
}

.hf-page-size {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    color: var(--hf-muted);
}

/* ================================================ badges, chips, dots --- */

.badge {
    font-weight: 600;
    letter-spacing: .01em;
    padding: .38em .6em;
    border-radius: var(--hf-radius-xs);
    font-size: .74rem;
    vertical-align: middle;
}

.badge i {
    font-size: .95em;
}

.hf-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .32rem .7rem;
    border-radius: var(--hf-radius-pill);
    font-size: .76rem;
    font-weight: 600;
    background: var(--hf-brand-tint);
    color: var(--hf-brand-ink);
    border: 1px solid transparent;
}

.hf-chip-muted {
    background: var(--hf-surface-2);
    color: var(--hf-muted);
    border-color: var(--hf-line);
}

/* Status as a dot *and* a word: colour alone is not a message. */
.hf-status {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    font-weight: 600;
}

.hf-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: currentColor;
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
}

.hf-dot-live {
    animation: hf-pulse 2.4s var(--hf-ease) infinite;
}

@keyframes hf-pulse {
    0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent); }
    50% { box-shadow: 0 0 0 6px color-mix(in srgb, currentColor 8%, transparent); }
}

/* =============================================================== forms --- */

.form-label {
    font-weight: 600;
    font-size: .83rem;
    margin-bottom: .35rem;
    color: var(--hf-ink);
}

.form-control,
.form-select {
    min-height: var(--hf-control-h);
    border-radius: var(--hf-radius-sm);
    padding: .55rem .8rem;
    border: 1px solid var(--hf-line-strong);
    background: var(--hf-surface);
    color: var(--hf-ink);
    font-size: .88rem;
    transition: border-color var(--hf-dur-1) var(--hf-ease), box-shadow var(--hf-dur-1) var(--hf-ease),
        background-color var(--hf-dur-1) var(--hf-ease);
}

.form-control::placeholder {
    color: var(--hf-muted-2);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--hf-brand-ink);
    box-shadow: var(--hf-ring);
    background: var(--hf-surface);
    color: var(--hf-ink);
}

.form-control:disabled,
.form-select:disabled {
    background: var(--hf-surface-2);
    color: var(--hf-muted);
    opacity: .7;
    cursor: not-allowed;
}

/* Read-only is not disabled: the value is real and selectable, it just cannot
   be changed here. */
.form-control[readonly] {
    background: var(--hf-surface-2);
    border-style: dashed;
    color: var(--hf-ink-2);
    cursor: text;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--hf-danger-line);
    background-image: none;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    box-shadow: var(--hf-ring-danger);
}

.form-text {
    font-size: .76rem;
    color: var(--hf-muted);
}

.hf-field-error {
    display: flex;
    align-items: flex-start;
    gap: .35rem;
    margin-top: .35rem;
    font-size: .78rem;
    color: var(--hf-danger);
}

.input-group-text {
    background: var(--hf-surface-2);
    border-color: var(--hf-line-strong);
    color: var(--hf-muted);
    border-radius: var(--hf-radius-sm);
}

.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child) {
    border-start-end-radius: 0;
    border-end-end-radius: 0;
}

.form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    border-color: var(--hf-line-strong);
    transition: background-color var(--hf-dur-1) var(--hf-ease), border-color var(--hf-dur-1) var(--hf-ease);
}

.form-check-input:checked {
    background-color: var(--hf-brand-ink);
    border-color: var(--hf-brand-ink);
}

.form-check-input:focus {
    box-shadow: var(--hf-ring);
    border-color: var(--hf-brand-ink);
}

.form-check-label {
    font-size: .86rem;
    padding-inline-start: .2rem;
}

.form-switch .form-check-input {
    width: 2.3rem;
    height: 1.2rem;
}

.form-switch .form-check-input:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.hf-form-section {
    border: 1px solid var(--hf-line);
    border-radius: var(--hf-radius);
    padding: 1.15rem 1.25rem .35rem;
    margin-bottom: 1rem;
    background: var(--hf-surface);
}

.hf-form-section > .hf-section-title {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-weight: 600;
    font-size: .95rem;
    margin-bottom: 1rem;
    color: var(--hf-ink);
}

.hf-form-section > .hf-section-title i {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--hf-radius-xs);
    background: var(--hf-brand-tint);
    color: var(--hf-brand-ink);
    font-size: 1rem;
}

.hf-form-section .hf-section-hint {
    font-size: .78rem;
    color: var(--hf-muted);
    margin: -.6rem 0 1rem;
}

.hf-form-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    gap: .5rem;
    padding: 1rem 0 .25rem;
    background: linear-gradient(to top, var(--hf-canvas) 60%, transparent);
    z-index: 2;
}

/* ============================================================ settings --- */

/* One live setting per row: what it is on one side, the control that moves it
   and its own «حفظ» on the other. The button stays quiet until the value
   differs from what is stored, so no row ever looks like it needs pressing. */
.hf-settings-group {
    margin-bottom: 1rem;
}

.hf-settings-group .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.hf-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: .85rem 1.25rem;
    border-top: 1px solid var(--hf-line);
}

.hf-setting:first-child {
    border-top: 0;
}

.hf-setting-info {
    min-width: 0;
}

.hf-setting-label {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-weight: 600;
    font-size: .9rem;
    color: var(--hf-ink);
}

.hf-setting-help {
    flex: none;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--hf-line-strong);
    border-radius: var(--hf-radius-pill);
    background: transparent;
    color: var(--hf-muted);
    font-size: .8rem;
    line-height: 1;
    cursor: pointer;
    transition: color var(--hf-dur-1) var(--hf-ease), border-color var(--hf-dur-1) var(--hf-ease);
}

.hf-setting-help:hover,
.hf-setting-help:focus-visible {
    color: var(--hf-brand-ink);
    border-color: var(--hf-brand-ink);
    outline: none;
}

.hf-setting-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .3rem .7rem;
    margin-top: .2rem;
}

.hf-setting-key {
    font-size: .74rem;
    color: var(--hf-muted-2);
}

.hf-setting-default {
    font-size: .72rem;
    color: var(--hf-muted);
}

.hf-setting-error {
    margin-top: .35rem;
    font-size: .78rem;
    color: var(--hf-danger);
}

.hf-setting-control {
    flex: none;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.hf-setting-control .form-control,
.hf-setting-control .form-select {
    width: auto;
    min-width: 9rem;
}

.hf-setting-switch {
    min-width: 6rem;
}

.hf-setting-save {
    white-space: nowrap;
}

.hf-setting-save:disabled {
    opacity: .5;
}

.popover {
    --bs-popover-max-width: 22rem;
    font-family: var(--hf-font);
    font-size: .82rem;
}

@media (max-width: 575.98px) {
    .hf-setting {
        flex-direction: column;
        align-items: stretch;
        gap: .6rem;
    }

    .hf-setting-control {
        justify-content: space-between;
    }

    .hf-setting-control .form-control,
    .hf-setting-control .form-select {
        flex: 1;
        min-width: 0;
    }
}

/* ============================================================= buttons --- */

.btn {
    --bs-btn-padding-y: .5rem;
    --bs-btn-padding-x: .95rem;
    border-radius: var(--hf-radius-sm);
    font-weight: 600;
    font-size: .87rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    transition: transform var(--hf-dur-1) var(--hf-ease), box-shadow var(--hf-dur-1) var(--hf-ease),
        background-color var(--hf-dur-1) var(--hf-ease), color var(--hf-dur-1) var(--hf-ease),
        border-color var(--hf-dur-1) var(--hf-ease);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--hf-gradient);
    border: none;
    color: #fff;
    box-shadow: 0 12px 24px -14px rgba(56, 86, 192, .95), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: var(--hf-gradient);
    filter: brightness(1.07);
    color: #fff;
    box-shadow: 0 14px 28px -14px rgba(56, 86, 192, 1);
}

.btn-primary:disabled,
.btn-primary.disabled {
    background: var(--hf-gradient);
    filter: grayscale(.35);
    opacity: .6;
}

.btn-light {
    background: var(--hf-surface);
    border: 1px solid var(--hf-line-strong);
    color: var(--hf-ink-2);
}

.btn-light:hover,
.btn-light:focus {
    background: var(--hf-surface-2);
    border-color: var(--hf-muted-2);
    color: var(--hf-ink);
}

.btn-outline-primary,
.btn-outline-danger,
.btn-outline-warning,
.btn-outline-success,
.btn-outline-secondary {
    background: transparent;
    border-width: 1px;
}

.btn-outline-primary { color: var(--hf-brand-ink); border-color: color-mix(in srgb, var(--hf-brand-1) 35%, transparent); }
.btn-outline-primary:hover { background: var(--hf-brand-tint); color: var(--hf-brand-ink); border-color: var(--hf-brand-ink); }

.btn-outline-danger { color: var(--hf-danger); border-color: var(--hf-danger-line); }
.btn-outline-danger:hover { background: var(--hf-danger-bg); color: var(--hf-danger); border-color: var(--hf-danger); }

.btn-outline-warning { color: var(--hf-warning); border-color: var(--hf-warning-line); }
.btn-outline-warning:hover { background: var(--hf-warning-bg); color: var(--hf-warning); border-color: var(--hf-warning); }

.btn-outline-secondary { color: var(--hf-muted); border-color: var(--hf-line-strong); }
.btn-outline-secondary:hover { background: var(--hf-surface-2); color: var(--hf-ink); }

.btn-danger {
    background: linear-gradient(135deg, #d92d20 0%, #b42318 100%);
    border: none;
    color: #fff;
    box-shadow: 0 12px 24px -14px rgba(180, 35, 24, .95);
}

.btn-danger:hover,
.btn-danger:focus {
    filter: brightness(1.06);
    color: #fff;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    color: #fff;
    box-shadow: 0 12px 24px -14px rgba(217, 119, 6, .95);
}

.btn-warning:hover,
.btn-warning:focus {
    filter: brightness(1.05);
    color: #fff;
}

.btn-sm {
    --bs-btn-padding-y: .32rem;
    --bs-btn-padding-x: .65rem;
    font-size: .79rem;
    border-radius: var(--hf-radius-xs);
}

.btn-lg {
    --bs-btn-padding-y: .7rem;
    --bs-btn-padding-x: 1.2rem;
    font-size: .95rem;
}

.btn:focus-visible {
    box-shadow: var(--hf-ring);
}

/* While htmx is waiting, the button says so rather than sitting there looking
   clickable. */
.btn.htmx-request {
    pointer-events: none;
    opacity: .8;
}

.btn.htmx-request::after {
    content: "";
    width: .9em;
    height: .9em;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    animation: hf-spin .7s linear infinite;
}

@keyframes hf-spin {
    to { transform: rotate(360deg); }
}

/* =================================================== modals & dialogs --- */

.modal-backdrop.show {
    opacity: .5;
    backdrop-filter: blur(3px);
}

.modal-content {
    border: 1px solid var(--hf-line);
    border-radius: var(--hf-radius-xl);
    box-shadow: var(--hf-shadow-lg);
    background: var(--hf-surface);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--hf-line);
    padding: 1.1rem 1.35rem;
    align-items: center;
    gap: .75rem;
    background: linear-gradient(180deg, var(--hf-surface-2) 0%, var(--hf-surface) 100%);
}

.modal-title {
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}

/* An icon tile in the dialog title, so a dialog reads as a place, not a wall
   of fields. */
.modal-title > i:first-child {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--hf-radius-sm);
    background: var(--hf-brand-tint);
    color: var(--hf-brand-ink);
    font-size: 1.05rem;
    flex: 0 0 auto;
}

.modal-title .badge {
    font-size: .7rem;
}

.modal-body {
    padding: 1.35rem;
}

.modal-footer {
    border-top: 1px solid var(--hf-line);
    padding: .95rem 1.35rem;
    gap: .5rem;
    background: var(--hf-surface-2);
}

.modal .btn-close {
    width: 34px;
    height: 34px;
    border-radius: var(--hf-radius-sm);
    background-size: .8em;
    opacity: .55;
    transition: opacity var(--hf-dur-1) var(--hf-ease), background-color var(--hf-dur-1) var(--hf-ease);
}

.modal .btn-close:hover {
    opacity: 1;
    background-color: var(--hf-danger-bg);
}

/* Entrance: the dialog grows from the middle of the screen rather than
   appearing whole — enough motion to explain where it came from. */
.modal.fade .modal-dialog {
    transform: translateY(8px) scale(.98);
    transition: transform var(--hf-dur-2) var(--hf-ease), opacity var(--hf-dur-2) var(--hf-ease);
}

.modal.show .modal-dialog {
    transform: none;
}

/* A destructive dialog is tinted at the top so it cannot be mistaken for an
   ordinary form. */
.hf-modal-danger .modal-header {
    background: linear-gradient(180deg, var(--hf-danger-bg) 0%, var(--hf-surface) 100%);
    border-bottom-color: var(--hf-danger-line);
}

.hf-modal-danger .modal-title > i:first-child {
    background: var(--hf-danger-bg);
    color: var(--hf-danger);
}

.hf-modal-danger .modal-footer {
    background: var(--hf-danger-bg);
}

.hf-modal-warning .modal-header {
    background: linear-gradient(180deg, var(--hf-warning-bg) 0%, var(--hf-surface) 100%);
    border-bottom-color: var(--hf-warning-line);
}

.hf-modal-warning .modal-title > i:first-child {
    background: var(--hf-warning-bg);
    color: var(--hf-warning);
}

/* Inside a dialog the save bar is part of the flow, not sticky. */
.modal .hf-form-actions {
    position: static;
    background: none;
    padding: 0;
}

.hf-modal-errors {
    color: var(--hf-danger);
}

/* The dialog's own spinner: a swap into an open dialog should never look like
   nothing happened. */
.hf-dialog-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: 3.5rem 1rem;
    color: var(--hf-muted);
    font-size: .85rem;
}

.hf-dialog-loading .spinner-border {
    color: var(--hf-brand-ink);
}

/* Top-of-page progress for htmx requests: visible while it happens, invisible
   the rest of the time, and it never blocks the interface underneath. */
.hf-progress {
    position: fixed;
    inset-inline: 0;
    top: 0;
    height: 3px;
    z-index: 1085;
    background: transparent;
    opacity: 0;
    transition: opacity var(--hf-dur-1) var(--hf-ease);
    pointer-events: none;
}

.hf-progress.htmx-request,
.htmx-request .hf-progress {
    opacity: 1;
}

.hf-progress .hf-progress-bar {
    height: 100%;
    width: 35%;
    border-radius: var(--hf-radius-pill);
    background: var(--hf-gradient);
    animation: hf-sweep 1.1s var(--hf-ease) infinite;
}

@keyframes hf-sweep {
    0% { transform: translateX(120%); }
    100% { transform: translateX(-320%); }
}

[dir="ltr"] .hf-progress .hf-progress-bar {
    animation-direction: normal;
}

/* ================================================== alerts & messages --- */

/* One alert component for the whole system: an icon tile, a title, the body,
   optional actions, and a dismiss. Tone is carried by the icon *and* the
   words, never by colour alone. */
.hf-alert {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 1rem;
    border: 1px solid var(--hf-line);
    border-radius: var(--hf-radius-md);
    background: var(--hf-surface-2);
    color: var(--hf-ink-2);
    font-size: .87rem;
    line-height: 1.65;
}

.hf-alert .hf-alert-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--hf-radius-sm);
    font-size: 1.1rem;
    background: var(--hf-brand-tint);
    color: var(--hf-brand-ink);
}

.hf-alert .hf-alert-title {
    font-weight: 600;
    color: var(--hf-ink);
    margin-bottom: .15rem;
}

.hf-alert .hf-alert-body > :last-child {
    margin-bottom: 0;
}

.hf-alert .hf-alert-actions {
    display: flex;
    gap: .5rem;
    margin-top: .65rem;
    flex-wrap: wrap;
}

.hf-alert .hf-alert-close {
    margin-inline-start: auto;
    border: none;
    background: transparent;
    color: var(--hf-muted);
    width: 28px;
    height: 28px;
    border-radius: var(--hf-radius-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--hf-dur-1) var(--hf-ease), color var(--hf-dur-1) var(--hf-ease);
}

.hf-alert .hf-alert-close:hover {
    background: color-mix(in srgb, var(--hf-ink) 10%, transparent);
    color: var(--hf-ink);
}

.hf-alert-success {
    background: var(--hf-success-bg);
    border-color: var(--hf-success-line);
}

.hf-alert-success .hf-alert-icon { background: color-mix(in srgb, var(--hf-success) 16%, transparent); color: var(--hf-success); }

.hf-alert-info {
    background: var(--hf-info-bg);
    border-color: var(--hf-info-line);
}

.hf-alert-info .hf-alert-icon { background: color-mix(in srgb, var(--hf-info) 16%, transparent); color: var(--hf-info); }

.hf-alert-warning {
    background: var(--hf-warning-bg);
    border-color: var(--hf-warning-line);
}

.hf-alert-warning .hf-alert-icon { background: color-mix(in srgb, var(--hf-warning) 18%, transparent); color: var(--hf-warning); }

.hf-alert-danger {
    background: var(--hf-danger-bg);
    border-color: var(--hf-danger-line);
}

.hf-alert-danger .hf-alert-icon { background: color-mix(in srgb, var(--hf-danger) 16%, transparent); color: var(--hf-danger); }

.hf-alert a {
    font-weight: 600;
}

/* A spinning glyph where the message is about work in progress. */
.hf-alert .hf-alert-icon .ri-loader-4-line,
.hf-alert .hf-alert-icon .ri-refresh-line {
    animation: hf-spin 1s linear infinite;
}

/* A set of options that are cards rather than radios: each one explains itself,
   and the chosen card is unmistakable. */
.hf-choice {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .9rem 1rem;
    border: 1px solid var(--hf-line);
    border-radius: var(--hf-radius-md);
    background: var(--hf-surface);
    cursor: pointer;
    transition: border-color var(--hf-dur-1) var(--hf-ease), background-color var(--hf-dur-1) var(--hf-ease),
        box-shadow var(--hf-dur-1) var(--hf-ease);
}

.hf-choice + .hf-choice {
    margin-top: .6rem;
}

.hf-choice:hover {
    border-color: var(--hf-border);
    background: var(--hf-surface-2);
}

.hf-choice:has(input:checked) {
    border-color: var(--hf-brand-ink);
    background: var(--hf-brand-tint);
    box-shadow: var(--hf-ring);
}

.hf-choice:has(input:disabled) {
    opacity: .55;
    cursor: not-allowed;
}

.hf-choice .form-check-input {
    margin-top: .15rem;
    flex: 0 0 auto;
}

.hf-choice-title {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    color: var(--hf-ink);
}

.hf-choice-hint {
    display: block;
    font-size: .8rem;
    color: var(--hf-muted);
    line-height: 1.65;
    margin-top: .2rem;
}

/* The theme's own alert, kept for anything not yet moved over. */
.alert {
    border-radius: var(--hf-radius-md);
    border-width: 1px;
    font-size: .87rem;
}

/* Toasts: the same component, floating, one action wide, and gone on their
   own. They stack away from the reading edge so they never cover the sidebar. */
.hf-toasts {
    position: fixed;
    inset-block-end: 1rem;
    inset-inline-end: 1rem;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    max-width: min(26rem, calc(100vw - 2rem));
    pointer-events: none;
}

.hf-toast {
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .8rem 1rem .85rem;
    border: 1px solid var(--hf-line);
    border-radius: var(--hf-radius-md);
    background: var(--hf-surface);
    box-shadow: var(--hf-shadow-pop);
    animation: hf-toast-in var(--hf-dur-2) var(--hf-ease);
}

.hf-toast.is-leaving {
    animation: hf-toast-out var(--hf-dur-2) var(--hf-ease) forwards;
}

@keyframes hf-toast-in {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: none; }
}

@keyframes hf-toast-out {
    to { opacity: 0; transform: translateY(6px) scale(.98); }
}

.hf-toast .hf-toast-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--hf-radius-sm);
    font-size: 1.05rem;
    background: var(--hf-brand-tint);
    color: var(--hf-brand-ink);
}

.hf-toast-success .hf-toast-icon { background: color-mix(in srgb, var(--hf-success) 16%, transparent); color: var(--hf-success); }
.hf-toast-info .hf-toast-icon { background: color-mix(in srgb, var(--hf-info) 16%, transparent); color: var(--hf-info); }
.hf-toast-warning .hf-toast-icon { background: color-mix(in srgb, var(--hf-warning) 18%, transparent); color: var(--hf-warning); }
.hf-toast-danger .hf-toast-icon { background: color-mix(in srgb, var(--hf-danger) 16%, transparent); color: var(--hf-danger); }

.hf-toast .hf-toast-title {
    font-weight: 600;
    font-size: .87rem;
    color: var(--hf-ink);
}

.hf-toast .hf-toast-msg {
    font-size: .82rem;
    color: var(--hf-muted);
    line-height: 1.6;
}

.hf-toast .hf-toast-close {
    margin-inline-start: auto;
    border: none;
    background: transparent;
    color: var(--hf-muted-2);
    width: 26px;
    height: 26px;
    border-radius: var(--hf-radius-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hf-toast .hf-toast-close:hover {
    background: color-mix(in srgb, var(--hf-ink) 10%, transparent);
    color: var(--hf-ink);
}

/* How long is left, drawn rather than counted down in text. */
.hf-toast .hf-toast-bar {
    position: absolute;
    inset-block-end: 0;
    inset-inline-start: 0;
    height: 2px;
    width: 100%;
    background: currentColor;
    opacity: .35;
    transform-origin: var(--hf-toast-origin, right);
    animation: hf-toast-timer 4s linear forwards;
}

.hf-toast-success { color: var(--hf-success); }
.hf-toast-info { color: var(--hf-info); }
.hf-toast-warning { color: var(--hf-warning); }
.hf-toast-danger { color: var(--hf-danger); }

.hf-toast-success .hf-toast-msg,
.hf-toast-info .hf-toast-msg,
.hf-toast-warning .hf-toast-msg,
.hf-toast-danger .hf-toast-msg,
.hf-toast .hf-toast-title {
    color: var(--hf-ink);
}

.hf-toast:hover .hf-toast-bar {
    animation-play-state: paused;
}

@keyframes hf-toast-timer {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* =============================================== detail definition list --- */

.hf-def-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.hf-def-card {
    border: 1px solid var(--hf-line);
    border-radius: var(--hf-radius-md);
    padding: 1rem 1.1rem;
    background: var(--hf-surface-2);
}

.hf-def-card > .hf-section-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 600;
    font-size: .88rem;
    margin-bottom: .75rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--hf-line);
    color: var(--hf-ink);
}

.hf-def-card > .hf-section-title i {
    color: var(--hf-brand-ink);
    font-size: 1rem;
}

.hf-def-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: .35rem 0;
    border-bottom: 1px dashed var(--hf-line);
}

.hf-def-row:last-child {
    border-bottom: none;
}

.hf-def-label {
    color: var(--hf-muted);
    font-size: .8rem;
    white-space: nowrap;
}

.hf-def-value {
    font-size: .85rem;
    font-weight: 600;
    text-align: end;
    word-break: break-word;
    color: var(--hf-ink);
}

/* A SHA-256 is 64 characters with nowhere to break, so it would widen the card
   and drag the dialog's layout with it. It wraps instead of scrolling: the whole
   value has to be readable — it is what the operator compares with the record on
   either side. */
.hf-def-value .hostfi-mono {
    overflow-wrap: anywhere;
}

/* ============================================ empty state & skeletons --- */

.hf-empty {
    text-align: center;
    padding: 3.2rem 1rem;
    color: var(--hf-muted);
}

.hf-empty .hf-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto .9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: var(--hf-brand-tint);
    color: var(--hf-brand-ink);
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--hf-brand-1) 6%, transparent);
}

.hf-empty .hf-empty-title {
    font-weight: 600;
    color: var(--hf-ink);
    margin-bottom: .25rem;
}

.hf-empty .hf-empty-hint {
    font-size: .82rem;
    max-width: 46ch;
    margin: 0 auto;
}

/* The same icon in a tone that matches the news it carries. */
.hf-empty-icon.is-success {
    background: color-mix(in srgb, var(--hf-success) 14%, transparent);
    color: var(--hf-success);
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--hf-success) 7%, transparent);
}

.hf-empty-icon.is-warning {
    background: color-mix(in srgb, var(--hf-warning) 16%, transparent);
    color: var(--hf-warning);
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--hf-warning) 7%, transparent);
}

.hf-empty-icon.is-danger {
    background: color-mix(in srgb, var(--hf-danger) 14%, transparent);
    color: var(--hf-danger);
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--hf-danger) 7%, transparent);
}

/* A quota bar: quiet until it matters, and never the only thing saying so. */
.progress {
    background: var(--hf-surface-2);
    border-radius: var(--hf-radius-pill);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .06);
}

.progress-bar {
    border-radius: var(--hf-radius-pill);
    transition: width var(--hf-dur-3, 320ms) var(--hf-ease);
}

.hf-skeleton {
    position: relative;
    overflow: hidden;
    background: var(--hf-surface-2);
    border-radius: var(--hf-radius-xs);
    color: transparent;
}

.hf-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, .18), transparent);
    animation: hf-shimmer 1.4s infinite;
}

@keyframes hf-shimmer {
    100% { transform: translateX(100%); }
}

.hf-skeleton-line {
    height: .7rem;
    margin: .45rem 0;
}

/* ================================================ code, secrets, files --- */

.hf-secret-value {
    font-family: var(--hf-font-mono);
    font-size: 1rem;
    letter-spacing: .5px;
    background: var(--hf-brand-tint);
    border: 1px dashed color-mix(in srgb, var(--hf-brand-1) 45%, transparent);
    border-radius: var(--hf-radius-sm);
    padding: .9rem 1.1rem;
    word-break: break-all;
    direction: ltr;
    text-align: left;
    color: var(--hf-ink);
}

.hf-snippet,
.hf-code {
    font-family: var(--hf-font-mono);
    font-size: .78rem;
    direction: ltr;
    text-align: left;
    background: #0b1220;
    color: #dbe4f3;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: var(--hf-radius-md);
    padding: .95rem 1.1rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.hf-code {
    margin: 0;
    padding: .85rem 1rem;
    max-height: 320px;
    overflow: auto;
    font-size: 12px;
    line-height: 1.7;
    white-space: pre;
    tab-size: 4;
}

.hf-file-block + .hf-file-block {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--hf-line);
}

.hf-router-vendor + .hf-router-vendor {
    margin-top: .5rem;
}

.hf-vendor-tag {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
}

/* ========================================================== auth pages --- */

.authentication-bg .card {
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: var(--hf-shadow-lg);
    border-radius: var(--hf-radius-xl);
    overflow: hidden;
}

.authentication-bg .card-header {
    border-bottom: 1px solid var(--hf-line);
    background: linear-gradient(180deg, var(--hf-surface-2) 0%, var(--hf-surface) 100%);
}

.authentication-bg .card-body {
    padding: 1.75rem 1.75rem 1.5rem;
}

.authentication-bg h4 {
    font-weight: 700;
    letter-spacing: -.01em;
}

.authentication-bg .form-control {
    min-height: 2.9rem;
}

.authentication-bg .btn-primary {
    min-height: 2.9rem;
    font-size: .95rem;
}

/* ============================================================== portal --- */

/* The portal is read on a phone, held in one hand, often once. Everything is
   a comfortable target and nothing important sits in a corner. */
.portal-shell .card {
    border-radius: var(--hf-radius-xl);
}

.portal-device-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.portal-device {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .7rem .85rem;
    border: 1px solid var(--hf-line);
    border-radius: var(--hf-radius-md);
    background: var(--hf-surface-2);
}

.portal-device .portal-device-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--hf-radius-sm);
    background: var(--hf-brand-tint);
    color: var(--hf-brand-ink);
    font-size: 1.15rem;
}

.portal-device .portal-device-meta {
    font-size: .76rem;
    color: var(--hf-muted);
}

/* ========================================================== utilities --- */

.hostfi-mono {
    font-family: var(--hf-font-mono);
    direction: ltr;
    unicode-bidi: embed;
    font-size: .92em;
}

.hf-copy {
    cursor: pointer;
    transition: color var(--hf-dur-1) var(--hf-ease);
}

.hf-copy:hover {
    color: var(--hf-brand-ink);
}

.hf-eyebrow {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: var(--hf-tracking-micro);
    text-transform: uppercase;
    color: var(--hf-muted-2);
}

.hf-kbd {
    font-family: var(--hf-font-mono);
    font-size: .72rem;
    padding: .15rem .4rem;
    border: 1px solid var(--hf-line-strong);
    border-bottom-width: 2px;
    border-radius: var(--hf-radius-xs);
    background: var(--hf-surface-2);
    color: var(--hf-muted);
}

.hf-divider {
    height: 1px;
    background: var(--hf-line);
    margin: 1rem 0;
}

.hf-stack {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

/* ================================================= motion & pointers --- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Touch: the controls grow to a finger, and the icon buttons with them. */
@media (pointer: coarse) {
    .hf-icon-btn {
        width: 44px;
        height: 44px;
    }

    .btn {
        min-height: 44px;
    }

    .hf-table > :not(caption) > * > * {
        padding: .75rem .7rem;
    }

    .pagination .page-link {
        min-width: 44px;
        height: 44px;
    }
}

@media (max-width: 767.98px) {
    .hf-page-head {
        padding: 1.1rem 1.15rem;
    }

    .hf-page-head h4 {
        font-size: 1.12rem;
    }

    .hf-table-wrap {
        max-height: none;
    }

    .hf-toasts {
        inset-inline: .75rem;
        inset-block-end: .75rem;
        max-width: none;
    }

    .modal-body {
        padding: 1rem;
    }
}

@media print {
    .leftside-menu, .navbar-custom, .hf-page-head, .hf-toasts, .modal-backdrop {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border-color: #ccc;
    }
}

/* ============================================================ languages --- */

/* One flag box, so the switcher and any inline flag keep the same proportions. */
.hf-flag {
    inline-size: 20px;
    block-size: 14px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
    vertical-align: -.1em;
    flex: 0 0 auto;
}

.hf-lang-switch .hf-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .6rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

.hf-lang-switch .hf-lang-btn:hover,
.hf-lang-switch .hf-lang-btn:focus-visible {
    background: var(--hf-brand-tint);
}

.hf-lang-switch .hf-lang-name {
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hf-lang-switch .dropdown-menu {
    min-width: 11rem;
}

/* Guest shell: pinned to the top corner, above the gradient. */
.hf-lang-corner {
    position: fixed;
    inset-block-start: .75rem;
    inset-inline-end: .75rem;
    z-index: 1040;
}

.hf-lang-corner .hf-lang-btn {
    color: #fff;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(4px);
}

.hf-lang-corner .hf-lang-btn:hover,
.hf-lang-corner .hf-lang-btn:focus-visible {
    background: rgba(255, 255, 255, .22);
}

/* ========================================================= portal blocks --- */

/* A custom logo replaces the mark, so it keeps the mark's footprint. */
.hf-portal-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: var(--hf-radius-md);
    flex: 0 0 auto;
}

/* The brand sits on the portal's gradient (its card was removed when the page
   became composable), so it takes light ink rather than the page's default. */
.portal-shell .hostfi-brand {
    color: #fff;
}

.portal-shell .hostfi-brand .hostfi-name small {
    color: rgba(255, 255, 255, .72);
}

/* ==================================================== portal builder --- */

.hf-builder {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hf-builder-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .6rem .8rem;
    background: var(--hf-surface);
    border: 1px solid var(--hf-line);
    border-radius: var(--hf-radius);
    box-shadow: var(--hf-shadow-sm);
}

.hf-builder-pages {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
}

.hf-builder-page {
    border: 1px solid transparent;
    background: var(--hf-surface-2);
    color: var(--hf-muted);
    border-radius: var(--hf-radius-pill);
    padding: .35rem .85rem;
    font-size: .82rem;
    font-weight: 600;
    transition: background-color var(--hf-dur-1) var(--hf-ease), color var(--hf-dur-1) var(--hf-ease);
}

.hf-builder-page:hover { color: var(--hf-brand-ink); }

.hf-builder-page.is-active {
    background: var(--hf-gradient);
    color: #fff;
    box-shadow: 0 10px 22px -14px rgba(56, 86, 192, .95);
}

.hf-builder-tools {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}

.hf-builder-status {
    font-size: .76rem;
    font-weight: 600;
    padding: .25rem .65rem;
    border-radius: var(--hf-radius-pill);
    background: var(--hf-surface-2);
    color: var(--hf-muted);
}

.hf-builder-status.is-published { background: var(--hf-success-bg); color: var(--hf-success); }
.hf-builder-status.is-draft { background: var(--hf-warning-bg); color: var(--hf-warning); }
.hf-builder-status.is-dirty { background: var(--hf-danger-bg); color: var(--hf-danger); }

.hf-builder-field {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .8rem;
    color: var(--hf-muted);
}

.hf-builder-field .form-select {
    min-height: auto;
    padding-block: .25rem;
    font-size: .8rem;
}

.hf-builder-devices { display: inline-flex; gap: .25rem; }

.hf-builder-devices .btn.is-active {
    background: var(--hf-brand-tint);
    color: var(--hf-brand-ink);
    border-color: var(--hf-brand-ink);
}

.hf-builder-body {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) 340px;
    gap: 1rem;
    align-items: start;
}

@media (max-width: 1199.98px) {
    .hf-builder-body { grid-template-columns: 1fr; }
}

.hf-builder-palette,
.hf-builder-inspector {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 1200px) {
    .hf-builder-palette,
    .hf-builder-inspector { position: sticky; top: 1rem; }
}

.hf-builder-pane {
    background: var(--hf-surface);
    border: 1px solid var(--hf-line);
    border-radius: var(--hf-radius);
    padding: .9rem 1rem;
    box-shadow: var(--hf-shadow-sm);
}

.hf-builder-pane-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: .75rem;
    color: var(--hf-ink);
}

.hf-builder-pane-title i { color: var(--hf-brand-ink); }

.hf-block-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .55rem;
    border: 1px solid var(--hf-line);
    border-radius: var(--hf-radius-sm);
    background: var(--hf-surface-2);
    margin-bottom: .4rem;
    cursor: pointer;
    transition: border-color var(--hf-dur-1) var(--hf-ease), background-color var(--hf-dur-1) var(--hf-ease);
}

.hf-block-item:hover { border-color: var(--hf-border); }

.hf-block-item.is-selected {
    border-color: var(--hf-brand-ink);
    background: var(--hf-brand-tint);
}

.hf-block-item.is-drop {
    border-style: dashed;
    border-color: var(--hf-brand-ink);
}

.hf-block-handle { color: var(--hf-muted-2); cursor: grab; }

.hf-block-icon {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--hf-radius-xs);
    background: var(--hf-brand-tint);
    color: var(--hf-brand-ink);
    flex: 0 0 auto;
}

.hf-block-label { flex: 1; font-size: .83rem; font-weight: 600; }

.hf-block-actions { display: inline-flex; gap: .15rem; }

.hf-icon-btn-sm { width: 26px; height: 26px; font-size: .9rem; }

.hf-palette-group {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: var(--hf-tracking-micro);
    color: var(--hf-muted-2);
    font-weight: 600;
    margin: .6rem 0 .4rem;
}

.hf-palette-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .45rem .6rem;
    border: 1px dashed var(--hf-line-strong);
    border-radius: var(--hf-radius-sm);
    background: transparent;
    color: var(--hf-ink-2);
    font-size: .82rem;
    font-weight: 600;
    margin-bottom: .35rem;
    text-align: start;
    transition: border-color var(--hf-dur-1) var(--hf-ease), background-color var(--hf-dur-1) var(--hf-ease), color var(--hf-dur-1) var(--hf-ease);
}

.hf-palette-item:hover {
    border-color: var(--hf-brand-ink);
    background: var(--hf-brand-tint);
    color: var(--hf-brand-ink);
}

.hf-palette-tag { margin-inline-start: auto; color: var(--hf-muted-2); font-size: .85rem; }

.hf-builder-canvas { min-width: 0; }

@media (min-width: 1200px) {
    .hf-builder-canvas { position: sticky; top: 1rem; }
}

.hf-builder-frame-wrap {
    background: var(--hf-surface-2);
    border: 1px solid var(--hf-line);
    border-radius: var(--hf-radius);
    padding: 1rem;
    display: flex;
    justify-content: center;
}

.hf-builder-frame-wrap iframe {
    width: 100%;
    height: min(78vh, 900px);
    border: 1px solid var(--hf-line);
    border-radius: var(--hf-radius-md);
    background: #fff;
}

.hf-builder-frame-wrap.is-tablet iframe { width: 820px; max-width: 100%; }
.hf-builder-frame-wrap.is-phone iframe { width: 420px; max-width: 100%; height: min(78vh, 760px); }

.hf-builder-empty { color: var(--hf-muted); font-size: .82rem; margin: .2rem 0; }

.hf-builder-hint {
    color: var(--hf-muted);
    font-size: .76rem;
    line-height: 1.7;
    margin-top: .4rem;
}

.hf-builder-field-row { margin-bottom: .6rem; }

.hf-color-row { display: flex; gap: .4rem; align-items: center; }

.hf-color-row input[type="color"] {
    width: 38px;
    height: 34px;
    padding: 2px;
    border: 1px solid var(--hf-line-strong);
    border-radius: var(--hf-radius-xs);
    background: var(--hf-surface);
    flex: 0 0 auto;
}

/* Country picker (OTP providers): a searchable flag list feeding a chip row. */
.hf-country-picker {
    border: 1px solid var(--hf-line-strong);
    border-radius: var(--hf-radius-xs);
    background: var(--hf-surface);
    overflow: hidden;
}

.hf-cp-chosen {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    padding: .55rem .6rem;
    min-height: 46px;
    border-bottom: 1px solid var(--hf-line);
}

.hf-cp-empty {
    color: var(--hf-muted);
    font-size: .82rem;
    align-self: center;
}

.hf-cp-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .3rem .2rem .55rem;
    border-radius: 999px;
    background: var(--hf-brand-tint);
    color: var(--hf-brand-ink);
    font-size: .82rem;
    line-height: 1.6;
}

.hf-cp-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.hf-cp-remove:hover { background: rgba(0, 0, 0, .08); }

.hf-cp-search {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .6rem;
    border-bottom: 1px solid var(--hf-line);
}

.hf-cp-search > i { color: var(--hf-muted); }
.hf-cp-search .form-control { border: 0; box-shadow: none; padding-inline: 0; }

.hf-cp-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: .15rem;
    max-height: 230px;
    overflow-y: auto;
    padding: .35rem;
}

.hf-cp-option {
    display: flex;
    align-items: center;
    gap: .45rem;
    width: 100%;
    padding: .35rem .5rem;
    border: 1px solid transparent;
    border-radius: var(--hf-radius-xs);
    background: transparent;
    text-align: start;
    color: inherit;
    cursor: pointer;
}

.hf-cp-option:hover {
    border-color: var(--hf-line-strong);
    background: rgba(0, 0, 0, .03);
}

.hf-cp-flag { font-size: 1.05rem; line-height: 1; }
.hf-cp-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hf-cp-code { color: var(--hf-muted); font-size: .78rem; }
.hf-cp-none { grid-column: 1 / -1; margin: .5rem; color: var(--hf-muted); text-align: center; }

/* One selectable row per edge server: the tick is what binds it, and the button
   in the same row opens that edge's own install script. The field is the list. */
.hf-edge-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.hf-edge-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .55rem .7rem;
    border: 1px solid var(--hf-line, rgba(0, 0, 0, .12));
    border-radius: var(--hf-radius-xs, .35rem);
}

.hf-edge-row.hf-edge-bound {
    border-color: var(--hf-line-strong, rgba(0, 0, 0, .28));
    background: rgba(0, 0, 0, .015);
}

.hf-edge-check {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    flex: 1 1 12rem;
    cursor: pointer;
}

.hf-edge-check .form-check-input {
    margin: 0;
}

.hf-edge-name {
    font-weight: 600;
}

.hf-edge-meta {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    color: var(--hf-muted, #6b7a90);
    font-size: .8rem;
}

.hf-edge-script {
    margin-inline-start: auto;
}

/* A table wider than its container scrolls sideways, and the reader has to be able
   to tell that it does: the scrollbar keeps its natural thickness here, and the
   action column is pinned to the near edge so its button never scrolls away. */
.hf-table-scroll {
    scrollbar-width: auto;
}

.hf-table-scroll::-webkit-scrollbar {
    height: .65rem;
}

.hf-table-scroll::-webkit-scrollbar-thumb {
    background: var(--hf-line-strong);
    border-radius: 999px;
}

.hf-table-action {
    position: sticky;
    inset-inline-start: 0;
    z-index: 2;
    white-space: nowrap;
    /* Opaque, and forced for the same reason as the header: the vendored
       theme paints every cell transparent (`!important`), so without a
       surface of its own the columns scrolling under the pinned one show
       straight through it. */
    background-color: var(--hf-surface) !important;
}

.hf-table-scroll thead .hf-table-action {
    background-color: var(--hf-head) !important;
}

/* The supported-country list: long, so it reads in columns and scrolls itself. */
.hf-country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: .25rem .75rem;
    max-height: 30rem;
    overflow-y: auto;
}

.hf-country-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    padding: .15rem .3rem;
}

.hf-country-row .form-check-input { margin: 0; }
.hf-country-name { flex: 1 1 auto; }

/* ====================================================== comfort pass === */
/* Refinements that keep a dense operator screen quiet: readable secondary
   copy, a softer card surface, a calmer page header and a roomier rhythm.
   Kept as one block so the intent is visible in one place. */

/* Secondary copy that is text, not decoration. --hf-muted-2 stays for
   hairlines, handles and glyphs where 2.6:1 is invisible anyway. */
.hf-kpi .hf-kpi-hint,
.hf-eyebrow,
.hf-setting-key,
.hf-palette-group,
.dropdown-header,
.form-text,
.text-muted {
    color: var(--hf-ink-3) !important;
}

.form-control::placeholder {
    color: var(--hf-ink-3);
    opacity: .75;
}

/* A card is a pane of glass over the canvas: a hairline top highlight reads as
   light, and the lift is reserved for the pointer, never applied at rest. */
.card {
    border-radius: var(--hf-radius);
    box-shadow: var(--hf-shadow-sm);
}

.card > .card-header:first-child {
    border-start-start-radius: var(--hf-radius);
    border-start-end-radius: var(--hf-radius);
}

.card-body {
    padding: 1.25rem 1.35rem;
}

/* The page header already carries the brand. Give it depth rather than a flat
   fill, and keep the title the one thing with the strongest weight on screen. */
.hf-page-head {
    padding: 1.55rem 1.7rem;
    box-shadow: var(--hf-shadow), inset 0 1px 0 rgba(255, 255, 255, .16);
}

.hf-page-head .hf-sub {
    margin-top: .35rem;
    line-height: 1.7;
}

/* KPI cards: the figure is the hero, the label is the caption. */
.hf-kpi .hf-kpi-value {
    font-size: 1.85rem;
    letter-spacing: -.03em;
}

.hf-kpi .hf-kpi-label {
    letter-spacing: .005em;
}

.hf-kpi .hf-kpi-hint {
    margin-top: .7rem;
    padding-top: .7rem;
}

/* Rows breathe a little more; the eye tracks a column of nine rows better than
   a column of fourteen. */
.hf-table > :not(caption) > * > * {
    padding: .72rem .85rem;
}

.hf-table tbody tr {
    transition: background-color var(--hf-dur-1) var(--hf-ease),
        box-shadow var(--hf-dur-1) var(--hf-ease);
}

/* Sections in a form read as one document, not a pile of boxes. */
.hf-form-section {
    border-radius: var(--hf-radius);
    padding: 1.3rem 1.4rem .5rem;
}

/* ============================================ keyboard & controls ---- */
/* Controls the shell used to render as divs are real buttons now. These rules
   keep their original look so nothing moves, and make the focus and press
   states visible on the surface they sit on. */

.input-group-text[data-password] {
    cursor: pointer;
    border-start-start-radius: 0;
    border-end-start-radius: 0;
    transition: color var(--hf-dur-1) var(--hf-ease), background-color var(--hf-dur-1) var(--hf-ease);
}

.input-group-text[data-password]:hover {
    color: var(--hf-brand-ink);
    background: var(--hf-brand-tint);
}

.input-group-text[data-password]:focus-visible {
    outline: none;
    box-shadow: var(--hf-ring);
    border-radius: var(--hf-radius-xs);
}

/* The shell's disclosure buttons: same footprint as the icon they replace. */
.button-toggle-menu,
.button-sm-hover,
.button-close-fullsidebar,
#light-dark-mode {
    border: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    cursor: pointer;
    line-height: 1;
}

.button-toggle-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--hf-radius-sm);
    color: var(--hf-muted);
    transition: background-color var(--hf-dur-1) var(--hf-ease), color var(--hf-dur-1) var(--hf-ease);
}

.button-toggle-menu:hover {
    background: var(--hf-brand-tint);
    color: var(--hf-brand-ink);
}

.button-toggle-menu:focus-visible,
.button-sm-hover:focus-visible,
.button-close-fullsidebar:focus-visible,
#light-dark-mode:focus-visible {
    outline: none;
    box-shadow: var(--hf-ring);
    border-radius: var(--hf-radius-xs);
}

/* Skip link: hidden until focused, then a real target in the top corner. */
.hf-skip-link {
    position: fixed;
    inset-block-start: .5rem;
    inset-inline-start: .5rem;
    z-index: 1100;
    transform: translateY(-160%);
    transition: transform var(--hf-dur-1) var(--hf-ease);
    padding: .6rem 1rem;
    border-radius: var(--hf-radius-sm);
    background: var(--hf-surface);
    color: var(--hf-ink);
    font-weight: 600;
    font-size: .86rem;
    box-shadow: var(--hf-shadow-lg);
    border: 1px solid var(--hf-line-strong);
}

.hf-skip-link:focus-visible {
    transform: translateY(0);
    outline: none;
    box-shadow: var(--hf-shadow-lg), var(--hf-ring);
}

/* ===================================================== auth surface ---- */
/* The sign-in page uses the theme's own photograph, softened by a brand scrim
   so the card stays the only thing asking to be read. */
.hf-auth-photo {
    min-height: 100dvh;
    background-color: #0b1b33;
    background-image:
        linear-gradient(135deg, rgba(12, 26, 52, .92) 0%, rgba(16, 46, 92, .82) 48%, rgba(12, 74, 70, .86) 100%),
        url("/static/images/bg-auth.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hf-auth-photo .footer-alt,
.hf-auth-photo .footer-alt a {
    color: rgba(255, 255, 255, .62);
}

/* ============================================= small screens ---------- */
/* Below 16px iOS zooms the viewport on focus and never zooms back out. */
@media (max-width: 640px) {
    .form-control,
    .form-select {
        font-size: 1rem;
    }

    .hf-page-head {
        padding: 1.15rem 1.2rem;
    }

    .card-body {
        padding: 1rem;
    }
}

/* The page title is the document's h1 now: same look, correct outline. */
.hf-page-head h1 {
    color: #fff;
    margin: 0;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -.015em;
    text-shadow: 0 1px 2px rgba(9, 16, 34, .25);
}

@media (max-width: 767.98px) {
    .hf-page-head h1 {
        font-size: 1.18rem;
    }
}

/* The sign-in card sits on a photograph, so it reads as a pane of glass rather
   than a white box pasted over an image. */
.hf-auth-photo .card {
    background: color-mix(in srgb, var(--hf-surface) 94%, transparent);
    backdrop-filter: saturate(140%) blur(14px);
    border-color: rgba(255, 255, 255, .22);
    box-shadow: var(--hf-shadow-lg);
}

.hf-auth-photo .card-header {
    background: transparent;
    border-bottom-color: rgba(255, 255, 255, .12);
}

.hf-auth-photo .card-body {
    background: transparent;
}

/* ================================================== builder workspace === */
/* The builder is where a template is made, so it gets the most care: a work
   surface that stays put while the panes scroll, a canvas that reads as a
   surface rather than a hole in the page, and selected states that say which
   block is being edited without a second glance. */

.hf-builder-body {
    gap: 1.15rem;
}

/* The bar holds the page tabs and the preview controls. Keeping it in view is
   what makes the workspace feel like one piece instead of a long form. */
.hf-builder-bar {
    position: sticky;
    top: .75rem;
    z-index: 20;
    padding: .7rem .9rem;
    background: color-mix(in srgb, var(--hf-surface) 88%, transparent);
    backdrop-filter: saturate(150%) blur(12px);
    border-color: var(--hf-line);
    box-shadow: var(--hf-shadow);
}

.hf-builder-page {
    padding: .42rem 1rem;
    font-size: .84rem;
    letter-spacing: -.005em;
}

.hf-builder-page:not(.is-active):hover {
    background: var(--hf-brand-tint);
}

.hf-builder-pane {
    padding: 1.05rem 1.1rem 1.15rem;
    border-radius: var(--hf-radius);
    box-shadow: var(--hf-shadow-sm);
}

/* A pane title is a section of one tool, not a card heading: a hairline under
   it groups what follows without drawing another box. */
.hf-builder-pane-title {
    padding-bottom: .7rem;
    margin-bottom: .85rem;
    border-bottom: 1px solid var(--hf-line);
    font-size: .88rem;
    letter-spacing: -.005em;
}

.hf-builder-pane-title i {
    font-size: 1.05rem;
}

/* The canvas is a table the preview sits on. A dot grid gives it depth without
   competing with the page being designed. */
.hf-builder-canvas {
    background-color: var(--hf-surface-2);
    background-image: radial-gradient(var(--hf-line-strong) 1px, transparent 1px);
    background-size: 16px 16px;
    background-position: -1px -1px;
    border: 1px solid var(--hf-line);
    border-radius: var(--hf-radius);
    padding: 1.15rem;
}

.hf-builder-frame-wrap {
    background: var(--hf-surface);
    border: 1px solid var(--hf-line);
    border-radius: var(--hf-radius-md);
    box-shadow: var(--hf-shadow-lg);
    padding: .75rem;
    transition: max-width var(--hf-dur-2) var(--hf-ease);
}

.hf-builder-frame-wrap iframe {
    border: 0;
    border-radius: var(--hf-radius-sm);
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--hf-line);
}

/* Selected block: a brand rail on the leading edge plus the tint, so the eye
   finds it while scanning the list. */
.hf-block-item {
    position: relative;
    padding: .5rem .6rem;
    background: var(--hf-surface);
}

.hf-block-item:hover {
    border-color: var(--hf-line-strong);
    box-shadow: var(--hf-shadow-sm);
}

.hf-block-item.is-selected {
    background: var(--hf-brand-tint);
    box-shadow: inset 0 0 0 1px var(--hf-brand-ink);
}

.hf-block-item.is-selected::before {
    content: "";
    position: absolute;
    inset-block: .45rem;
    inset-inline-start: -.02rem;
    width: 3px;
    border-radius: 3px;
    background: var(--hf-gradient);
}

.hf-block-icon {
    width: 28px;
    height: 28px;
    font-size: .95rem;
}

.hf-block-label {
    font-size: .84rem;
}

.hf-palette-item {
    padding: .52rem .65rem;
    border-color: var(--hf-line-strong);
    background: var(--hf-surface);
}

.hf-palette-item:hover {
    border-style: solid;
    box-shadow: var(--hf-shadow-sm);
}

.hf-palette-item:active {
    transform: translateY(1px);
}

.hf-builder-field-row {
    margin-bottom: .8rem;
}

.hf-builder-field-row > label {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    color: var(--hf-ink-3);
    margin-bottom: .3rem;
}

.hf-color-row input[type="color"] {
    width: 42px;
    height: 38px;
    border-radius: var(--hf-radius-xs);
    cursor: pointer;
}

@media (max-width: 1199.98px) {
    .hf-builder-bar {
        position: static;
        backdrop-filter: none;
        background: var(--hf-surface);
    }
}
