/* Dimes card treatments and installed-app tools; shell comes from Cranium. */
.card-color-swatch { width: 20px; height: 20px; border-radius: 4px; display: inline-block; vertical-align: middle; }
.benefit-card { border-left: 4px solid var(--card-color, #4a90d9); }
:root { --tile-hi-bg: #2a0d0d; --tile-med-bg: #231808; }
.a2hs-hint { display: none; }
    /* ── Card header names and row text ──────────────────────
       These live outside .card elements, so they rely on body cascade.
       Explicit overrides prevent browser quirks from showing dark-on-dark. */
    [data-theme="ai"] .card-header-row,
    [data-theme="ai"] .card-header-row .fw-semibold { color: var(--text-primary) !important; }
    [data-theme="ai"] .row-name  { color: var(--text-primary) !important; }
    [data-theme="ai"] .roi-legend .roi-captured { color: var(--text-primary) !important; }

    @keyframes aiPulse {
      0%, 100% { box-shadow: 0 0 10px rgba(255,0,80,.25), var(--card-shadow); }
      50%       { box-shadow: 0 0 22px rgba(255,0,80,.45), var(--card-shadow); }
    }
    @keyframes aiPulseMed {
      0%, 100% { box-shadow: 0 0 10px rgba(255,120,0,.2), var(--card-shadow); }
      50%       { box-shadow: 0 0 20px rgba(255,120,0,.4), var(--card-shadow); }
    }

@media (max-width: 768px) {
      /* ── Add-to-Home-Screen hint (shown by JS on mobile, non-standalone) ── */
      .a2hs-hint.a2hs-show {
        display: flex;
        align-items: center;
        gap: 10px;
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px);
        z-index: 1031;
        background: var(--bg-card);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 10px 12px;
        box-shadow: 0 8px 28px rgba(0,0,0,.28);
        font-size: .85rem;
      }
      [data-theme="ai"] .a2hs-hint.a2hs-show {
        box-shadow: 0 0 20px rgba(0,200,255,.25), 0 8px 28px rgba(0,0,0,.5);
        backdrop-filter: blur(10px);
      }
      .a2hs-hint .a2hs-icon { font-size: 1.5rem; flex-shrink: 0; color: var(--text-primary); }
      .a2hs-hint .a2hs-text { flex: 1 1 auto; line-height: 1.25; display: flex; flex-direction: column; }
      .a2hs-hint .a2hs-text span { color: var(--text-muted); font-size: .78rem; }
      .a2hs-hint .a2hs-x {
        background: none; border: none; color: var(--text-muted);
        font-size: 1.5rem; line-height: 1; padding: 0 4px; flex-shrink: 0;
      }

      /* ── Sheet-style modals ─────────────────────────────────── */
      .modal.fade .modal-dialog {
        transform: translateY(100%);
        transition: transform .3s cubic-bezier(.32,.72,0,1);
        margin: 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        width: 100%;
      }
      .modal.show .modal-dialog { transform: translateY(0); }
      .modal-content {
        border-radius: 16px 16px 0 0 !important;
        border-bottom: none !important;
        padding-top: 14px;
        padding-bottom: calc(var(--safe-bottom) + 8px);
        max-height: 90vh;
      }
      /* Drag-handle pill */
      .modal-content::before {
        content: '';
        position: absolute;
        top: 6px;
        left: 50%;
        transform: translateX(-50%);
        width: 38px;
        height: 5px;
        border-radius: 3px;
        background: color-mix(in srgb, var(--text-muted) 50%, transparent);
        pointer-events: none;
      }
      .modal-header {
        border-bottom: 1px solid var(--border-color);
        padding: .5rem 1rem .75rem;
      }
      .modal-header .modal-title { font-weight: 600; font-size: 1.05rem; }
      /* min-height:0 lets this flex child shrink below its content so overflow-y
         actually scrolls — without it a tall body blows past the 90vh cap and
         pushes the footer (Save/Cancel) off-screen. */
      .modal-body  { padding: 1rem; overflow-y: auto; min-height: 0; }
      .modal-footer {
        padding: .75rem 1rem calc(.75rem + var(--safe-bottom));
        gap: .5rem;
      }
      .modal-footer .btn { flex: 1; }

      /* Full-screen-ish dialogs already use modal-fullscreen-sm-down — leave those */
      .modal-fullscreen-sm-down .modal-content {
        border-radius: 0 !important;
        padding-top: var(--safe-top);
      }
      .modal-fullscreen-sm-down .modal-content::before { display: none; }

}
