* { scrollbar-width: none !important; }
::-webkit-scrollbar { display: none !important; width: 0px !important; height: 0px !important; }
.mobile-details-button, .mobile-details-bar, .mobile-post-popup { display: none; }
@media (max-width: 760px) {
  html, body { width: 100%; height: 100%; overflow: hidden; }
  body { padding: 64px 0px 0px !important; }
  main { height: calc(100dvh - 64px); padding: 0px !important; }
  #viewer, #viewer[data-left-view="whiteboard"] { display: block; height: 100%; width: 100%; }
  #viewer[hidden] { display: none; }
  #viewer .post-stage { height: 100%; min-height: 0px; width: 100%; border: 0px; }
  #viewer .post-position { height: 100%; width: 100%; padding: 0px; overflow: hidden auto; }
  #viewer #insights { display: none; }
  .post-browser, .post-step-toolbar, .reading-progress-rail, .annotation-connector, .gist-connector { display: none !important; }
  #feed .feed-item, #feed .feed-item[data-left-view="whiteboard"] { width: 100%; max-width: 100%; min-height: 0px; padding: 28px 20px 34px; }
  #feed .post-reading { width: 100%; max-width: none; gap: 18px; }
  #feed .post-reading-head { width: 100%; display: grid; grid-template-columns: minmax(0px, 1fr) max-content; gap: 0px 10px; align-items: start; }
  #feed .post-profile-trigger-group { display: flex; flex-wrap: nowrap; align-items: center; width: 100%; max-width: 100%; min-width: 0px; gap: 9px; grid-area: 1 / 1 / 3 / 2; }
  #feed .post-avatar-link { flex: 0 0 36px; width: 36px; height: 36px; margin: 0px; }
  #feed .post-avatar-link .avatar { width: 36px; height: 36px; object-fit: cover; border-radius: 3px; }
  #feed .post-author { min-width: 0px; flex: 1 1 auto; padding: 0px; margin: 0px; }
  #feed .post-author-copy { min-width: 0px; max-width: 100%; }
  #feed .post-author-copy strong { font-size: 15px; }
  #feed .post-author-copy > span { font-size: 12px; }
  #feed .post-reading-head .post-actions-likes { display: flex; gap: 4px; align-items: baseline; justify-self: end; transform: none; font-size: 11px; margin: 0px; grid-area: 1 / 2; }
  #feed .post-reading-head .post-actions-likes strong { font-size: 23px; line-height: 1.2; }
  #feed .mobile-post-metadata { display: flex; align-items: center; justify-content: flex-end; gap: 4px; grid-area: 2 / 2; padding-top: 0px; white-space: nowrap; font: 11px / 1.4 system-ui, sans-serif; color: var(--theme-muted,#ceeaff); }
  #feed .mobile-post-metadata .post-view-on-x { color: inherit; text-decoration: none; }
  #feed .mobile-post-metadata .post-info-dot { display: inline; }
  #feed .mobile-post-metadata .post-inline-date { font: inherit; color: inherit; }
  #feed .post-info-row { display: flex; grid-area: 3 / 1 / 4 / 3; flex-wrap: nowrap; justify-content: space-between; gap: 6px; margin: 8px 0px 0px; font-size: 12px; color: var(--theme-text,#fff); }
  #feed .post-info-row button { color: inherit; padding: 5px 0px; font-size: 12px; min-height: 30px; white-space: nowrap; }
  body[data-feed-layout="panels"] #feed .post-reading .post-info-row { width: 100%; }
  #feed .post-info-row .post-info-dot { display: none; }
  #feed .mobile-details-button { display: inline-block; margin: 0px; }
  #feed :is(.scribble-text, .post-text, .teen-post-text) { letter-spacing: -0.015em; overflow-wrap: anywhere; font-size: 21px !important; line-height: 1.5 !important; }
  #feed .scribble-line, #feed .feed-item[data-left-view="whiteboard"] .scribble-line { grid-template-areas: "main" "left" "right"; grid-template-columns: minmax(0px, 1fr); gap: 19px; margin-bottom: 1em; }
  #feed .scribble-line.is-plain { margin-bottom: 0.4em; }
  #feed :is(.scribble-left, .scribble-right) { gap: 13px; }
  #feed .scribble-note, #feed .feed-item[data-left-view="whiteboard"] .scribble-note { margin: 0px 0px 0px 22px; max-width: 34ch; font-size: 17px; line-height: 1.35; }
  #feed .scribble-main { line-height: 1.5; }
  #feed .post-thread-top { flex-wrap: wrap; }
  #feed .post-thread-arrow { width: 32px; height: 32px; }
  #feed .post-thread-band { padding: 10px 0px; }
  #feed .post-design-actions { gap: 4px; }
  #feed .post-design-actions button { font-size: 12px; padding: 9px 7px; }
  #feed :is(.card, .media, img, video, iframe) { max-width: 100%; }
  .folder-bar { height: 64px; padding: 8px 10px; gap: 8px; }
  .category-controls { gap: 0px; min-width: 0px; }
  .category-caption { display: none; }
  .category-buttons { min-width: 0px; }
  .category-root { min-height: 36px; max-width: 100%; padding: 8px; font-size: 12px; }
  #collection-calendar-toggle { min-height: 36px; padding: 7px 8px; font-size: 12px; white-space: nowrap; }
  #collection-calendar-toggle > span { display: none; }
  .folder-bar .settings-toggle { width: 36px; flex: 0 0 36px; height: 36px; }
  .category-panel, #collection-calendar-panel, .theme-control .theme-picker { position: fixed; top: 64px; left: 10px; right: 10px; width: auto; max-width: none; max-height: calc(100dvh - 80px); overflow-y: auto; }
  .theme-control:not(.is-open) .theme-picker { display: none; }
  #bottom-settings.is-open { height: auto; max-height: calc(100dvh - 76px); overflow: auto; padding: 14px 12px max(14px,env(safe-area-inset-bottom)); }
  #bottom-settings .filterbar { height: auto; width: 100%; flex-wrap: wrap; gap: 8px; overflow: visible; white-space: normal; }
  #bottom-settings :is(#common-filters, #advanced-filters, .tabs) { flex: 1 1 100%; min-width: 0px; max-width: 100%; flex-wrap: wrap; gap: 6px; }
  #bottom-settings .filter-divider { display: none; }
  #feed-layout-switch, #second-screen, #fullscreen { display: none !important; }
  #bottom-settings .x-source-form { padding: 10px 0px 0px; flex-wrap: wrap; }
  #bottom-settings .x-source-form input { width: 100%; min-width: 0px; flex: 1 1 100%; }
  .mobile-details-bar:not([hidden]) { position: fixed; z-index: 12; inset: 0px 0px auto; height: 64px; display: flex; gap: 14px; align-items: center; padding: 8px 16px; background: var(--blue-deep); border-bottom: 1px solid var(--blue-line); color: var(--theme-text,#fff); }
  .mobile-back { flex: 0 0 auto; min-height: 40px; padding: 8px 10px; border: 1px solid var(--blue-line); border-radius: 5px; background: var(--button-hover); color: inherit; font: 550 14px / 1.4 system-ui, sans-serif; }
  .mobile-details-bar > div { display: flex; flex-direction: column; gap: 2px; min-width: 0px; }
  .mobile-details-bar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
  .mobile-details-bar span { font-size: 12px; color: var(--theme-muted,#ceeaff); }
  body.mobile-details .folder-bar, body.mobile-details .post-stage { visibility: hidden; pointer-events: none; }
  body.mobile-details #viewer #insights { display: block; position: fixed; inset: 64px 0px 0px; height: calc(100dvh - 64px); width: 100%; padding: 22px 20px max(32px,env(safe-area-inset-bottom)); overflow: hidden auto; overscroll-behavior: contain; }
  #insights * { min-width: 0px; }
  #insights .exploration-overview { padding: 0px 0px 24px; }
  #insights .exploration-overview > h2 { font-size: 30px; line-height: 1.14; max-width: none; }
  #insights :is(.questions-section-heading, .exploration-videos > h2, .exploration-resources > h2, .world-context-head h2, .attachment-heading) { font-size: 27px; line-height: 1.2; }
  #insights :is(.exploration-question-grid, .exploration-resource-grid) { grid-template-columns: minmax(0px, 1fr); gap: 16px; }
  #insights .exploration-question > summary { font-size: 17px; line-height: 1.4; padding: 14px; }
  #insights .exploration-answer { font-size: 16px; line-height: 1.55; padding: 0px 14px 16px; overflow-wrap: anywhere; }
  #insights :is(img, video, iframe) { max-width: 100%; }
  #insights .insight-video-player:not(.is-cinema) { width: 100%; height: auto; max-height: none; aspect-ratio: 16 / 9; }
  #insights #discussion-host .insight-video-player .insight-video-controls { opacity: 1; visibility: visible; pointer-events: auto; gap: 5px; }
  #insights .insight-video-controls :is(.insight-video-size, .insight-video-mini) { display: none; }
  body.mobile-details #bottom-settings, body > .insight-video-player.is-reading-float, body > .insight-video-player.is-post-expanded { display: none !important; }
  .youtube-reading-tools { display: none !important; }
  #insights .source-viewer { height: auto; min-height: 0px; }
  #insights .source-viewer iframe { height: 440px; }
  #insights .source-viewer-bar { flex-wrap: wrap; height: auto; padding: 10px 8px; gap: 8px; }
  #insights .source-viewer-name { max-width: none; flex: 1 1 55%; }
  #insights .source-viewer-head .source-summary { max-height: none; font-size: 14px; line-height: 1.5; height: auto !important; }
  #insights .source-preview { padding: 18px; }
  #insights .source-preview-head h3 { font-size: 20px; }
  #insights .world-context-tree { font-size: 15px; overflow-wrap: anywhere; }
  #insights .world-context-tree ul { margin-left: 0px; padding-left: 15px; }
  #insights .world-context-tree li { min-width: 0px; }
  #insights .world-context-tree :is(.world-context-node, .world-context-label, .world-context-description) { max-width: 100%; white-space: normal; font-size: 15px; line-height: 1.45; }
  .mobile-post-popup[open] { display: flex; flex-direction: column; width: calc(-36px + 100vw); max-width: 420px; max-height: 68dvh; margin: auto; padding: 20px; border: 1px solid var(--blue-line); border-radius: 10px; background: var(--blue-panel,var(--blue-page)); color: var(--theme-text,#fff); box-shadow: rgba(0, 0, 0, 0.333) 0px 18px 60px; overflow: hidden; }
  .mobile-post-popup::backdrop { background: rgba(0, 0, 0, 0.4); }
  .mobile-post-popup header { display: flex; align-items: flex-start; gap: 14px; justify-content: space-between; flex: 0 0 auto; margin-bottom: 16px; }
  .mobile-post-popup header > div { min-width: 0px; }
  .mobile-post-popup h2 { font-size: 18px; line-height: 1.35; margin: 0px; font-weight: 650; }
  .mobile-post-popup .mobile-popup-author { font-size: 13px; color: var(--theme-muted,#ceeaff); margin: 5px 0px 0px; }
  .mobile-post-popup header button { flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px; margin: -6px -6px 0px 0px; border: 0px; border-radius: 4px; background: var(--button-hover); color: inherit; font: 24px / 1 system-ui, sans-serif; cursor: pointer; }
  .mobile-popup-body { min-height: 0px; overflow: auto; overscroll-behavior: contain; font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-line; }
  .mobile-popup-body p { margin: 0px 0px 1em; }
  .mobile-popup-body p:last-child { margin-bottom: 0px; }
  .mobile-popup-body ul { margin: 0px; padding-left: 20px; white-space: normal; }
  .mobile-popup-body li + li { margin-top: 12px; }
  .mobile-details-button:focus-visible, .mobile-back:focus-visible, .mobile-post-popup :focus-visible { outline: 2px solid var(--theme-accent-text,var(--sky)); outline-offset: 3px; }
}
/* Original attachments are available in the mobile feed before the post text. */
.mobile-feed-attachments, .mobile-attached-links { display:none; }
@media (max-width:760px) {
  #feed .mobile-feed-attachments { display:grid; gap:12px; width:100%; min-width:0; margin:0 0 22px; }
  #feed .post-reading-content > .media { display:none; }
  #feed .mobile-media-strip { display:flex; gap:12px; width:100%; min-width:0; overflow-x:auto; overflow-y:hidden; overscroll-behavior-x:contain; scroll-snap-type:x proximity; align-items:flex-start; }
  #feed .mobile-media-strip > * { flex:0 0 calc(100% - 24px); width:calc(100% - 24px); max-width:none; height:auto; min-width:0; scroll-snap-align:start; object-fit:contain; background:transparent; border:1px solid #3a3a3a; border-radius:5px; }
  #feed .mobile-media-strip > :only-child { flex-basis:100%; width:100%; }
  #feed .mobile-media-strip > a { display:grid; place-items:center; }
  #feed .mobile-media-strip > a > img { display:block; width:100%; height:auto; object-fit:contain; background:transparent; border:0; }
  #feed .mobile-video-player video { width:100%; height:auto; max-height:none; flex:0 0 auto; background:transparent; border:0; }
  #feed .mobile-video-controls { background:transparent; color:var(--theme-text,#fff); }
  #feed .mobile-video-controls button { color:inherit; }
  #feed .mobile-video-controls input { accent-color:var(--theme-text,#fff); }
  #feed .mobile-attached-links { width:100%; min-width:0; display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; font:13px/1.5 system-ui,sans-serif; }
  #feed .mobile-attached-links a { color:var(--theme-text,#fff); text-decoration:underline; text-underline-offset:3px; overflow-wrap:anywhere; }
}

/* Mobile topic hierarchy remains informational across pointer and focus states. */
@media (max-width:760px) {
  #insights .world-context-tree { user-select:none; -webkit-user-select:none; }
  #insights .world-context-tree ul { border-left:1px solid var(--theme-line,var(--blue-line))!important; padding-left:15px!important; }
  #insights .world-context-tree ul > .world-context-node::before { width:15px!important; border-top:1px solid var(--theme-line,var(--blue-line))!important; }
  #insights .world-context-tree .world-context-box { border:1px solid color-mix(in srgb,var(--theme-text,#fff) 16%,transparent)!important; padding:5px 10px!important; background:rgba(0,0,0,.08)!important; color:var(--theme-muted,#ceeaff)!important; box-shadow:none!important; outline:none!important; }
  #insights .world-context-tree .world-context-label { color:var(--theme-muted,#ceeaff)!important; }
  #insights .world-context-tree .world-context-node:is(.is-path,.is-current) > .world-context-box > .world-context-label,
  #insights .world-context-tree .world-context-description { color:var(--theme-text,#fff)!important; }
}

@media(max-width:760px){#insights .source-viewer--summary{height:auto;min-height:0}#insights .source-viewer--summary .source-viewer-head{flex:0 0 auto}}

/* Deliberately small controls; no native casting or playback-speed menu. */
@media(max-width:760px) {
  .mobile-video-player { position:relative; display:flex; flex-direction:column; overflow:hidden; background:#000; color:#fff; border-radius:5px; }
  .mobile-video-player video { display:block; width:100%; height:calc(100% - 38px); min-height:0; object-fit:contain; background:#000; }
  .mobile-video-controls { display:flex; align-items:center; gap:7px; height:38px; padding:0 8px; flex:0 0 38px; background:#101010; font:11px/1 system-ui,sans-serif; }
  .mobile-video-controls button { display:grid; place-items:center; min-width:28px; height:32px; padding:0 2px; border:0; background:transparent; color:#fff; font:inherit; cursor:pointer; }
  .mobile-video-controls input { flex:1 1 0; width:0; min-width:0; height:26px; margin:0; accent-color:#fff; }
  .mobile-video-time { font-variant-numeric:tabular-nums; }
  .mobile-video-player.is-mobile-mini { position:fixed; z-index:10000; right:10px; top:74px; width:min(250px,65vw); height:180px; box-shadow:0 4px 24px #0008; }
  .mobile-video-close { position:absolute; right:4px; top:4px; width:30px; height:30px; border:0; border-radius:50%; background:#000b; color:#fff; font:24px/1 system-ui,sans-serif; }
  .mobile-video-close[hidden] { display:none; }
  #feed .mobile-video-slot { background:transparent; }
}
