/* SMAU FILE
 * Path: css/smau-help.css
 * Owns: the help layer's one surface (js/smau.helpOverlay.js) — the panel that
 * names what is on the screen you are looking at and shows the wiki paragraph
 * behind each item.
 *
 * It sits above everything, including Creator Studio, because it is help ABOUT
 * whatever is in front of you. It is never modal: no focus trap, no inert on
 * the rest of the page, and a tap anywhere outside the card dismisses it.
 *
 * Class selectors only — the surface is built at runtime, so an id-anchored
 * rule here would be a rule aimed at nothing until first open.
 */

.smau-help {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  font-family: var(--smau-font-sans, system-ui, sans-serif);
}
.smau-help[data-state="open"] { display: block; }

/* HELP ABOUT THE PHONE OPENS INSIDE THE PHONE. The panel is parented into
   .smau-phone-inner (js/smau.helpOverlay.js `reparent`), so it must scroll and
   size against the phone rather than the viewport — `fixed` would escape the
   screen it belongs to, and `vh` would measure the browser window instead of
   the device. */
.smau-help[data-host="phone"] {
  position: absolute;
}

.smau-help[data-host="phone"] .smau-help-card {
  max-height: 78%;          /* of the phone screen, not of the window */
  width: 100%;
  border-radius: 22px 22px 0 0;
}

.smau-help-scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 12, 0.52);
  backdrop-filter: blur(2px);
}

