/* ── Design tokens ────────────────────────────────────────────────────────
   Scoped to widget-canvas; deliberately NOT added to the global theme.scss,
   which is fragile/entangled with unrelated experiments (drawflow editor,
   claymorphism demo, etc). Radius/shadow modeled on .ff-card's existing
   clamp(16px,3.5vw,24px) radius and card-theme.css's .dsc-backdrop
   translucent-wash pattern — both already-sanctioned "premium but
   restrained" precedents elsewhere in this codebase.
   ─────────────────────────────────────────────────────────────────────── */
.wc-canvas {
    --wc-radius: clamp(16px, 2vw, 24px);
    --wc-radius-sm: clamp(12px, 1.5vw, 16px);
    --wc-shadow-soft: 0 4px 16px rgba(0,0,0,.06);
    --wc-shadow-hover: 0 8px 28px rgba(0,0,0,.052);
    /* Plain neutral tint - used where a per-category accent doesn't belong: a composite
       widget's own chrome (composite-widget.html) and each of its child cards
       (dashboard.html's .fnc-item), both nested inside an already-.wc-theme-*-accented
       parent tile. The tile itself (.wc-tile-inner / .wc-flat-tile below) uses the
       accent wash instead - see .wc-theme-* further down. */
    --wc-tile-tint: color-mix(in srgb, var(--bs-body-color) 3%, transparent);
    --wc-tile-tint-hover: color-mix(in srgb, var(--bs-body-color) 5%, transparent);
}

body.no-select, body.no-select * {
    user-select: none;
}

/* ── Toolbar — subtle translucent shade, not bare buttons on the canvas ──
   No backdrop-filter here (unlike .wc-conn-popup/.wc-drag-handle) - this bar
   hosts real .dropdown-menu elements (layout presets, widget select) and a
   filtered ancestor traps their z-index inside its own stacking context,
   rendering the menu behind the canvas instead of above it. No padding/
   margin either - the parent's height is hardcoded as
   (wc.pageWindow.height - 60) in widget-canvas.html, budgeted for this bar
   at its original near-zero box height; growing it here just overflows that
   budget instead of the canvas actually resizing to fit.
   --wc-tile-tint is scoped to .wc-canvas, and this bar sits *outside* that
   element (a preceding sibling, not a descendant) - it never actually
   inherited that variable and was silently falling back to a bare 3%
   color-mix, too faint to read against the plain page background behind it
   (3% only reads on .wc-canvas's own dotted-grid backdrop). --glass-bg is a
   global token (not scoped to .wc-canvas) already tuned to be visible without
   blur - same one .wc-conn-popup/.wc-drag-handle use, just without the
   backdrop-filter that broke the dropdowns above. */
/* ── Toolbar dock ───────────────────────────────────────────────────────────
   In flow and always occupying its space, identically in both modes. Earlier
   cuts made it float in view mode (zero-height sticky wrapper) and dock only
   in creator mode: that removed the blank band left by the auto-hide, but it
   put a bar over the tiles, and a bar over a tile intercepts the pointer —
   you could not drag a widget that had scrolled under it. Docking everywhere
   solves BOTH without the auto-hide: the space is never blank because the bar
   never hides, and it never overlaps a tile because it was never over one.

   Still sticky, so it stays reachable if the outer container ever scrolls. In
   practice it rarely does — each view's canvas (#wcCanvas / .wc-flat) is its
   own scroller with its own height — which is also why the bar needs no
   surface of its own: tiles scroll inside their box, below this one, not
   underneath it.

   z-index deliberately: it creates a stacking context, and the .dropdown-menu
   elements this bar hosts live inside it. Sitting above .wc-canvas is exactly
   what keeps those menus painting over the tiles rather than behind them (see
   the .wc-toolbar note above for what a *filtered* ancestor does instead).

   display:flow-root so .wc-toolbar's own margin can't collapse out of the dock
   and drag it down the page. */
.wc-toolbar-dock {
    position: sticky;
    top: 0;
    display: flow-root;
    z-index: 20;
}

