/* MiniDee: the little animated helper. The strip is fixed along the bottom; only the character and the chat panel take clicks. */
#minidee { position: fixed; left: 0; right: 0; bottom: 6px; height: 0; z-index: 700; pointer-events: none; }
#minidee[hidden] { display: none; }
.md-actor { position: absolute; left: 0; bottom: 0; pointer-events: auto; cursor: grab; will-change: transform; -webkit-tap-highlight-color: transparent; }
.md-bob { position: relative; transform-origin: 50% 100%; touch-action: none; }
.md-head3 { position: absolute; left: 0; top: 0; pointer-events: none; }
.md-head3[hidden] { display: none; }
.md-head3-in { position: relative; width: 100%; height: 100%; transition: transform .12s ease-out; }
.md-head-img { display: block; width: 100%; height: 100%; max-width: none; user-select: none; -webkit-user-drag: none; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .18)); }
.md-eyes { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.md-actor.md-held { cursor: grabbing; }
.md-sprite { display: block; max-width: none; user-select: none; -webkit-user-drag: none; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .18)); }
.md-shadow { position: absolute; left: 12%; right: 12%; bottom: -3px; height: 8px; border-radius: 50%; background: rgba(0, 0, 0, .16); filter: blur(3px); z-index: -1; }
.md-actor:hover .md-sprite { filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .18)) brightness(1.04); }
.md-breathe .md-sprite, .md-breathe .md-head3 { animation: md-breathe 3.2s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes md-breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.018); } }

