/* A project's mobile app (#116). Loaded with the tab's module. */
.app-pane { grid-row: 4; min-height: 0; overflow: auto; padding: 1rem; background: var(--ground, #f5f6f2); }
.app-wrap { max-width: 34rem; margin: 0 auto; display: grid; gap: .9rem; }
.app-head h3 { margin: 0; font-size: 1.1rem; }
.app-muted { margin: 0; color: var(--ink-3, #4d4d4d); font-size: .88rem; line-height: 1.6; }
.app-error { margin: 0; color: #a3353d; font-weight: 700; }
.app-note { margin: 0; padding: .55rem .75rem; border-radius: 10px; background: var(--accent-wash, var(--accent-wash)); color: var(--accent-ink, var(--accent-ink)); font-size: .9rem; }
.app-diagnostics { margin: 0; padding: .75rem; max-height: 14rem; overflow: auto; direction: ltr; text-align: left; border-radius: 10px; background: var(--panel, #fff); border: 1px solid var(--rule, #e4e4e4); font-size: .78rem; white-space: pre-wrap; }
.app-steps { display: flex; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.app-steps li { flex: 1; padding: .55rem .5rem; text-align: center; border-radius: 10px; border: 1px solid var(--rule, #e4e4e4); color: var(--ink-3, #4d4d4d); font-size: .85rem; }
.app-steps li.done { background: var(--accent-wash, var(--accent-wash)); color: var(--accent-ink, var(--accent-ink)); }
.app-steps li.now { border-color: var(--accent, var(--accent)); color: var(--accent-ink, var(--accent-ink)); font-weight: 700; animation: app-pulse 1.4s ease-in-out infinite; }
@keyframes app-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .app-steps li.now { animation: none; } }
/* The phone keeps its shape whatever the screen: a fixed ratio, so the page does not jump when the preview arrives. */
.app-phone { justify-self: center; width: min(100%, 17.5rem); aspect-ratio: 9 / 19; border-radius: 2rem; border: .5rem solid #1f1f1f; background: #1f1f1f; overflow: hidden; }
.app-phone-wait { display: grid; place-items: center; height: 100%; background: var(--panel, #fff); color: var(--ink-3, #4d4d4d); font-size: .9rem; }
/* Buttons sit side by side, and wrap rather than leave the screen; each is big enough for a thumb. */
.app-wrap .btn-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.app-wrap .btn-row button { flex: 1 1 7rem; min-width: 0; min-height: 44px; }

/* The phone opens in a window of its own (#111): the idle card says what to press, and a blocked window leaves a plain link. */
.app-open-link, .app-chip-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 1rem; border-radius: 12px; border: 1px solid var(--accent, var(--accent)); color: var(--accent-ink, var(--accent-ink)); font-weight: 700; text-decoration: none; }

/* The way in from the chat: one button above the box the message is written in, full width on a phone and a thumb tall. */
.app-chip { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem .7rem 0; }
.app-chip.hidden { display: none; }
.app-chip-btn { flex: 1 1 12rem; min-height: 48px; padding: 0 1rem; border-radius: 14px; border: 1px solid var(--accent, var(--accent)); background: var(--accent, var(--accent)); color: #fff; font-size: 1rem; font-weight: 700; cursor: pointer; }
.app-chip-btn:disabled { background: var(--accent-wash, var(--accent-wash)); color: var(--accent-ink, var(--accent-ink)); border-color: var(--rule, #e4e4e4); cursor: default; }
.app-chip-note { font-size: .85rem; color: var(--ink-3, #4d4d4d); }

/* A link the agent writes: a button to this site, never raw text (#111). */
.md-link { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; margin: .2rem 0; padding: 0 1rem; border-radius: 12px; border: 1px solid var(--accent, var(--accent)); background: var(--accent-wash, var(--accent-wash)); color: var(--accent-ink, var(--accent-ink)); font-weight: 700; text-decoration: none; }
.md-link::after { content: '↗'; font-size: .9em; }
.md-link:focus-visible, .app-chip-btn:focus-visible { outline: 3px solid var(--accent, var(--accent)); outline-offset: 2px; }
