:root { color-scheme: light dark; font: 16px system-ui, sans-serif; }
body { display: flex; flex-direction: column; min-height: 75svh; margin: 0; background: light-dark(#f5f5f5, #161616); color: light-dark(#202020, #eee); }
main { box-sizing: border-box; width: 100%; max-width: 38.5rem; padding: 1.25rem; margin: auto; text-align: center; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.1rem; margin-top: 2rem; }
article, form, #installation { padding: 1rem; margin: 1rem 0; border: 1px solid light-dark(#ddd, #383838); border-radius: .75rem; }
label { display: block; margin-bottom: .75rem; } small { opacity: .6; }
button, .button { display: inline-block; border: 1px solid light-dark(#ccc, #484848); border-radius: .5rem; padding: .6rem .9rem; margin: .25rem; background: light-dark(#fff, #292929); color: inherit; font: inherit; text-decoration: none; cursor: pointer; }
button:disabled { opacity: .5; cursor: wait; }
#scan, #install { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
#pair-link { display: flex; align-items: center; gap: .5rem; margin: .25rem 0; padding: 0; border: 0; }
#connection-link { flex: 1; min-width: 0; margin: 0; padding: .65rem; border: 1px solid light-dark(#ccc, #484848); border-radius: .5rem; background: transparent; color: inherit; font: inherit; }
#pair-link-submit { flex: none; margin: 0; }
#pair-help { max-width: 28rem; margin: 2rem auto .25rem; font-size: .8rem; line-height: 1.6; opacity: .7; }
#use-link { border: 0; padding: 0; background: none; font-size: .875rem; text-decoration: underline; }
#use-link[aria-expanded="true"] { margin-top: 1.25rem; }
.download:disabled { cursor: default; }
textarea { box-sizing: border-box; display: block; width: 100%; min-height: 5rem; resize: vertical; margin: .5rem 0; padding: .65rem; border: 1px solid light-dark(#ccc, #484848); border-radius: .5rem; background: transparent; color: inherit; font: inherit; }
input { display: block; max-width: 100%; margin: 0 auto .75rem; }
:focus-visible { outline: 2px solid #78a9ef; outline-offset: 3px; }
#status { overflow-wrap: anywhere; }
#status:empty { margin: 0; }
header { display: flex; flex-direction: column; align-items: center; gap: .75rem; margin: 1.5rem 0; }
header img { width: 40.5vw; height: auto; }
header h1 { margin: 0; }
video { display: block; width: 100%; max-height: 65vh; border-radius: .75rem; object-fit: cover; }
body.scanning { min-height: 100svh; }
body.scanning main { margin: 0 auto; }
body.scanning header { flex-direction: row; gap: .625rem; margin: 0 0 1rem; }
body.scanning header img { width: 2.25rem; }
body.scanning header h1 { font-size: 1.1rem; }
body.scanning :is(#scan, #paired, #pair-help, #use-link, #pair-link, #offline) { display: none; }
#camera video { height: min(70dvh, 32rem); max-height: none; background: #000; object-fit: contain; }
[hidden] { display: none !important; }
#offline { opacity: .6; }
#update-notice { position: fixed; z-index: 10; bottom: 1rem; left: 50%; transform: translateX(-50%); box-sizing: border-box; max-width: calc(100% - 2rem); margin: 0; padding: .75rem 1rem; border: 1px solid light-dark(#ddd, #484848); border-radius: .75rem; background: light-dark(#fff, #292929); font-size: .875rem; text-align: center; }
#install-help { margin: .5rem 0 0; }
#skip-install { display: inline-block; margin-top: .75rem; color: inherit; }
#about-sharing, #report-issue { max-width: 30rem; margin: 2rem auto 0; font-size: .8rem; line-height: 1.6; opacity: .7; }
#report-issue { margin-top: 2.5rem; }
#report-issue a { display: block; margin-top: .5rem; color: inherit; }
#paired article { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: .5rem; padding: .65rem 1rem; }
#paired { width: 100%; }
#paired:empty, body:has(#share-page[hidden]) #paired { display: none; }
#paired .computer { grid-column: 1 / -1; min-width: 0; overflow-wrap: anywhere; }
#paired button { min-width: 0; margin: 0; padding: .55rem .45rem; font-size: .875rem; }
body:has(#share-page[hidden]) #scan { display: none; }
header:has(#scan:not([hidden])) { margin-bottom: 0; }
#connection-bar { display: flex; align-items: center; gap: .375rem; flex: none; margin-bottom: 1rem; }
#connected-device { flex: 1; min-width: 0; margin: 0; font-size: .8125rem; opacity: .7; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#connection-bar button { flex: none; margin: 0; padding: .375rem .5rem; font-size: .75rem; }
#disconnect { color: light-dark(#b42318, #ffb4ab); }
#items { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: .5rem; border: 1px solid light-dark(#ddd, #383838); border-radius: .75rem; background: light-dark(#fff, #080808); }
#items:empty::after { content: 'No items'; display: block; padding: 2rem 1rem; text-align: center; opacity: .6; }
#items.dragging { border-color: #78a9ef; background: light-dark(#e5f0ff, #172536); outline: 2px solid #78a9ef; outline-offset: -2px; }
.item-row { display: grid; grid-template-columns: 2rem 2rem minmax(0, 1fr) 2rem; align-items: start; gap: .5rem; margin: 0 0 .375rem; padding: .5rem; border: 0; border-radius: .5rem; background: light-dark(#f1f1f1, #202020); text-align: start; }
.item-row:last-child { margin-bottom: 0; }
.item-action { display: flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; margin: .2rem 0 0; padding: .375rem; border: 0; background: transparent; }
.item-action:hover:not(:disabled) { background: light-dark(#ddd, #383838); }
.item-preview { display: flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; margin-top: .2rem; }
.item-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: .25rem; }
.item-info { min-width: 0; }
.item-name, .item-detail { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.item-name { font-size: .95rem; line-height: 1.5; }
.item-meta { display: flex; align-items: center; gap: .375rem; min-width: 0; margin-top: .125rem; font-size: .75rem; }
.item-detail { flex: 1; opacity: .6; }
.sender { flex: none; max-width: 5rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: .125rem .25rem; border-radius: .25rem; color: light-dark(#285985, #b5d9ff); background: light-dark(#dce9f5, #293b4c); font-size: .6875rem; }
.item-info summary { list-style: none; cursor: pointer; }
.item-info summary::-webkit-details-marker { display: none; }
.item-info textarea { font-size: .875rem; }
#transfer-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; flex: none; padding-top: 1rem; }
#transfer-actions form { display: contents; }
#transfer-actions button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .375rem; min-height: 4.25rem; width: 100%; margin: 0; padding: .625rem .5rem; border-radius: .75rem; font-size: .875rem; }

@media (min-width: 48rem) {
  main { max-width: 34rem; padding: 2rem; }
  header { gap: 1rem; margin: 1rem 0 2rem; }
  header img { width: clamp(10rem, 16vw, 14rem); }
  #about-sharing, #report-issue { font-size: .875rem; }
}

body:has(#connected:not([hidden])) { min-height: 100svh; }
body:has(#connected:not([hidden])) main { display: flex; flex-direction: column; height: 100dvh; margin: 0 auto; text-align: start; }
body:has(#connected:not([hidden])) header { flex: none; flex-direction: row; gap: .625rem; margin: 0 0 1rem; }
body:has(#connected:not([hidden])) header img { width: 2.25rem; }
body:has(#connected:not([hidden])) header h1 { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 1.1rem; }
body:has(#connected:not([hidden])) #scan { display: none; }
body:has(#connected:not([hidden])) #paired { display: none; }
body:has(#connected:not([hidden])) #share-page, #connected { display: flex; flex-direction: column; flex: 1; min-height: 0; }
body:has(#connected:not([hidden])) #pairing { display: none; }
body:has(#connected:not([hidden])) #offline { display: none; }
body:has(#connected:not([hidden])) #text { flex: none; margin: .5rem 0 0; padding: .75rem; max-height: 35dvh; overflow: auto; }