.md-bubble { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); max-width: 220px; width: max-content; padding: 7px 11px; border-radius: 14px; background: var(--card-solid, #fff); color: var(--ink, #111); border: 1px solid var(--line, #ddd); box-shadow: 0 6px 18px rgba(0, 0, 0, .16); font-size: 13px; line-height: 1.35; pointer-events: none; animation: md-pop .18s ease-out; }
.md-bubble::after { content: ''; position: absolute; top: 100%; left: 50%; width: 10px; height: 10px; margin: -6px 0 0 -5px; background: inherit; border-right: 1px solid var(--line, #ddd); border-bottom: 1px solid var(--line, #ddd); transform: rotate(45deg); }
.md-bubble[hidden] { display: none; }
@keyframes md-pop { from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(.96); } }
.md-zzz { position: absolute; top: 4%; right: -6px; font-weight: 800; font-size: 15px; color: var(--muted, #888); pointer-events: none; animation: md-zzz 2s ease-in-out infinite; }
.md-zzz[hidden] { display: none; }
@keyframes md-zzz { 0% { opacity: 0; transform: translate(0, 8px) scale(.8); } 40% { opacity: 1; } 100% { opacity: 0; transform: translate(10px, -16px) scale(1.15); } }

.md-panel { position: absolute; bottom: calc(100% + 8px); width: min(340px, calc(100vw - 20px)); max-height: min(520px, 68vh); display: flex; flex-direction: column; border: 1px solid var(--line, #ddd); border-radius: 18px; background: var(--card-solid, #fff); color: var(--ink, #111); box-shadow: 0 18px 50px rgba(0, 0, 0, .28); overflow: hidden; pointer-events: auto; cursor: default; animation: md-pop .18s ease-out; }
.md-panel[hidden] { display: none; }
.md-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line, #ddd); }
.md-head b { font-size: 14px; } .md-head small { color: var(--muted, #888); font-size: 11px; }
.md-head .grow { flex: 1; }
.md-log { flex: 1; min-height: 120px; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.md-msg { max-width: 88%; padding: 8px 11px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.md-msg.bot { align-self: flex-start; background: color-mix(in srgb, var(--ink, #111) 7%, transparent); border-bottom-left-radius: 4px; }
.md-msg.me { align-self: flex-end; background: var(--accent, #14383a); color: #fff; border-bottom-right-radius: 4px; }
.md-msg p { margin: 0 0 6px; } .md-msg p:last-child { margin-bottom: 0; } .md-msg ul { margin: 4px 0 0; padding-left: 18px; }
.md-rows { display: grid; gap: 4px; margin-top: 6px; }
.md-row { display: block; width: 100%; text-align: left; padding: 6px 9px; border: 1px solid var(--line, #ddd); border-radius: 10px; background: var(--card-solid, #fff); color: var(--ink, #111); font: inherit; font-size: 13px; cursor: pointer; }
.md-row:hover { background: color-mix(in srgb, var(--ink, #111) 6%, transparent); }
.md-row small { display: block; color: var(--muted, #888); font-size: 11.5px; }
.md-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 8px; }
.md-chip { padding: 5px 10px; border: 1px solid var(--line, #ddd); border-radius: 99px; background: transparent; color: var(--ink, #111); font: inherit; font-size: 12px; cursor: pointer; }
.md-chip:hover { background: color-mix(in srgb, var(--ink, #111) 7%, transparent); }
.md-form { display: flex; gap: 6px; padding: 8px 10px 6px; border-top: 1px solid var(--line, #ddd); }
.md-form input { flex: 1; min-width: 0; padding: 8px 11px; border: 1px solid var(--line, #ddd); border-radius: 99px; background: var(--card-solid, #fff); color: var(--ink, #111); font: inherit; font-size: 13.5px; }
.md-form button { padding: 0 14px; border: 0; border-radius: 99px; background: var(--accent, #14383a); color: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.md-note { margin: 0; padding: 0 12px 8px; color: var(--muted, #888); font-size: 11px; }

/* the MiniDee page in Settings */
.md-set-prev { display: flex; align-items: flex-end; gap: 14px; margin: 6px 0 10px; }
.md-set-prev img { height: 150px; width: auto; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .2)); }
.md-swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.md-sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line, #ccc); cursor: pointer; padding: 0; }
.md-sw.on { outline: 3px solid var(--accent, #14383a); outline-offset: 2px; }
.md-sw-pick { width: 34px; height: 28px; padding: 0; border: 1px solid var(--line, #ccc); border-radius: 8px; background: none; cursor: pointer; }
.md-range { display: flex; align-items: center; gap: 10px; margin: 4px 0; flex-wrap: wrap; }
.md-range input[type=range] { width: min(260px, 60vw); }
.md-range b { min-width: 3.4em; font-variant-numeric: tabular-nums; }
html.no-motion .md-breathe .md-sprite, html.no-motion .md-breathe .md-head3, html.no-motion .md-zzz { animation: none; }
@media (prefers-reduced-motion: reduce) { .md-breathe .md-sprite, .md-breathe .md-head3, .md-zzz, .md-bubble, .md-panel { animation: none; } }
@media print { #minidee { display: none !important; } }

/* wardrobe: items drawn over the picture, and whole looks */
.md-acc { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.md-item { position: absolute; }
.md-item svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
#minidee[data-look="sketch"] .md-sprite, #minidee[data-look="sketch"] .md-head-img { filter: grayscale(1) contrast(1.7) brightness(1.08) drop-shadow(0 3px 5px rgba(0, 0, 0, .18)); }
#minidee[data-look="blueprint"] .md-sprite, #minidee[data-look="blueprint"] .md-head-img { filter: grayscale(1) invert(.9) sepia(1) hue-rotate(175deg) saturate(3) brightness(.9) drop-shadow(0 3px 5px rgba(0, 0, 0, .18)); }
#minidee[data-look="neon"] .md-sprite, #minidee[data-look="neon"] .md-head-img { filter: saturate(1.8) contrast(1.15) drop-shadow(0 0 6px #22e3ff) drop-shadow(0 0 14px #ff3cac); }
#minidee[data-look="retro"] .md-sprite, #minidee[data-look="retro"] .md-head-img { filter: sepia(.85) contrast(1.1) brightness(.95) drop-shadow(0 3px 5px rgba(0, 0, 0, .18)); }
#minidee[data-look="ghost"] .md-sprite, #minidee[data-look="ghost"] .md-head-img, #minidee[data-look="ghost"] .md-acc { opacity: .55; filter: blur(.4px) brightness(1.3) drop-shadow(0 0 8px rgba(120, 200, 255, .8)); }
#minidee[data-look="pop"] .md-sprite, #minidee[data-look="pop"] .md-head-img { filter: contrast(1.6) saturate(2.2) drop-shadow(3px 3px 0 #111); }
#minidee[data-look="toy"] .md-sprite, #minidee[data-look="toy"] .md-head-img { filter: saturate(1.4) brightness(1.08) contrast(1.05) drop-shadow(0 6px 4px rgba(0, 0, 0, .3)); }
