/* Responsive ownership presentation; existing asset commands stay available. */
@media(max-width:600px){
[data-testid="home-story-overview"]{
  & div:has(>button[aria-label="Ask KAI about this asset"]){padding:8px 12px!important;gap:4px!important;flex-wrap:nowrap!important;justify-content:space-between!important;align-items:center!important}
  & button[aria-label="Ask KAI about this asset"]{height:44px!important;min-height:44px!important;padding:0 10px!important;gap:5px!important;border-radius:14px!important;flex-shrink:0!important}
  & button[aria-label="Ask KAI about this asset"]>div:first-child{zoom:.53}
  & button[aria-label="Ask KAI about this asset"]>div:last-child{font-size:14px!important;line-height:20px!important}
  & div:has(>button[aria-label="Ask KAI about this asset"])>button:not(:first-child){min-height:44px!important;padding:0 3px!important;gap:3px!important;flex-shrink:1!important}
  & div:has(>button[aria-label="Ask KAI about this asset"])>button:not(:first-child)>div:first-child{font-size:12px!important;white-space:nowrap!important}
  & div:has(>button[aria-label="Ask KAI about this asset"])>button:not(:first-child)>div:last-child{font-size:14px!important}
  & div:has(>button[aria-label="Back"]):has(button[aria-label="Legacy Story"]){height:48px!important;padding:0 14px!important}
  & [data-testid="asset-hero"] h1{font-size:26px!important;line-height:32px!important}
  & [data-testid="asset-hero"]>div:last-child{margin:0!important;padding:8px 16px!important;border-width:0!important;border-radius:0!important;min-height:60px!important}
  & div:has(>button[aria-label="System records"])>button{padding-top:10px!important;padding-bottom:10px!important;gap:2px!important}
  & div:has(>button[aria-label="System records"])>button>div:nth-child(2){font-size:20px!important}

}
}