.wc-toolbar {
    border-radius: var(--wc-radius-sm, 12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    margin: .5rem;
}

.wc-toolbar__primary,
.wc-toolbar__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

/* The creator-mode controls (Layout / Add / Save widget, plus the inline save
   form) are their own flex row nested inside .wc-toolbar__actions, so they lay
   out horizontally like the rest of the bar. Wrapping is left on: this group
   grows by two text inputs the moment Save widget is expanded, and on a narrow
   canvas that has to be able to break. */
.wc-toolbar__creator {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

/* ── Borderless bar ─────────────────────────────────────────────────────────
   Every button here is .ff-btn--borderless, which drops the resting outline —
   but the base .ff-btn:hover and .ff-btn.active rules (app-form-fields.css)
   put a border back on interaction, and neither is overridden by the variant
   itself. Clearing them here keeps the bar outline-free in every state; the
   variant's own soft fill (--ff-surface-alt on hover, an accent tint when
   active) carries the feedback instead. --outline is excluded: the save CTA in
   the expanded Save-widget form is meant to keep a visible edge.

   ⚠️ This exclusion must name whatever variant that CTA actually uses.
   It read ":not(.ff-btn--solid)" while the CTA was solid; when the app moved
   off solid the button would have fallen INTO this rule and lost its border
   in exactly the states that give it feedback. */
.wc-toolbar .ff-btn:not(.ff-btn--outline):hover,
.wc-toolbar .ff-btn:not(.ff-btn--outline):focus,
.wc-toolbar .ff-btn:not(.ff-btn--outline).active,
.wc-toolbar .ff-btn:not(.ff-btn--outline)[aria-pressed="true"],
.wc-toolbar .ff-btn:not(.ff-btn--outline).show {
    border-color: transparent;
}

/* ── Desktop: one row, always ───────────────────────────────────────────────
   Both groups were free to wrap, and the container wrapped too, so as soon as
   the actions group ran out of room it dropped to a second line. Pinning the
   row and letting the PRIMARY group shrink (min-width:0 enables truncation of
   the widget-name label inside it) keeps the actions on the same line, which is
   what makes it read as an app bar rather than a stack of buttons. */
@media (min-width: 768px) {
    .wc-toolbar {
        flex-wrap: nowrap;
    }

    .wc-toolbar__primary {
        flex: 0 1 auto;
        min-width: 0;
        flex-wrap: nowrap;
    }

    .wc-toolbar__actions {
        flex: 0 0 auto;
        margin-left: auto;
        flex-wrap: nowrap;
    }

    /* The inline save-options form is the other wrap driver — two text inputs at
       their natural width push the row over on any normal screen. */
    .wc-toolbar__actions .ff-input {
        max-width: 160px;
    }
}

@media (max-width: 767.98px) {
    .wc-toolbar__primary,
    .wc-toolbar__actions {
        width: 100%;
    }
}

/* ── Toolbar dropdowns ──────────────────────────────────────────────────────
   Bootstrap's .dropdown-menu grows with its content, so the widget picker ran
   to whatever height the widget count demanded - off the bottom of the viewport
   on desktop, and unusable on mobile where it also has nowhere to go sideways.
   Capping it against the VIEWPORT (not a fixed px) keeps it inside the window at
   any size, and the list scrolls instead of the page.
   No background is set here: the theme owns that. */
.wc-toolbar .dropdown-menu {
    min-width: 260px;
    max-width: min(92vw, 380px);
    border-radius: var(--wc-radius-sm, 12px);
    border: 1px solid var(--app-border, rgba(0,0,0,.12));
    padding: .25rem;
}

/* The scroll region excludes the sticky filter below, so the search box stays
   put while the list moves under it. */
.wc-toolbar .wc-menu-scroll {
    max-height: min(52vh, 360px);
    overflow-y: auto;
    overscroll-behavior: contain; /* don't chain to the canvas behind it */
}

.wc-toolbar .wc-menu-filter {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: .25rem .25rem .5rem;
    border-bottom: 1px solid var(--app-border, rgba(0,0,0,.12));
    margin-bottom: .25rem;
}

.wc-toolbar .dropdown-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: var(--text-sm);
    border-radius: var(--wc-radius-sm, 12px);
    white-space: normal;      /* long widget names wrap rather than overflow */
    word-break: break-word;
}

/* Selected row: a leading check, no fill — keeps the corporate flat look and
   stays legible in both themes without hard-coding a colour. */
.wc-toolbar .dropdown-item .wc-menu-check {
    flex: 0 0 1rem;
    opacity: 0;
}

.wc-toolbar .dropdown-item.is-selected .wc-menu-check {
    opacity: 1;
}

.wc-toolbar .wc-menu-empty {
    padding: .5rem .75rem;
    font-size: var(--text-sm);
    opacity: .7;
}

/* A long widget name previously stretched the toggle and pushed the whole
   actions group onto a second row. Truncate in the button; the full name stays
   available via title= and is never truncated inside the menu itself. */
.wc-toolbar .wc-widget-toggle {
    max-width: 220px;
}

.wc-toolbar .wc-widget-toggle__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .wc-toolbar .wc-widget-toggle {
        max-width: 100%;
    }
}

