/* Tap-for-more details on Momo's replies (public/details.js). The words get a soft underline and a small dot;
   the popup is a small card beside them on a wide screen and a sheet from the bottom on a phone. It sits above
   Agent mode (80) and its shown card (85), under toasts (90) and the lock screen (100). */
.dt-link { cursor: pointer; border-radius: 4px; text-decoration-line: underline; text-decoration-color: rgba(43, 79, 214, .38); text-decoration-thickness: 2px; text-underline-offset: 3px; transition: background .2s var(--ease), text-decoration-color .2s var(--ease); -webkit-tap-highlight-color: transparent; }
.dt-link::after { content: ''; display: inline-block; width: 5px; height: 5px; margin: 0 1px 0 3px; border-radius: 50%; background: var(--pen); vertical-align: .5em; opacity: .7; }
.dt-link:hover, .dt-link[aria-expanded="true"] { background: rgba(43, 79, 214, .08); text-decoration-color: var(--pen); }
.dt-link:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; }

.dt-pop { position: fixed; left: 0; top: 0; z-index: 86; width: min(380px, calc(100vw - 24px)); display: flex; flex-direction: column; background: var(--card); color: var(--ink); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 1px 0 rgba(29, 26, 22, .05), 0 24px 48px -24px rgba(29, 26, 22, .55); overflow: hidden; opacity: 0; transform: translateY(4px); transition: opacity .18s var(--ease), transform .25s var(--ease); }
.dt-pop.in { opacity: 1; transform: none; }
.dt-pop[hidden] { display: none; }
.dt-pop:focus { outline: none; }
.dt-pop:focus-visible { box-shadow: 0 0 0 2px var(--pen), 0 24px 48px -24px rgba(29, 26, 22, .55); }
.dt-head { display: flex; align-items: flex-start; gap: 8px; padding: 14px 10px 4px 18px; }
.dt-title { flex: 1; min-width: 0; margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.3; overflow-wrap: anywhere; }
.dt-close { flex: none; width: 30px; height: 30px; margin-top: -4px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); cursor: pointer; }
.dt-close:hover { background: var(--paper); color: var(--ink); }
.dt-close:focus-visible, .dt-panel:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; }

.dt-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 18px 6px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); overflow-wrap: anywhere; }
.dt-body > * { margin: 0; }
.dt-body > * + * { margin-top: 8px; }
.dt-body ul, .dt-body ol { padding-left: 20px; }
.dt-body li + li { margin-top: 3px; }
.dt-body strong, .dt-body .rt-h { color: var(--ink); }
.dt-body .rt-h { font-size: 14.5px; font-weight: 700; }
.dt-body a { color: var(--pen); text-underline-offset: 2px; }
.dt-body code { font-family: var(--mono); font-size: 12.5px; background: var(--fill); padding: 1px 5px; border-radius: 5px; }
.dt-body pre { font-family: var(--mono); font-size: 12.5px; line-height: 1.5; white-space: pre; overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.dt-body pre code { background: none; padding: 0; }

.dt-foot { display: flex; justify-content: flex-end; padding: 8px 12px 12px; }
.dt-panel { height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; }
.dt-panel:hover { border-color: var(--pen); }

.dt-scrim { position: fixed; inset: 0; z-index: 86; background: rgba(29, 26, 22, .28); animation: dt-fade .2s var(--ease) both; }
.dt-scrim[hidden] { display: none; }

/* Phone: a sheet from the bottom, over the bottom bar, that never covers the whole screen. */
.dt-pop.dt-sheet { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 72vh; border-radius: 22px 22px 0 0; border-bottom: 0; transform: translateY(24px); padding-bottom: env(safe-area-inset-bottom); z-index: 87; }
.dt-pop.dt-sheet.in { transform: none; }
.dt-pop.dt-sheet .dt-head { padding: 18px 12px 6px 20px; }
.dt-pop.dt-sheet .dt-head::before { content: ''; position: absolute; top: 7px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 999px; background: var(--line-2); }
.dt-pop.dt-sheet .dt-title { font-size: 18px; }
.dt-pop.dt-sheet .dt-close { width: 36px; height: 36px; }
.dt-pop.dt-sheet .dt-body { padding: 4px 20px 8px; font-size: 15.5px; }
.dt-pop.dt-sheet .dt-foot { padding: 10px 16px 16px; }
.dt-pop.dt-sheet .dt-panel { height: 40px; padding: 0 18px; font-size: 14px; }

@keyframes dt-fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .dt-pop, .dt-pop.dt-sheet { transition: none; transform: none; }
  .dt-scrim { animation: none; }
}