@media(max-width:600px){body:has([data-testid="home-story-overview"]) div:has(>div>button[aria-label="Ask KAI"]){position:fixed!important;top:0!important;right:52px!important;width:44px!important;height:44px!important;z-index:100!important}body:has([data-testid="home-story-overview"]) button[aria-label="Ask KAI"]{zoom:.59}}
@media(max-width:600px){
[data-testid="asset-attachments"]{
 & [data-testid="attachment-filters"]{padding-left:16px!important;padding-right:16px!important;gap:6px!important}
 & [data-testid="attachment-filters"]>div:has(input){flex-basis:100%!important;min-width:100%!important;margin-bottom:4px!important}
 & input{min-height:44px!important;font-size:14px!important}
 & [data-testid="attachment-tabs"]{padding:0 16px!important;flex-wrap:wrap!important;gap:6px!important}
 & [data-testid="attachment-tabs"]>div,& [data-testid="attachment-tabs"]>button{margin:0!important;padding:8px 10px!important;min-height:40px!important}
 & [data-testid="attachment-sources"]{padding:0 16px!important;gap:6px!important;flex-wrap:nowrap!important}
 & [data-testid="attachment-sources"]>div,& [data-testid="attachment-sources"]>button{padding:8px 10px!important;min-height:40px!important}
 & [data-testid="attachment-mobile"]{width:100%!important}
 & [data-testid="attachment-list-pane"]{height:auto!important;min-height:300px!important}
 & [data-testid="attachment-list-pane"]>div{flex:0 0 auto!important;padding:12px!important}
 & [data-testid="attachment-list-pane"]>div>div:last-child{max-height:none!important;flex:0 0 auto!important;overflow:visible!important}
 & [data-testid="attachment-details-empty"]{display:none!important}
 & [data-testid="attachment-mobile-row"]{flex-direction:column!important;align-items:stretch!important;padding:12px!important;gap:10px!important}
 & [data-testid="attachment-mobile-row"]>div:first-child{width:100%!important;min-width:0!important;padding-right:0!important}
 & [data-testid="attachment-mobile-row"]>div:first-child>div:last-child{min-width:0!important;flex:1!important}
 & [data-testid="attachment-mobile-row"]>div:first-child>div:last-child>div:first-child{font-size:15px!important;line-height:21px!important;max-width:100%!important;white-space:normal!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:3!important}
 & [data-testid="attachment-mobile-row"]>div:last-child{flex-wrap:wrap!important;gap:4px!important;justify-content:flex-end!important}
 & [data-testid="attachment-mobile-row"] button{min-height:44px!important;min-width:44px!important}
}
}
@media(max-width:600px){
[data-testid="asset-attachments"]{
 & [data-testid="attachment-filters"]>div:not(:has(input)){margin-right:0!important}
 & [data-testid="attachment-filters"]>div:has(>div){gap:0!important}
 & [data-testid="attachment-filters"]>div[style*="margin-left"]{margin-left:0!important;padding-left:8px!important;padding-right:8px!important}
 & [data-testid="attachment-filters"]>div[style*="margin-left"]>div{font-size:12px!important}
 & [data-testid="attachment-tabs"]{padding:0!important;gap:4px!important}
 & [data-testid="attachment-tabs"]>div{padding:8px!important}
 & [data-testid="attachment-tabs"]>div>div{font-size:12px!important}
 & [data-testid="attachment-preview-secondary"]{display:none!important}
}
}
/* Consistent phone controls, including selected attachment rows. */
@media(max-width:600px){
[data-testid="asset-attachments"]{
 & [data-testid="attachment-filters"]:has(input)>div:not([style]):not(:has(input))>div,
 & [data-testid="attachment-filters"]>div[style*="margin-left"],
 & [data-testid="attachment-tabs"]>div,
 & [data-testid="attachment-sources"]>div{align-items:center!important;justify-content:center!important;box-shadow:none!important;text-align:center!important;min-height:40px!important}
 & [data-testid="attachment-filters"]:has(input)>div:not([style]):not(:has(input))>div>div,
 & [data-testid="attachment-filters"]>div[style*="margin-left"]>div,
 & [data-testid="attachment-tabs"]>div>div,
 & [data-testid="attachment-sources"]>div>div{font-weight:600!important;text-align:center!important;line-height:18px!important;align-self:center!important}
 & [data-testid="attachment-tabs"]>div{border:1px solid #E2E8F0!important;border-radius:12px!important;padding:8px 11px!important}
 & [data-testid="attachment-sources"]>div{border-radius:12px!important}
 & [data-testid="attachment-filters"]:has(input)>div:not([style]):not(:has(input))>div{border-radius:12px!important;padding:8px 10px!important}
 & [data-testid="attachment-mobile-row"]{min-width:0!important}
 & [data-testid="attachment-mobile-row"]>div:first-child{flex-shrink:0!important}
 & [data-testid="attachment-mobile-row"]>div:last-child>div{justify-content:center!important;align-items:center!important}
 & [data-testid="attachment-mobile-row"]>div:last-child>div>div{text-align:center!important}
}
}
@media(max-width:767px){
[data-testid="attachment-viewer"]{height:92dvh!important;max-height:92dvh!important;min-height:0!important;padding:12px!important;border-radius:16px!important;max-width:100%!important}
[data-testid="attachment-viewer-body"]{position:relative!important;flex:1!important;min-height:0!important}
[data-testid="attachment-viewer-preview"]{width:100%!important;min-width:0!important;margin-right:0!important;flex:1!important}
[data-testid="attachment-viewer-details"]{width:100%!important;max-width:100%!important;left:0!important;right:0!important;top:0!important;bottom:0!important;z-index:30!important}
}
[data-testid="attachment-viewer-previous"],[data-testid="attachment-viewer-next"]{width:44px!important;height:44px!important;margin-top:-22px!important;border-radius:22px!important;border:1px solid #CBD5E1!important;background:#fff!important;box-shadow:0 2px 8px #0004!important;z-index:10!important}
[data-testid="attachment-viewer-previous"]>div,[data-testid="attachment-viewer-next"]>div{color:#17243B!important}
@media(max-width:767px){
[data-testid="attachment-viewer"]{height:78dvh!important;max-height:660px!important}
[data-testid="attachment-viewer-header"]>div:first-child{min-width:0!important;margin-right:8px!important;flex:1!important}
[data-testid="attachment-viewer-title"]{font-size:15px!important;line-height:20px!important;white-space:normal!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:2!important}
[data-testid="attachment-viewer"]:has([data-testid="attachment-viewer-preview"] img):not(:has([data-testid="attachment-viewer-details"])){height:auto!important;max-height:82dvh!important}
[data-testid="attachment-viewer"]:has([data-testid="attachment-viewer-preview"] img):not(:has([data-testid="attachment-viewer-details"])) [data-testid="attachment-viewer-body"]{flex:0 0 auto!important}
[data-testid="attachment-viewer"]:has([data-testid="attachment-viewer-preview"] img):not(:has([data-testid="attachment-viewer-details"])) [data-testid="attachment-viewer-preview"]{height:clamp(230px,calc((100vw - 54px)*0.75),60dvh)!important;flex:0 0 auto!important}
}

@media(max-width:600px){
[data-testid="asset-attachments"]{padding-top:0!important}
[data-testid="asset-attachments"]>button{margin:4px 12px 0!important;padding:8px 12px!important;min-height:44px!important;justify-content:center!important}
[data-testid="attachment-header"]{padding:4px 12px 6px!important;min-height:56px!important}
}
