/* The public /try demo: the iPad Home and reader + workspace full window, a slim demo bar, a dismissible
   "Try this" list, loading and failure states, and the app's compact layout on phone-width screens. */
html,body{height:100%}
body.try-page{margin:0;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto minmax(0,1fr);grid-template-areas:"bar bar" "tips tips" "views views";height:100dvh;overflow:hidden;background:var(--sys-bg);color:var(--sys-label);font:15px/1.35 var(--font-ui)}
.try-bar{grid-area:bar;display:flex;align-items:center;gap:8px;padding:6px 12px;background:var(--sys-bg-2);border-bottom:.5px solid var(--sys-separator)}
.try-bar__note{flex:1;margin:0;font-size:13px;color:var(--sys-label-2)}
.try-bar__note strong{color:var(--sys-label)}
.try-bar__btn{display:inline-flex;align-items:center;height:30px;padding:0 12px;border:0;border-radius:15px;background:var(--sys-fill-4);color:var(--sys-accent);font:500 14px var(--font-ui);text-decoration:none;cursor:pointer}
.try-bar__btn:disabled{opacity:.5}
.try-views{grid-area:views;position:relative;min-height:0}
.try-view{position:absolute;inset:0;visibility:hidden}
body[data-view="home"] .try-view--home,body[data-view="reader"] .try-view--reader{visibility:visible}
.try-page .ipad-stage{height:100%;padding:0;background:none}
.try-page .ipad{width:100%;height:100%;min-height:0;border-radius:0;box-shadow:none}
/* Loading: Home's shell is shown at once; a small status sits in the demo bar until the core is ready */
.try-loading{display:inline-flex;align-items:center;gap:8px;font-size:13px;color:var(--sys-label-2)}
body:not([data-state]) .try-views{pointer-events:none}
.try-loading[hidden],.try-failed[hidden],.try-tips[hidden]{display:none}
.try-spinner{width:22px;height:22px;border-radius:50%;border:2.5px solid var(--sys-fill-3);border-top-color:var(--sys-accent);animation:try-spin .8s linear infinite}
@keyframes try-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.try-spinner{animation:none}}
.try-failed{position:fixed;inset:44px 0 0;z-index:71;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;text-align:center;background:var(--sys-bg)}
.try-failed h1{font:600 22px var(--font-ui);margin:0 0 8px}
.try-failed a{color:var(--sys-accent)}
/* Try this: part of the layout, never over the app. Wide screens: a column beside the app.
   Narrower screens: a band between the demo bar and the app, scrolling within 40% of the height. */
.try-tips{grid-area:tips;min-height:0;overflow:auto;max-height:40dvh;padding:10px 16px 12px;background:var(--sys-bg-2);border-bottom:.5px solid var(--sys-separator)}
.try-tips__head{display:flex;align-items:center;justify-content:space-between}
.try-tips__head h2{margin:0;font:600 17px var(--font-ui)}
.try-tips .ios-round{width:32px;height:32px}
.try-tips ol{margin:6px 0 0;padding-left:20px;font-size:14px;line-height:1.4;columns:2 300px;column-gap:28px}
.try-tips li{margin:0 0 6px;break-inside:avoid}
.try-tips strong{display:block}
@media (min-width:1180px){
  body.try-page{grid-template-rows:auto minmax(0,1fr);grid-template-areas:"bar bar" "views tips"}
  .try-tips{width:300px;max-height:none;border-bottom:0;border-left:.5px solid var(--sys-separator)}
  .try-tips ol{columns:auto}
}
.try-bar__btn[aria-expanded="true"]{background:var(--sys-accent);color:#fff}
/* Phone width: the app's own compact layout (one pane, Read | Paper); the demo bar keeps only its buttons */
@media (max-width:699px){
  .try-bar{padding:4px 8px;gap:6px}
  .try-bar__note{display:none}
  .try-bar__btn{height:28px;padding:0 10px;font-size:13px}
  .try-tips{max-height:34dvh}
}

.try-loading .try-spinner{width:14px;height:14px;border-width:2px}

/* Bug fixes: Home (demo chrome) */
/* PB-19: on a landscape phone Try this starts collapsed (home.js closes it before the demo is ready); hidden while
   loading so it never flashes open over half the height */
@media (orientation:landscape) and (max-height:500px){body.try-page:not([data-state]) .try-tips{display:none}}
/* PB-20: a step can carry wording for the one-pane phone layout */
.try-tip-phone{display:none}
@media (max-width:699px){.try-tip-wide{display:none}.try-tip-phone{display:inline}}
/* The classic demo (since 18 Nov 2026 /try is the new interface): a quiet link back in the demo bar */
.try-bar__link{color:var(--sys-accent);text-decoration:none;white-space:nowrap}
.try-bar__link:hover{text-decoration:underline}