.smau-help-card {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 430px);
  max-height: min(78vh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: 22px 22px 0 0;
  background: rgba(18, 21, 30, 0.985);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: none;
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.6);
  color: #f2f4f8;
  overflow: hidden;
  animation: smauHelpIn 200ms ease-out;
}
@keyframes smauHelpIn {
  from { transform: translateX(-50%) translateY(18px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .smau-help-card { animation: none; }
}

/* ── CREATOR STUDIO IS NOT A PHONE, SO HELP IS NOT A SHEET ────────────────
   `data-host="page"` is Creator Studio, where the surface you are looking at
   is a full desktop window. A bottom sheet 430px wide, pinned to the middle
   of the bottom edge, is the shape of a thumb reaching a handset — on a
   desktop it covered the timeline it was explaining, wasted the whole right
   half of the screen, and let five lines of guide text show at a time.

   So on the page it docks: full height down the right edge, its own scroll,
   and the workspace beside it stays readable while you read about it. Nothing
   about dismissing it changes — the scrim, the ×, Escape and ? all still do
   exactly what they did, because the panel moved, it did not become modal. */
.smau-help[data-host="page"] .smau-help-card {
  left: auto;
  right: 0;
  top: 0;
  bottom: 0;
  transform: none;
  width: min(100%, 410px);
  max-height: none;
  height: 100%;
  border-radius: 0;
  border-right: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: -18px 0 50px rgba(0, 0, 0, 0.55);
  animation: smauHelpDockIn 200ms ease-out;
}
@keyframes smauHelpDockIn {
  from { transform: translateX(22px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .smau-help[data-host="page"] .smau-help-card { animation: none; }
}
/* A docked panel has room to breathe, and the guide is long-form reading. */
.smau-help[data-host="page"] .smau-help-body { padding: 12px 16px 18px; }
.smau-help[data-host="page"] .smau-help-head { padding: 14px 14px 10px; }
/* Narrow windows have no right edge to spare — it goes back to a full sheet
   rather than becoming a column with nothing next to it. */
@media (max-width: 620px) {
  .smau-help[data-host="page"] .smau-help-card { width: 100%; }
}

.smau-help-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.smau-help-title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.smau-help-sub {
  display: block;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.55;
  letter-spacing: 0.02em;
}
.smau-help-iconbtn {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.09);
  color: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.smau-help-iconbtn:hover { background: rgba(255, 255, 255, 0.16); }

.smau-help-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 12px 14px;
}

.smau-help-search {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 10px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font: inherit;
  font-size: 13px;
}
.smau-help-search::placeholder { color: rgba(255, 255, 255, 0.42); }

.smau-help-empty {
  padding: 18px 4px 8px;
  font-size: 13px;
  line-height: 1.55;
  opacity: 0.82;
}
.smau-help-empty strong { display: block; margin-bottom: 6px; font-size: 14px; opacity: 1; }
.smau-help-empty code {
  font-family: var(--smau-font-mono, monospace);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 1px 5px;
}

.smau-help-topic {
  display: block;
  width: 100%;
  text-align: left;
  margin: 0 0 8px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.smau-help-topic:hover { background: rgba(255, 255, 255, 0.09); }
.smau-help-topic-title { display: block; font-size: 14px; font-weight: 700; }
.smau-help-topic-page {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.55;
}
.smau-help-topic-confusing {
  display: block;
  margin-top: 7px;
  padding-left: 9px;
  border-left: 2px solid rgb(var(--os-accent-rgb, 79 140 255) / 0.75);
  font-size: 12.5px;
  line-height: 1.5;
  opacity: 0.95;
}
.smau-help-topic-excerpt {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.68;
}

.smau-help-next {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -2px 0 12px;
  padding-left: 2px;
}
.smau-help-next-label {
  width: 100%;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.45;
}
.smau-help-chip {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 11.5px;
  padding: 4px 10px;
  cursor: pointer;
}
.smau-help-chip:hover { background: rgba(255, 255, 255, 0.1); }

.smau-help-page-title { margin: 2px 0 8px; font-size: 16px; font-weight: 800; }
.smau-help-section { margin: 0 0 14px; }
.smau-help-section-title { margin: 0 0 4px; font-size: 13px; font-weight: 700; opacity: 0.9; }
.smau-help-p { margin: 0 0 8px; font-size: 13px; line-height: 1.6; opacity: 0.86; }
.smau-help-section[data-focus="on"] {
  padding: 8px 10px;
  margin-left: -10px;
  margin-right: -10px;
  border-radius: 12px;
  background: rgb(var(--os-accent-rgb, 79 140 255) / 0.1);
}

.smau-help-ask {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
}

.smau-help-foot {
  padding: 8px 12px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  line-height: 1.45;
  opacity: 0.5;
}

/* Light theme is opt-in in this OS (css/smau-theme.css), so it is spelled out
   rather than inherited from the system scheme. */
:root[data-theme="light"] .smau-help-card {
  background: rgba(250, 250, 252, 0.99);
  border-color: rgba(0, 0, 0, 0.1);
  color: #12141a;
}
:root[data-theme="light"] .smau-help-scrim { background: rgba(20, 24, 34, 0.3); }
:root[data-theme="light"] .smau-help-head,
:root[data-theme="light"] .smau-help-ask,
:root[data-theme="light"] .smau-help-foot { border-color: rgba(0, 0, 0, 0.09); }
:root[data-theme="light"] .smau-help-iconbtn { background: rgba(0, 0, 0, 0.06); }
:root[data-theme="light"] .smau-help-iconbtn:hover { background: rgba(0, 0, 0, 0.12); }
:root[data-theme="light"] .smau-help-topic {
  background: rgba(0, 0, 0, 0.035);
  border-color: rgba(0, 0, 0, 0.1);
}
:root[data-theme="light"] .smau-help-topic:hover { background: rgba(0, 0, 0, 0.07); }
:root[data-theme="light"] .smau-help-search {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
}
:root[data-theme="light"] .smau-help-search::placeholder { color: rgba(0, 0, 0, 0.4); }
:root[data-theme="light"] .smau-help-chip { border-color: rgba(0, 0, 0, 0.18); }
:root[data-theme="light"] .smau-help-chip:hover { background: rgba(0, 0, 0, 0.07); }
:root[data-theme="light"] .smau-help-empty code { background: rgba(0, 0, 0, 0.07); }

/* The docked panel's own edges in the light theme — the base light rules above
   restyle the card, and the dock adds one border and one shadow of its own. */
:root[data-theme="light"] .smau-help[data-host="page"] .smau-help-card {
  border-bottom-color: rgba(0, 0, 0, 0.09);
  box-shadow: -18px 0 50px rgba(20, 24, 34, 0.18);
}