/* Full-bleed sheet on phones: a 260px menu anchored to a button that may sit at
   the right edge would otherwise hang off-screen. */
@media (max-width: 767.98px) {
    .wc-toolbar .dropdown-menu {
        min-width: 0;
        max-width: none;
        width: calc(100vw - 1rem);
    }

    .wc-toolbar .wc-menu-scroll {
        max-height: 60vh;
    }
}

/* ── Manual connection popup (widget-connections.directive.js) ──────────────
   The directive's root element is pointer-events:none so the SVG never blocks
   tile clicks/drags underneath it; pointer-events is inheritable, so the popup
   itself must explicitly opt back in or its buttons/inputs would be inert. */
.wc-conn-popup {
    position: absolute;
    pointer-events: auto;
    z-index: 5;
    width: 220px;
    padding: 10px;
    border-radius: var(--wc-radius-sm);
    border: 1px solid var(--app-border, rgba(0,0,0,.12));
    background: color-mix(in srgb, var(--bs-body-bg, #fff) 92%, transparent);
    box-shadow: var(--wc-shadow-hover);
    backdrop-filter: blur(var(--glass-blur, 12px));
}

.wc-conn-handle {
    transition: r 0.12s ease, fill 0.12s ease;
}

    .wc-conn-handle:hover {
        fill: #6366f1;
    }

/* ── Widget Canvas Grid Background ───────────────────────────────────── */
.wc-canvas {
    background-color: transparent;
    /*background-image: radial-gradient(circle, var(--bs-border-color) 1px, transparent 1px);
    background-size: 24px 24px;*/
}

.cursor-hand {
    cursor: pointer;
}

.widget-header .text-truncate {
    display: inline-block;
}

/* Only disable selection while actively dragging/resizing */
.resize-drag.is-interacting,
.resize-drag.is-interacting * {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.js-drag-handle {
    cursor: grab;
    transition: box-shadow .2s ease, background-color .2s ease, transform .15s ease;
}

/* Keep tile chrome mounted so revealing it never changes the tile's layout.
   Mouse users reveal it by entering the tile; keyboard/touch interaction can
   reveal it through focus-within. Active drag/resize state keeps it visible
   even if the pointer temporarily leaves the tile. */
.wc-drag-handle {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .15s ease, visibility 0s linear .15s,
        box-shadow .2s ease, background-color .2s ease, transform .15s ease;
}

.wc-tile:hover .wc-drag-handle,
.wc-tile:focus-within .wc-drag-handle,
.wc-tile.is-interacting .wc-drag-handle,
.wc-drag-handle.is-active,
.wc-drag-handle.is-dragging {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

    .js-drag-handle.is-dragging {
        cursor: grabbing;
        background-color: rgba(13,110,253,.12);
        box-shadow: 0 8px 24px rgba(0,0,0,.25), 0 0 0 2px rgba(13,110,253,.35);
        transform: scale(1.01);
        animation: dragPulse 0.6s ease-in-out infinite;
    }

@keyframes dragPulse {
    0% {
        box-shadow: 0 8px 24px rgba(0,0,0,.25);
    }

    50% {
        box-shadow: 0 12px 30px rgba(0,0,0,.35);
    }

    100% {
        box-shadow: 0 8px 24px rgba(0,0,0,.25);
    }
}

/*
 * Fix GridStack resize handles overlapping tile content.
 *
 * GridStack appends .ui-resizable-handle elements as direct children of
 * .grid-stack-item. They are absolutely positioned relative to that item,
 * so they sit on top of .grid-stack-item-content.
 *
 * The solution:
 *   1. Give .grid-stack-item a small inset on the edges where handles live.
 *   2. The content div fills the remaining space normally — no padding needed.
 *   3. The handles sit in the reserved gutter, never on top of content.
 *
 * Handle positions used:  se, sw, ne, nw, e, w, n, s
 * Gutter size: 8px  (matches typical ui-resizable handle size)
 */

/* ── Reserve gutter inside the grid item for handles ─────────────────── */
.grid-stack-item {
    box-sizing: border-box;
    /* ⚠️ Explicit, not merely absent. GridStack ships its own stylesheet and
       the site theme styles a lot of block elements; saying `none` here means
       neither can put a line around a tile from underneath us. */
    border: none;
}

.grid-stack-item-content {
    border: none;
}

    /* The content wrapper must not cover the handle gutter.
   We achieve this by giving grid-stack-item a padding that equals
   the handle thickness, then letting the content fill what remains.   */
    .grid-stack-item > .grid-stack-item-content {
        /* Reset any inline padding added by accident */
        padding: 0 !important;
        position: absolute;
        top: 8px;
        left: 8px;
        right: 8px;
        bottom: 8px;
        overflow: hidden; /* content clips to the inset box     */
        display: flex;
        flex-direction: column;
    }

    /* ── Make sure handles render above content, in the gutter ───────────── */
    .grid-stack-item > .ui-resizable-handle {
        z-index: 10;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .15s ease, visibility 0s linear .15s;
    }

    .grid-stack-item:hover > .ui-resizable-handle,
    .grid-stack-item:focus-within > .ui-resizable-handle,
    .grid-stack-item.is-interacting > .ui-resizable-handle,
    .grid-stack-item.ui-resizable-resizing > .ui-resizable-handle {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition-delay: 0s;
    }

    /* ── Visual affordance: subtle resize gripper on SE corner ───────────── */
    .grid-stack-item > .ui-resizable-se {
        width: 16px;
        height: 16px;
        right: 0;
        bottom: 0;
        cursor: se-resize;
        /* Diagonal lines gripper — pure CSS, no image needed */
        background-image: none;
        background: transparent;
    }

    .grid-stack-item:hover > .ui-resizable-se::after {
        border-color: rgba(0, 0, 0, 0.45);
    }

/* ── Tile accent themes ───────────────────────────────────────────────────
   Same palette as the datasource catalogue's ds-card system (see
   CardThemeService's THEMES registry / card-theme.css's .dsc-backdrop) -
   applied via wc.tileThemeClass(w) in widget-canvas.directive.js, resolved
   from the tile's own categoryItem name/description with the exact same
   classifier ds-card uses, so a tile picks up the same accent its catalogue
   card would ("Bitcoin Price" -> finance green, "Weather Forecast" ->
   weather blue, etc). The class lands on the tile's own outer .wc-tile.app
   container (see widget-canvas.html), not a nested content div, so these
   vars cascade down to .wc-tile-inner's background below the same way
   .dsc's vars cascade to .dsc-backdrop.
   ─────────────────────────────────────────────────────────────────────── */
.wc-theme-finance   { --wc-accent: #10b981; --wc-accent-2: #059669; --wc-glow: #34d399; }
.wc-theme-weather   { --wc-accent: #0ea5e9; --wc-accent-2: #6366f1; --wc-glow: #38bdf8; }
.wc-theme-maps      { --wc-accent: #14b8a6; --wc-accent-2: #0d9488; --wc-glow: #2dd4bf; }
.wc-theme-commerce  { --wc-accent: #f59e0b; --wc-accent-2: #f97316; --wc-glow: #fbbf24; }
.wc-theme-ai        { --wc-accent: #8b5cf6; --wc-accent-2: #a78bfa; --wc-glow: #c4b5fd; }
.wc-theme-documents { --wc-accent: #06b6d4; --wc-accent-2: #0891b2; --wc-glow: #22d3ee; }
.wc-theme-media     { --wc-accent: #ec4899; --wc-accent-2: #d946ef; --wc-glow: #f472b6; }
.wc-theme-knowledge { --wc-accent: #3b82f6; --wc-accent-2: #60a5fa; --wc-glow: #93c5fd; }
.wc-theme-health    { --wc-accent: #f43f5e; --wc-accent-2: #fb7185; --wc-glow: #fda4af; }
.wc-theme-people    { --wc-accent: #6366f1; --wc-accent-2: #818cf8; --wc-glow: #a5b4fc; }
.wc-theme-data      { --wc-accent: #d97706; --wc-accent-2: #f59e0b; --wc-glow: #fbbf24; }
.wc-theme-generic   { --wc-accent: #6b7280; --wc-accent-2: #9ca3af; --wc-glow: #d1d5db; }

/* ── Tile card chrome ─────────────────────────────────────────────────────
   Applies to the real content wrapper of every tile shape (GridStack's
   .grid-stack-item-content and interact.js's .wc-tile), each carrying this
   class alongside its structural classes. Translucent wash (not an opaque
   fill) per CLAUDE.md's "no background-color on components" rule — same
   interpretation already used by .ff-card / .n1-goal / .dsc-backdrop
   elsewhere in this codebase. Reads --wc-accent/--wc-accent-2 from the
   .wc-theme-* class above (inherited from the ancestor .wc-tile.app); falls
   back to the plain body-color tint when untethemed (e.g. no categoryItem
   picked yet).
   ─────────────────────────────────────────────────────────────────────── */
.wc-tile-inner {
    position: relative;
    border-radius: var(--wc-radius);
    /*border: 1px solid color-mix(in srgb, var(--wc-accent, var(--bs-border-color)) 30%, var(--app-border, var(--bs-border-color)));*/
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--wc-accent, var(--bs-body-color)) var(--wc-wash-a, 12%), transparent) 0%,
        color-mix(in srgb, var(--wc-accent-2, var(--bs-body-color)) var(--wc-wash-b, 4%), transparent) 60%,
        transparent 100%);
    /*box-shadow: var(--wc-shadow-soft);*/
    transition: box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    overflow: hidden;
}

/*
  A tile flagged plain: no accent wash, no accent hover tint.

  The palette exists so a canvas full of widgets is tellable apart at a glance,
  which is worth having by default. It is worth switching off on a tile whose
  own content already carries the colour — a chart, a map, a photo — where a
  tint underneath only muddies it. Flagged per DATA SOURCE, the same seed the
  colour is derived from, so a source stays plain everywhere it appears.
*/
.wc-tile-inner.wc-tile--plain,
.grid-stack-item:hover .wc-tile-inner.wc-tile--plain,
.wc-tile:hover.wc-tile-inner.wc-tile--plain {
    background: none;
}

[data-bs-theme="dark"] .wc-tile-inner {
    --wc-wash-a: 18%;
    --wc-wash-b: 7%;
}

/* ⚠️ NO OUTLINE ON HOVER. The second shadow here was `0 0 0 1px`, which is a
   ring — it reads as a border appearing under the cursor even though the real
   border on .wc-tile-inner has been commented out for a while. The
   border-color line was setting a colour on a border that does not exist. The
   lift stays; it says "this is the tile you are on" without drawing a box. */
.grid-stack-item:hover .wc-tile-inner,
.wc-tile:hover.wc-tile-inner {
    box-shadow: var(--wc-shadow-hover);
    --wc-wash-a: 16%;
    --wc-wash-b: 6%;
}

/* <composite-widget> is a plain custom element with no styling of its own here, so without
   this it renders display:inline (the browser default for unknown elements) - inside
   .wc-tile-inner's flex column that means it never actually participates as a flex item, its
   composite-widget.html root div's h-100 has no definite height to resolve against, and the
   whole thing just grows to fit its content instead of being constrained to the space
   .wc-drag-handle leaves it. flex + min-height:0 (the classic flexbox fix for a child that
   otherwise refuses to shrink below its content's intrinsic size) is what actually lets
   dashboard.component.js's recalcRowHeights() measure a real, constrained height instead of
   one that's already ballooned to fit an unconstrained child - see composite-widget.html's own
   fnc-dashboard rule for the next link in this same chain. */
composite-widget {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* ── Drag Handle — glass strip floating above tile content ─────────────────
   .wc-tile-inner clips to var(--wc-radius) via overflow:hidden, so this strip's
   own square corners were relying entirely on that clip - fine for the fill,
   but its old 8px side padding put the name label/action icons right up
   against where the corner curve actually starts, reading as cramped/cut off
   once --wc-radius grew (clamp up to 24px) for the accent-wash tiles. Explicit
   top rounding + more side padding keeps content clear of the curve instead
   of just trusting the parent's clip. */
.wc-drag-handle {
    height: 48px;
    width: 100%;
    flex: 0 0 48px;
    padding: 12px !important;
    border-top-left-radius: var(--wc-radius);
    border-top-right-radius: var(--wc-radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
    user-select: none;
    position: relative;
    z-index: 11;
    border-bottom: 1px solid var(--glass-bg, transparent);
    /*    background: var(--glass-bg, transparent);
    border-bottom: 1px solid var(--glass-border, transparent);
    backdrop-filter: blur(var(--glass-blur, 12px));
    -webkit-backdrop-filter: blur(var(--glass-blur, 12px));*/
    transition: background-color 0.18s ease;
    /* Subtle grip lines using body color at low opacity */
    /*background-image: repeating-linear-gradient( 90deg, transparent, transparent 3px, color-mix(in srgb, var(--bs-body-color) 9%, transparent) 1px, color-mix(in srgb, var(--bs-body-color) 9%, transparent) 2px );*/
}

.wc-drag-handle:active {
    cursor: grabbing;
}

/* ── Widget name ──────────────────────────────────────────────────────── */
.wc-drag-handle .wc-tile-name {
    font-size: var(--text-xs, 11px);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--bs-body-color) 35%, transparent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
    transition: color 0.18s ease;
}

.grid-stack-item:hover .wc-drag-handle .wc-tile-name {
    color: color-mix(in srgb, var(--bs-body-color) 85%, transparent);
}

/* ── Action buttons ───────────────────────────────────────────────────── */
.wc-drag-handle .wc-tile-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

.grid-stack-item:hover .wc-drag-handle .wc-tile-actions {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ── Drag grip dots ───────────────────────────────────────────────────── */
.wc-drag-grip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-right: 6px;
    flex-shrink: 0;
    opacity: 0.25;
    transition: opacity 0.18s ease;
}

.grid-stack-item:hover .wc-drag-grip {
    opacity: 0.55;
}

.wc-drag-grip span {
    display: flex;
    gap: 2px;
}

    .wc-drag-grip span i {
        width: 3px;
        height: 3px;
        border-radius: 50%;
        background: var(--bs-body-color);
        display: block;
    }

/* ── View-type-2 flat tile ──────────────────────────────────────────────
   Was Bootstrap's utility `rounded` (0.375rem) + `border`, no shadow.
   Brought in line with the GridStack/interact.js tile chrome above -
   same .wc-theme-* accent wash as .wc-tile-inner. */
.wc-flat-tile {
    border-radius: var(--wc-radius) !important;
    border: 1px solid color-mix(in srgb, var(--wc-accent, var(--bs-border-color)) 30%, var(--app-border, var(--bs-border-color))) !important;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--wc-accent, var(--bs-body-color)) var(--wc-wash-a, 12%), transparent) 0%,
        color-mix(in srgb, var(--wc-accent-2, var(--bs-body-color)) var(--wc-wash-b, 4%), transparent) 60%,
        transparent 100%);
    box-shadow: var(--wc-shadow-soft);
    transition: box-shadow 0.2s ease, background 0.2s ease;
}

[data-bs-theme="dark"] .wc-flat-tile {
    --wc-wash-a: 18%;
    --wc-wash-b: 7%;
}

    .wc-flat-tile:hover {
        box-shadow: var(--wc-shadow-hover);
        --wc-wash-a: 16%;
        --wc-wash-b: 6%;
    }
