/* /try page — builds on /components/light-kit.css tokens (--accent, --line, --ink …). */
[hidden] { display: none !important; } /* class display rules must not beat the hidden attribute */
.tp-main { padding-top: 68px; min-height: 100vh; background: linear-gradient(180deg, #f2f7ff 0%, #f7f5ff 40%, #ffffff 100%); }
.tp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tp-home { padding: 8px 16px; font-size: .85rem; }
.tp-small { font-size: .85rem; color: var(--muted); line-height: 1.6; }
.tp-error { color: #b91c1c; font-weight: 600; margin-top: 12px; }

.tp-screen { max-width: 720px; margin: 0 auto; padding: 72px 24px; text-align: center; display: grid; gap: 16px; justify-items: center; }
.tp-start { margin-top: 8px; }
.tp-intro .tp-small { max-width: 520px; }
.tp-h1 { display: grid; gap: 6px; }
.tp-h1-sub { font-size: .55em; font-weight: 600; color: var(--accent); }
.tp-note { display: inline-block; font-size: .85rem; font-weight: 600; color: #065f46; background: #ecfdf5; border: 1px solid #bbf7d0; border-radius: 999px; padding: 4px 12px; }
.tp-note-inline { font-size: .75rem; padding: 2px 10px; margin-inline-end: auto; }
.tp-ctabar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.tp-ctabar-lead { font-weight: 700; color: var(--ink); }
.tp-ctabar .lk-btn { padding: 9px 18px; font-size: .9rem; }

.tp-spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--accent-soft); border-top-color: var(--accent); animation: tp-spin 0.9s linear infinite; }
@keyframes tp-spin { to { transform: rotate(360deg); } }

.tp-work { max-width: 1280px; margin: 0 auto; padding: 16px 24px 24px; }
.tp-statusbar { display: flex; justify-content: space-between; align-items: center; gap: 6px 12px; flex-wrap: wrap; padding: 8px 4px 12px; font-weight: 600; color: var(--ink-2); }
.tp-linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: .9rem; }
.tp-linkbtn:hover { color: var(--ink); }

.tp-split { display: grid; grid-template-columns: minmax(320px, 5fr) 7fr; gap: 16px; height: calc(100vh - 68px - 80px); min-height: 520px; }
.tp-chat, .tp-termwrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
/* min-width: 0 on the grid items matters: xterm sizes its screen from its container, and a grid column
   whose min is "auto" grows to that screen width, which the fit addon then measures again — on a phone
   this loop settled at 452px and the whole page scrolled sideways (live QA 2026-10-10). */
.tp-log > * { flex-shrink: 0; }
.tp-log { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.tp-msg { display: flex; gap: 10px; align-items: flex-start; }
.tp-who { flex-shrink: 0; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 16px; white-space: nowrap; display: grid; place-items: center; font-size: .72rem; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.tp-msg.me { flex-direction: row-reverse; }
.tp-msg.me .tp-who { background: #e0f2fe; color: #0369a1; }
.tp-bubble { background: #f6f7fb; border-radius: 14px; padding: 10px 14px; font-size: .95rem; max-width: 100%; white-space: pre-wrap; }
.tp-msg.me .tp-bubble { background: #eef7ff; }
.tp-msg-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; flex: 1; }
.tp-msg-body > * { min-width: 0; max-width: 100%; }
.tp-msg.me .tp-msg-body { justify-items: end; }

.tp-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 8px; }
.tp-chip { border: 1px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 999px; padding: 8px 14px; font-size: .88rem; font-weight: 600; cursor: pointer; }
.tp-chip:hover:not(:disabled) { border-color: var(--accent-2); color: var(--accent); }
.tp-chip:disabled { opacity: .45; cursor: default; }
.tp-expert-toggle { flex-basis: 100%; text-align: start; background: none; border: 0; padding: 6px 2px 0; color: var(--muted); font-size: .8rem; font-weight: 600; cursor: pointer; }
.tp-expert-toggle::before { content: '\25B8'; display: inline-block; margin-inline-end: 6px; }
.tp-expert-toggle[aria-expanded="true"]::before { content: '\25BE'; }
[dir="rtl"] .tp-expert-toggle[aria-expanded="false"]::before { content: '\25C2'; }
.tp-expert-toggle:hover { color: var(--ink); }
.tp-expert { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.tp-chip.expert { font-size: .8rem; padding: 6px 12px; font-weight: 500; color: var(--muted); }

.tp-ask { display: flex; gap: 8px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.tp-ask input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; font: inherit; font-size: .95rem; }
.tp-ask input:focus { outline: 2px solid var(--accent-2); outline-offset: 0; }
.tp-ask .lk-btn { padding: 10px 18px; font-size: .9rem; }
.tp-count { font-size: .75rem; color: var(--muted); min-width: 52px; text-align: end; }

.tp-plan { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; display: grid; gap: 10px; }
.tp-plan-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tp-badge { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #ecfdf5; color: var(--ok); border: 1px solid #bbf7d0; }
.tp-badge.ai { background: var(--accent-soft); color: var(--accent); border-color: #ddd6fe; }
.tp-plan-summary { font-size: .95rem; color: var(--ink); white-space: pre-wrap; }
.tp-plan-note { font-size: .82rem; color: var(--muted); }
.tp-plan-state { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.tp-steps { display: grid; gap: 8px; padding-inline-start: 20px; }
.tp-step { font-size: .9rem; min-width: 0; }
.tp-step.removed { opacity: .45; text-decoration: line-through; }
.tp-step-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tp-risk { font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: #f1f5f9; color: var(--ink-2); }
.tp-risk.medium { background: #fef3c7; color: #92400e; }
.tp-risk.high { background: #fee2e2; color: #991b1b; }
.tp-step-remove { margin-inline-start: auto; font-size: .78rem; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 2px 10px; cursor: pointer; }
.tp-cmd { display: block; margin-top: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 6px 10px; overflow-x: auto; white-space: pre; direction: ltr; text-align: left; }
.tp-plan-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tp-plan-actions .lk-btn { padding: 9px 18px; font-size: .9rem; }
.tp-plan-actions .lk-btn:disabled { opacity: .55; cursor: default; transform: none; }

.tp-termwrap { background: #0f172a; border-color: #1e293b; overflow: hidden; }
.tp-termbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 8px 14px; color: #cbd5e1; font-size: .82rem; border-bottom: 1px solid #1e293b; }
.tp-termbar .tp-small { color: #94a3b8; font-size: .75rem; }
.tp-term { flex: 1; min-height: 0; min-width: 0; padding: 8px; direction: ltr; overflow: hidden; }
.tp-termbar { flex-wrap: wrap; row-gap: 2px; }

@keyframes tp-blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.tp-thinking { letter-spacing: 2px; animation: tp-blink 1.2s ease-in-out infinite; }

.tp-textlink { color: var(--accent); font-weight: 600; text-decoration: none; }
.tp-textlink:hover { text-decoration: underline; }

.tp-end-cta .lk-btn, .tp-ctabar .lk-btn { white-space: normal; text-align: center; max-width: 100%; }
.tp-end-cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

@media (max-width: 900px) {
  .tp-work { padding: 12px 16px 16px; }
  .tp-split { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .tp-chat { min-height: 420px; max-height: 70vh; }
  .tp-chips { max-height: 38vh; overflow-y: auto; } /* 7 chips + expert fold: scroll them, keep the chat visible */
  .tp-termwrap { height: 52vh; min-height: 300px; }
  .tp-screen { padding: 48px 16px; }
}
@media (max-width: 480px) {
  .tp-count { display: none; }
  .tp-ask .lk-btn { padding: 10px 14px; }
}
@media (prefers-reduced-motion: reduce) { .tp-spinner { animation: none; } }

/* banner: the real-folder trial lives on app.wiasoom.com/try/pc (this page is the sample PC) */
.tp-real { max-width: 560px; margin: 0 auto 18px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: #f8f7ff; font-size: .92rem; color: var(--ink-2); line-height: 1.6; overflow-wrap: anywhere; }
.tp-real a { font-weight: 700; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.tp-real a::after { content: " \2192"; }
[dir="rtl"] .tp-real a::after { content: " \2190"; }
.tp-resting .tp-real { margin-top: 18px; }

/* ===== dark theme (/components/site-theme.js sets <html data-theme>; tokens come from /components/site-theme.css) ===== */
/* /try has no burger menu, so the header theme button stays visible on phones */
@media (max-width: 900px) { .lk-actions .lk-theme-wrap { display: inline-flex; } }
:root[data-theme="dark"] .tp-main { background: linear-gradient(180deg, #0e1220 0%, #100e1c 40%, #0b0b12 100%); }
:root[data-theme="dark"] .tp-error { color: #fca5a5; }
:root[data-theme="dark"] .tp-note,
:root[data-theme="dark"] .tp-badge { color: #86efac; background: #0d2a1c; border-color: #1f5136; }
:root[data-theme="dark"] .tp-ctabar,
:root[data-theme="dark"] .tp-chat,
:root[data-theme="dark"] .tp-chip,
:root[data-theme="dark"] .tp-plan,
:root[data-theme="dark"] .tp-step-remove { background: var(--surface); }
:root[data-theme="dark"] .tp-step-remove { color: var(--ink-2); }
:root[data-theme="dark"] .tp-msg.me .tp-who { background: #0c3550; color: #9fd8ff; }
:root[data-theme="dark"] .tp-bubble { background: #1b1c29; color: var(--ink); }
:root[data-theme="dark"] .tp-msg.me .tp-bubble { background: #11283b; }
:root[data-theme="dark"] .tp-badge.ai { background: var(--accent-soft); color: var(--accent); border-color: #4c3f8f; }
:root[data-theme="dark"] .tp-risk { background: #222433; }
:root[data-theme="dark"] .tp-risk.medium { background: #3a2a0a; color: #fcd34d; }
:root[data-theme="dark"] .tp-risk.high { background: #3b1414; color: #fca5a5; }
:root[data-theme="dark"] .tp-cmd { background: #05060c; border: 1px solid var(--line); }
:root[data-theme="dark"] .tp-termwrap { background: #05060c; border-color: var(--line); }
:root[data-theme="dark"] .tp-termbar { border-bottom-color: var(--line); }
:root[data-theme="dark"] .tp-real { background: #19162b; }
:root[data-theme="dark"] .tp-ask input { background: var(--bg-soft); color: var(--ink); }

/* screen reader pass 2026-10-17: plan title is a heading, focused cards/states get a quiet ring */
.tp-plan-title { font-size: 1rem; font-weight: 700; margin: 0; }
#work-title:focus, #end-title:focus { outline: none; }
.tp-plan-title:focus { outline: none; }
.tp-plan-state:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tp-plan-state:focus:not(:focus-visible) { outline: none; }
