/* mobile-distinct.css — D2-D6 of harnessing-iphone-flotilla S6.
 *
 * Toast (shake / favorite / push), heart flicker (favorite), and global
 * search sheet styling (consumed inside BottomSheet primitive).
 */

/* ── Toast ── */

.mdtoast {
    position: fixed;
    left: 50%;
    bottom: calc(112px + env(safe-area-inset-bottom, 0px));
    transform: translate(-50%, 16px);
    z-index: 11800;
    background: rgba(10, 46, 46, 0.94);
    color: #f4ead4;
    border: 1px solid rgba(232, 160, 64, 0.5);
    border-radius: 999px;
    padding: 9px 18px;
    font: 500 13px/1.3 -apple-system, BlinkMacSystemFont, sans-serif;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease-out, transform 0.25s ease-out;
    white-space: nowrap;
}

.mdtoast.mdtoast-show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.mdtoast-warn {
    border-color: rgba(232, 90, 64, 0.8);
    color: #ffd9c4;
}

/* ── Heart flicker on double-tap-to-favorite ── */

.md-heart-flicker {
    position: fixed;
    z-index: 11850;
    color: #e8a040;
    font-size: 56px;
    line-height: 1;
    transform: translate(-50%, -50%);
    pointer-events: none;
    text-shadow: 0 2px 14px rgba(232, 160, 64, 0.6);
    animation: md-heart-pop 0.85s ease-out forwards;
}

@keyframes md-heart-pop {
    0%   { opacity: 0;   transform: translate(-50%, -50%) scale(0.4); }
    20%  { opacity: 1;   transform: translate(-50%, -50%) scale(1.15); }
    65%  { opacity: 0.9; transform: translate(-50%, -50%) scale(1.0); }
    100% { opacity: 0;   transform: translate(-50%, -75%) scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
    .md-heart-flicker { animation: none; opacity: 0.85; }
    .mdtoast { transition: opacity 0.05s linear; transform: translate(-50%, 0); }
}

/* ── Global search sheet (consumed inside BottomSheet) ── */

.md-search-host {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 4px 24px;
}

.md-search-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(10, 46, 46, 0.55);
    border: 1px solid rgba(232, 160, 64, 0.4);
    color: #f4ead4;
    border-radius: 12px;
    padding: 12px 14px;
    font: 500 16px/1.3 -apple-system, BlinkMacSystemFont, sans-serif;
    outline: none;
}

.md-search-input::placeholder {
    color: rgba(244, 234, 212, 0.55);
}

.md-search-input:focus {
    border-color: rgba(232, 160, 64, 0.85);
}

.md-search-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.md-search-section-title {
    color: rgba(232, 160, 64, 0.85);
    font: 600 12px/1.3 -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 6px;
    padding: 0 2px;
}

.md-search-row {
    padding: 10px 4px;
    border-bottom: 1px solid rgba(244, 234, 212, 0.08);
    cursor: pointer;
}

.md-search-row:last-child { border-bottom: 0; }

.md-search-row-name {
    color: #f4ead4;
    font: 500 15px/1.3 -apple-system, BlinkMacSystemFont, sans-serif;
}

.md-search-row-sub {
    color: rgba(244, 234, 212, 0.6);
    font: 400 12px/1.3 -apple-system, BlinkMacSystemFont, sans-serif;
    margin-top: 2px;
}

.md-search-loading,
.md-search-empty {
    color: rgba(244, 234, 212, 0.6);
    text-align: center;
    padding: 18px 0;
    font: 500 13px/1.4 -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Ambient Fergi's answer line in the global search sheet ──
   truly-ambient-fergiai S3 (W3.2). The sheet's input IS the room's ambient
   control, so the sheet owes the member a sentence about what Fergi did with
   their words — law 6, visible causality. It sits above the result list so a
   refusal is read before the (possibly unchanged) rows below it. */

.md-search-note {
    color: rgba(244, 234, 212, 0.86);
    background: rgba(232, 160, 64, 0.14);
    border: 1px solid rgba(232, 160, 64, 0.38);
    border-radius: 10px;
    padding: 8px 12px;
    margin: 0 0 10px;
    font: 500 13px/1.35 -apple-system, BlinkMacSystemFont, sans-serif;
}

.md-search-note[hidden] { display: none; }
.md-search-note.md-note-busy { opacity: 0.75; }
.md-search-note.md-note-warn { border-color: rgba(232, 120, 64, 0.75); }
