/* Product-scene mobile treatment: one readable product surface per chapter. */
@media (max-width: 760px) {
  .ys-story .ys-product-stage {
    min-width: 0;
    margin: 20px 0 0;
  }

  .ys-story .ypm-wrap {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 9px;
    overflow: visible;
    color: var(--yn-ink, #193645);
  }

  /* Secondary view controls sit directly above the product UI. */
  .ys-story .ypm-wrap > .ypm-tabs {
    order: 0;
    display: flex;
    flex: 0 0 auto;
    gap: 5px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 1px 3px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .ys-story .ypm-tabs button {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    min-width: max-content;
    min-height: 46px;
    padding: 8px 9px 9px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--yn-muted, #62747b);
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .ys-story .ypm-tabs .yn-icon {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 0;
  }

  .ys-story .ypm-tabs button[aria-selected="true"] {
    border-bottom-color: var(--yn-accent, #e59169);
    color: var(--yn-ink, #193645);
  }

  .ys-story .ypm-tabs button i {
    display: none;
  }

  .ys-story .ypm-wrap > .ypm {
    order: 1;
    flex: 0 0 auto;
    position: relative;
    height: auto;
    min-height: 380px;
    overflow: visible;
    isolation: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--yn-ink, #193645);
  }

  .ys-story .ypm-view,
  .ys-story .ypm-view:not([hidden]),
  .ys-story .ypm-answer .ypm-view:not([hidden]),
  .ys-story .ypm-source .ypm-view:not([hidden]),
  .ys-story .ypm-action .ypm-view:not([hidden]) {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 0;
    padding: 0;
    animation: none;
  }

  .ys-story .ypm-view[hidden] {
    display: none !important;
  }

  /* Shared chrome and conversation typography. */
  .ys-story .ypm-workspace {
    position: relative;
    inset: auto;
    display: flex;
    width: 100%;
    min-height: 380px;
    height: auto;
    flex-direction: column;
    margin: 0;
    overflow: visible;
    border: 1px solid var(--yn-line, #dae2e1);
    border-radius: 7px;
    background: var(--yn-white, #fff);
    box-shadow: 0 2px 10px #1936450a;
  }

  .ys-story .ypm-channel {
    flex: 0 0 auto;
    height: 42px;
    gap: 8px;
    padding: 0 15px;
    border-bottom: 1px solid var(--yn-line, #dae2e1);
    background: var(--yn-paper, #faf9f5);
    color: var(--yn-muted, #62747b);
    font-size: 12px;
  }

  .ys-story .ypm-channel > span {
    font-size: 17px;
  }

  .ys-story .ypm-channel strong {
    min-width: 0;
    overflow: hidden;
    color: var(--yn-ink, #193645);
    font-size: 13px;
    text-overflow: ellipsis;
  }

  .ys-story .ypm-channel > small {
    margin-left: auto;
    padding-left: 8px;
    color: var(--yn-muted, #62747b);
    font-size: 10px;
  }

  .ys-story .ypm-workspace-body {
    width: 100%;
    max-width: none;
    padding: 17px 16px 19px;
  }

  .ys-story .ypm-message + .ypm-message {
    margin-top: 17px;
  }

  .ys-story .ypm-author {
    align-items: center;
    gap: 9px;
  }

  .ys-story .ypm-author > :is(.ypm-app-mark, .ypm-avatar) {
    flex: 0 0 29px;
    width: 29px;
    height: 29px;
  }

  .ys-story .ypm-author > div {
    flex-wrap: wrap;
    gap: 4px 7px;
    padding-top: 0;
    font-size: 13px;
    line-height: 1.4;
  }

  .ys-story .ypm-author > div > span {
    padding: 1px 4px;
    border-radius: 2px;
    background: var(--yn-paper, #faf9f5);
    color: var(--yn-muted, #62747b);
    font-size: 9px;
    line-height: 1.35;
  }

  .ys-story .ypm-message-body,
  .ys-story .ypm-team-thread .ypm-message-body {
    max-width: none;
    margin: -8px 0 0 38px;
    padding: 0;
    color: var(--yn-ink, #193645);
    font-size: 14px;
    line-height: 1.7;
  }

  .ys-story .ypm-message-body h4 {
    margin-bottom: 6px;
    color: var(--yn-ink, #193645);
    font-size: 14px;
    line-height: 1.5;
  }

  .ys-story .ypm-message-body h4:not(:first-child) {
    margin-top: 13px;
  }

  .ys-story .ypm-message-body p,
  .ys-story .ypm-team-thread .ypm-message-body p {
    color: var(--yn-ink, #193645);
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
  }

  .ys-story .ypm-message-body p + p {
    margin-top: 9px;
  }

  .ys-story .ypm-message-body .ypm-question {
    margin: 7px 0 9px;
    font-size: 15px;
    line-height: 1.65;
  }

  .ys-story .ypm-message-body blockquote {
    margin: 10px 0 14px;
    padding: 9px 12px;
    border-left: 2px solid var(--yn-accent, #e59169);
    background: transparent;
    color: var(--yn-ink, #193645);
    font-size: 14px;
    line-height: 1.7;
  }

  .ys-story .ypm-message-body mark,
  .ys-story .ypm-message-body em {
    border: 0;
    border-radius: 2px;
    background: var(--yn-accent-soft, #f7e6dc);
    color: var(--yn-accent-ink, #91543b);
    padding: 0 2px;
  }

  .ys-story .ypm-case-question {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    max-width: none;
    margin: 0 0 14px;
    padding: 0 0 13px;
    border-bottom: 1px solid var(--yn-line, #dae2e1);
    color: var(--yn-ink, #193645);
    font-size: 14px;
    line-height: 1.6;
  }

  .ys-story .ypm-case-question > .ypm-avatar {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
  }

  .ys-story .ypm-attachment {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 54px;
    gap: 9px;
    margin: 11px 0 0;
    padding: 9px 11px;
    border: 1px solid var(--yn-line, #dae2e1);
    border-radius: 5px;
    background: var(--yn-white, #fff);
    color: var(--yn-ink, #193645);
    text-align: left;
  }

  .ys-story .ypm-attachment > .yn-file-mark {
    flex: 0 0 24px;
    width: 24px;
    height: 28px;
  }

  .ys-story .ypm-attachment > span {
    min-width: 0;
  }

  .ys-story .ypm-attachment strong {
    font-size: 13px;
    line-height: 1.4;
  }

  .ys-story .ypm-attachment small {
    margin-top: 2px;
    color: var(--yn-muted, #62747b);
    font-size: 11px;
    line-height: 1.4;
  }

  .ys-story .ypm-attachment > svg:last-child {
    display: block;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    color: var(--yn-muted, #62747b);
  }

  .ys-story .ypm-next-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 9px;
    color: var(--yn-muted, #62747b);
    font-size: 12px;
    line-height: 1.5;
  }

  .ys-story .ypm-gap-note {
    gap: 10px;
    max-width: none;
    margin: 14px 0 12px;
  }

  .ys-story .ypm-gap-note > i {
    width: 2px;
    border-radius: 0;
    background: var(--yn-accent, #e59169);
  }

  .ys-story .ypm-gap-note strong {
    color: var(--yn-ink, #193645);
    font-size: 14px;
    line-height: 1.5;
  }

  .ys-story .ypm-gap-note p {
    margin-top: 4px;
    color: var(--yn-muted, #62747b);
    font-size: 13px;
    line-height: 1.6;
  }

  .ys-story .ypm-answer-primary,
  .ys-story .ypm-message-body .ypm-answer-primary {
    max-width: none;
    color: var(--yn-ink, #193645);
    font-size: 15px;
    line-height: 1.7;
  }

  .ys-story .ypm-answer-footer {
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
    padding-top: 11px;
    color: var(--yn-muted, #62747b);
    font-size: 12px;
    line-height: 1.55;
  }

  /* Evidence: a clean document-review surface, without a nested phone bezel. */
  .ys-story .ypm-review-device {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: none;
    min-height: 380px;
    height: auto;
    margin: 0;
    padding: 0;
    transform: none;
    overflow: visible;
    border: 1px solid var(--yn-line, #dae2e1);
    border-radius: 7px;
    background: var(--yn-white, #fff);
    box-shadow: 0 2px 10px #1936450a;
  }

  .ys-story .ypm-device-context {
    height: auto;
    padding: 15px 16px 13px;
    border-bottom: 1px solid var(--yn-line, #dae2e1);
    overflow: visible;
  }

  .ys-story .ypm-device-title {
    gap: 8px;
    font-size: 14px;
  }

  .ys-story .ypm-device-title .ypm-app-mark {
    flex: 0 0 27px;
    width: 27px;
    height: 27px;
  }

  .ys-story .ypm-device-title small {
    margin-left: auto;
    color: var(--yn-muted, #62747b);
    font-size: 10px;
  }

  .ys-story .ypm-device-context > p {
    margin-top: 10px;
    color: var(--yn-ink, #193645);
    font-size: 14px;
    line-height: 1.6;
  }

  .ys-story .ypm-review-divider {
    gap: 8px;
    margin: 0;
    padding: 11px 16px;
    border-bottom: 1px solid var(--yn-line, #dae2e1);
    background: var(--yn-paper, #faf9f5);
    color: var(--yn-muted, #62747b);
    font-size: 11px;
    line-height: 1.4;
  }

  .ys-story .ypm-review-divider::before,
  .ys-story .ypm-review-divider::after {
    display: none;
  }

  .ys-story .ypm-review-list {
    padding: 2px 16px 0;
  }

  .ys-story .ypm-review-list::before {
    display: none;
  }

  .ys-story .ypm-review-row {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 48px;
    height: auto;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--yn-line, #dae2e1);
    color: var(--yn-ink, #193645);
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
  }

  .ys-story button.ypm-review-row {
    border-inline: 0;
    border-top: 0;
    background: transparent;
    font: 500 13px/1.45 var(--body, Arial, sans-serif);
    cursor: pointer;
  }

  .ys-story .ypm-review-row > span {
    flex: 1 1 auto;
    min-width: 0;
    overflow: visible;
    text-overflow: clip;
  }

  .ys-story .ypm-review-row > :is(.yn-icon, .ypm-avatar, .ypm-app-mark) {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    background: var(--yn-white, #fff);
  }

  .ys-story .ypm-review-row > svg:last-child:not(:first-child) {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin-left: 0;
    color: var(--yn-muted, #62747b);
  }

  .ys-story .ypm-review-row.is-capability {
    color: var(--yn-success, #506c57);
  }

  .ys-story .ypm-review-row.is-condition {
    color: var(--yn-muted, #62747b);
  }

  .ys-story .ypm-device-toolbar {
    height: auto;
    margin: 0;
    padding: 12px 16px 14px;
  }

  .ys-story .ypm-device-toolbar > button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    height: auto;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--yn-line, #dae2e1);
    border-radius: 5px;
    background: var(--yn-paper, #faf9f5);
    color: var(--yn-ink, #193645);
    font: 500 13px/1.4 var(--body, Arial, sans-serif);
  }

  .ys-story .ypm-device-toolbar > button .ypm-app-mark {
    flex: 0 0 23px;
    width: 23px;
    height: 23px;
  }

  /* Source details and the follow-up document states share the same measure. */
  .ys-story .ypm-document-meta {
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 12px;
    color: var(--yn-muted, #62747b);
    font-size: 11px;
  }

  .ys-story .ypm-document-meta > span:first-child {
    color: var(--yn-blue, #355f73);
  }

  .ys-story .ypm-source-passage {
    padding: 8px 0 11px;
  }

  .ys-story .ypm-source-passage p {
    margin: 0;
    padding: 9px 10px;
    border-radius: 2px;
    color: var(--yn-ink, #193645);
    font-size: 15px;
    line-height: 1.7;
    overflow-wrap: anywhere;
  }

  .ys-story .ypm-source-passage p + p {
    margin-top: 3px;
  }

  .ys-story .ypm-source-passage .is-emphasized {
    background: var(--yn-surface, #e4edf0);
    color: var(--yn-ink, #193645);
    box-shadow: inset 2px 0 var(--yn-accent, #e59169);
  }

  .ys-story .ypm-source-details {
    margin: 14px 0;
  }

  .ys-story .ypm-source-details > div {
    grid-template-columns: minmax(72px, 0.35fr) minmax(0, 1fr);
    gap: 10px;
    padding: 9px 0;
    border-color: var(--yn-line, #dae2e1);
    font-size: 13px;
    line-height: 1.55;
  }

  .ys-story .ypm-source-details dt {
    color: var(--yn-muted, #62747b);
  }

  .ys-story .ypm-source-details dd {
    min-width: 0;
    color: var(--yn-ink, #193645);
    overflow-wrap: anywhere;
  }

  .ys-story .ypm-fact-verdict {
    margin-top: 4px;
    padding-top: 11px;
    border-top: 1px solid var(--yn-line, #dae2e1);
  }

  .ys-story .ypm-fact-verdict > small {
    color: var(--yn-muted, #62747b);
    font-size: 11px;
    line-height: 1.45;
  }

  .ys-story .ypm-fact-verdict p {
    margin-top: 5px;
    color: var(--yn-ink, #193645);
    font-size: 14px;
    line-height: 1.6;
  }

  .ys-story .ypm-fact-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
    margin-top: 11px;
  }

  .ys-story .ypm-fact-actions > button,
  .ys-story .ypm-fact-actions > a {
    justify-content: flex-start;
    min-height: 44px;
    gap: 8px;
    padding: 8px 4px;
    font-size: 13px;
    line-height: 1.5;
  }

  .ys-story .ypm-fact-actions > a {
    justify-content: center;
    padding-inline: 12px;
  }

  /* The collaboration view uses one clean thread surface, not a floating card. */
  .ys-story .ypm-workflow-label {
    position: static;
    display: block;
    margin: 0 0 8px;
    padding: 0;
    transform: none;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--yn-muted, #62747b);
    font-size: 11px;
    line-height: 1.45;
    white-space: normal;
  }

  .ys-story .ypm-team-thread {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: none;
    min-height: 380px;
    margin: 0;
    padding: 15px 16px 16px;
    transform: none;
    z-index: auto;
    border: 1px solid var(--yn-line, #dae2e1);
    border-radius: 7px;
    background: var(--yn-white, #fff);
    box-shadow: 0 2px 10px #1936450a;
  }

  .ys-story .ypm-thread-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 14px;
    padding: 0 0 11px;
    border-bottom: 1px solid var(--yn-line, #dae2e1);
    color: var(--yn-ink, #193645);
    font-size: 13px;
  }

  .ys-story .ypm-thread-heading > span {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .ys-story .ypm-thread-heading .ypm-app-mark {
    flex: 0 0 25px;
    width: 25px;
    height: 25px;
  }

  .ys-story .ypm-thread-heading small {
    color: var(--yn-muted, #62747b);
    font-size: 10px;
  }

  .ys-story .ypm-team-thread .ypm-avatar,
  .ys-story .ypm-team-thread .ypm-app-mark {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
  }

  .ys-story .ypm-team-thread .ypm-author > div {
    font-size: 13px;
    line-height: 1.4;
  }

  .ys-story .ypm-team-thread .ypm-author > div > span {
    font-size: 9px;
    line-height: 1.35;
  }

  .ys-story .ypm-team-thread .ypm-message + .ypm-message {
    margin-top: 14px;
  }

  .ys-story .ypm-team-thread .ypm-message:last-child {
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid var(--yn-line, #dae2e1);
  }

  .ys-story .ypm-message-body .ypm-final-draft,
  .ys-story .ypm-final-draft {
    padding: 9px 11px;
    border: 0;
    border-left: 2px solid var(--yn-accent, #e59169);
    border-radius: 0;
    background: var(--yn-surface, #e4edf0);
    color: var(--yn-ink, #193645);
    font-size: 14px;
    line-height: 1.65;
    overflow-wrap: anywhere;
  }

  .ys-story .ypm-thread-source {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    margin-top: 4px;
    padding: 6px 0;
    border: 0;
    color: var(--yn-blue, #355f73);
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
  }

  .ys-story .ypm-thread-actions {
    align-items: center;
    gap: 8px 10px;
    margin-top: 9px;
  }

  .ys-story .ypm-thread-actions .ypm-copy-button,
  .ys-story .ypm-copy-button {
    min-height: 44px;
    gap: 7px;
    padding: 8px 11px;
    border: 1px solid var(--yn-ink, #193645);
    border-radius: 4px;
    background: var(--yn-ink, #193645);
    color: var(--yn-white, #fff);
    font-size: 13px;
    line-height: 1.4;
  }

  .ys-story .ypm-thread-actions > span {
    border: 0;
    padding: 0;
    color: var(--yn-muted, #62747b);
    font-size: 11px;
  }

  .ys-story .ypm-draft-actions {
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-top: 12px;
  }

  .ys-story .ypm-draft-actions > span {
    color: var(--yn-muted, #62747b);
    font-size: 11px;
  }

  .ys-story .ypm-suggestion,
  .ys-story .ypm-message-body .ypm-suggestion {
    margin-top: 10px;
    padding: 10px 12px;
    border: 0;
    border-left: 2px solid var(--yn-accent, #e59169);
    border-radius: 0;
    background: var(--yn-surface, #e4edf0);
    color: var(--yn-ink, #193645);
    font-size: 15px;
    line-height: 1.7;
  }

  .ys-story .ypm-draft-comment {
    align-items: flex-start;
    gap: 8px;
    margin: 13px 0 8px;
  }

  .ys-story .ypm-draft-comment > .ypm-avatar {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
  }

  .ys-story .ypm-draft-comment p {
    color: var(--yn-muted, #62747b);
    font-size: 12px;
    line-height: 1.55;
  }

  .ys-story .ypm-evidence-receipt {
    align-items: center;
    gap: 7px;
    margin: 0 0 10px;
    padding: 7px 9px;
    border: 1px solid var(--yn-line, #dae2e1);
    border-radius: 4px;
    background: var(--yn-paper, #faf9f5);
    color: var(--yn-ink, #193645);
    font-size: 12px;
    line-height: 1.45;
  }

  .ys-story .ypm-evidence-receipt > .ypm-app-mark {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
  }

  .ys-story .ypm-evidence-receipt button {
    min-height: 40px;
    margin-left: auto;
    color: var(--yn-blue, #355f73);
    font-size: 12px;
  }

  .ys-story .ypm-faq-preview {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 380px;
    height: auto;
    margin: 0;
    overflow: visible;
    border: 1px solid var(--yn-line, #dae2e1);
    border-radius: 7px;
    background: var(--yn-white, #fff);
    box-shadow: 0 2px 10px #1936450a;
  }

  .ys-story .ypm-faq-top {
    min-height: 46px;
    height: auto;
    gap: 8px;
    padding: 8px 15px;
    border-bottom: 1px solid var(--yn-line, #dae2e1);
    color: var(--yn-ink, #193645);
    font-size: 12px;
  }

  .ys-story .ypm-faq-top strong span {
    display: inline;
    margin-left: 4px;
    color: var(--yn-muted, #62747b);
    font-size: 11px;
  }

  .ys-story .ypm-faq-top > span {
    color: var(--yn-muted, #62747b);
    font-size: 11px;
  }

  .ys-story .ypm-faq-main {
    width: 100%;
    max-width: 620px;
    padding: 23px 19px 21px;
  }

  .ys-story .ypm-faq-main > small {
    color: var(--yn-muted, #62747b);
    font-size: 11px;
  }

  .ys-story .ypm-faq-main h4 {
    margin-top: 10px;
    color: var(--yn-ink, #193645);
    font-size: 18px;
    line-height: 1.5;
  }

  .ys-story .ypm-faq-main p {
    margin-top: 15px;
    color: var(--yn-ink, #193645);
    font-size: 15px;
    line-height: 1.75;
  }

  .ys-story .ypm-faq-source {
    margin: 17px 0 14px;
    color: var(--yn-muted, #62747b);
    font-size: 12px;
    line-height: 1.5;
  }

  .ys-story .ypm-source[data-view="scan"] {
    min-height: 0;
    height: auto;
  }

  .ys-story .ypm-source[data-view="scan"] > .ypm-view:not([hidden]) {
    position: relative;
    padding: 0;
  }

  .ys-story .ys-copy-status {
    order: 2;
    min-height: 18px;
    color: var(--yn-muted, #62747b);
    font-size: 12px;
    line-height: 1.5;
  }
}
