#upload {
  --storage-ink: #133d2c;
  --storage-line: #b7c8bd;
  color: var(--storage-ink);
}
#storageComposer, #storageReceipt, #storageHistory { max-width: 780px; margin: 0 auto; }
#upload [hidden] { display: none !important; }
.storageHeading, .storageFoot, .storageSources, .storageCategories {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.storageHeading { margin-bottom: .9rem; }
.storageHeading :is(h1,h2) { margin: 0; flex: 1; line-height: 1.35; }
#upload button, #storagePicker button { touch-action: manipulation; }
#upload .storageText, .storageFoot button, #storagePicker .storageText {
  border: 0; background: transparent; color: #14553b; text-decoration: underline;
  text-underline-offset: .22em; font-size: .88rem; padding: .5rem;
}
.storageCategories { gap: .45rem; }
.storageCategories button { flex: 1; min-height: 45px; background: white; }
.storageCategories button[aria-pressed="true"] { background: #075137; color: white; border-color: #075137; }
.storagePath, .storageEntry, .storageRecord, .storageBreadcrumb {
  border: 1px solid var(--storage-line, #b7c8bd); border-radius: 9px;
  padding: .78rem .86rem; width: 100%; color: #174733; background: white;
}
.storagePath, .storageEntry { display: flex; align-items: center; gap: .8rem; text-align: left; }
.storagePath { margin: .85rem 0; border-color: #67917a; }
#storagePathText, .storageEntry span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.storagePath span:last-child, .storageArrow { font-size: 1.5rem; line-height: 1; }
.storageFolderIcon {
  display: inline-block; position: relative; width: 22px; height: 15px; flex-shrink: 0;
  margin-top: 3px; border: 2px solid #31694d; border-radius: 3px; background: white;
}
.storageFolderIcon::before { content: ''; position: absolute; left: -2px; top: -5px; width: 9px; height: 4px; border: 2px solid #31694d; border-bottom: none; border-radius: 3px 3px 0 0; background: white; }
.storageDrop {
  border: 1.5px dashed #448061; border-radius: 10px; padding: 1rem;
  text-align: center; background: #fbfdfb;
}
.storageDrop.over { background: #e7f3e9; outline: 2px solid #29704b; }
#browse { display: inline-flex; justify-content: center; align-items: center; gap: .45rem; width: 100%; border: 0; padding: .5rem; background: transparent; color: #144a33; }
.storageDrop small { display: block; font-size: .76rem; }
.storagePlus { font-size: 1.4rem; line-height: 1; }
.storageSources { flex-direction: column; align-items: stretch; gap: .65rem; }
.storageSources button { flex: 1 1 auto; padding: .46rem .5rem; font-size: .81rem; min-height: 40px; }
#upload #batch { border: 0; padding: 0; margin: .9rem 0; }
#upload #grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,165px),1fr)); gap: .5rem; max-height: 48vh; overflow: auto; }
.storageAttachment { display: flex; align-items: center; min-width: 0; gap: .5rem; padding: .55rem; border: 1px solid #b7c8bd; border-radius: 8px; }
.storageAttachmentName { overflow-wrap: anywhere; min-width: 0; flex: 1; font-size: .85rem; font-weight: 650; }
.storageThumbButton { padding: 0; border: 0; flex: none; }
.storageThumb, .storageExt { display: grid; place-items: center; width: 36px; height: 40px; border-radius: 4px; object-fit: cover; background: #e8f0eb; color: #25583e; font-size: .7rem; }
#upload .storageRemove { border: 0; background: #eef0ee; color: #37443d; border-radius: 50%; width: 27px; height: 27px; line-height: 1; padding: 0; }
.storageClip { font-family: 'Segoe UI Symbol',sans-serif; }
#storageComposer .storagePrimary, #storagePicker .storagePrimary, #storageReceipt .storagePrimary {
  display: block; width: 100%; text-align: center; margin: .8rem 0;
  padding: .72rem 1rem; background: #075137; color: white; font-weight: 700; border: 1px solid #075137; border-radius: 9px; text-decoration: none;
}
#storageDestinationHint { margin: 0; }
#storagePicker { color: #1a3429; padding: 1.2rem; width: min(94vw,540px); max-height: 88dvh; overflow-y: auto; }
.storageBack { border: 0; padding: .2rem .45rem; font-size: 1.3rem; }
.storageBreadcrumb { margin: .25rem 0 .8rem; background: #f6faf7; font-size: .9rem; overflow-wrap: anywhere; }
.storageSearch { display: flex; align-items: center; gap: .5rem; padding: .45rem .65rem; border: 1px solid #9fafaa; border-radius: 7px; }
.storageSearch input { min-width: 0; flex: 1; padding: .15rem; border: 0; background: transparent; font: inherit; }
#storageRows { margin: .8rem 0; max-height: 42dvh; overflow-y: auto; }
.storageEntry { margin-bottom: .4rem; min-height: 44px; font-size: .93rem; }
.storageCreate { width: 100%; margin: .55rem 0; }
#storageName { border: 1px solid #9fafaa; border-radius: 7px; width: 100%; padding: .65rem; }
#storageCreateForm label { display: block; font-weight: 650; margin-bottom: .35rem; }
#storageCreateForm .storageText { display: block; margin: auto; }
.storageReceiptTitle { font-size: clamp(1.35rem,3vw,1.9rem); padding: .5rem 0; }
.storageDetails { display: grid; grid-template-columns: minmax(5rem,27%) minmax(0,1fr); margin: .7rem 0 1.5rem; }
.storageDetails dt, .storageDetails dd { border-top: 1px solid #dce4dd; padding: .62rem .24rem; margin: 0; overflow-wrap: anywhere; }
.storageDetails dd { white-space: pre-line; }
.storageFoot { justify-content: center; flex-wrap: wrap; }
.storageRecord { display: grid; gap: .15rem; margin: .5rem 0; text-align: left; overflow-wrap: anywhere; }
#olderFiles { margin-top: 1rem; }
#olderFiles summary { cursor: pointer; }
#storageMessage:empty, #storagePickerMessage:empty { display: none; }
.storageHistoryLinks { display:flex; gap:.5rem; margin:0 0 .75rem; }
#storageAudit, #storageRecovery { max-height:88dvh; overflow:auto; color:#244535; }
.storageAuditSearch { display:flex; align-items:center; flex-wrap:wrap; gap:.4rem; }
.storageAuditSearch :is(input,select) { min-width:8rem; flex:1; width:auto; padding:.55rem; margin:0; border:1px solid #9fafaa; border-radius:7px; }
#storageRecoveryFind label { font-size:.85rem; width:100%; }
#storageAuditRows { list-style:none; padding:0; margin:.8rem 0; }
#storageAuditRows li { display:grid; gap:.1rem; padding:.65rem 0; border-top:1px solid #dce4dd; overflow-wrap:anywhere; }
#storageAuditScopeLabel { display:block; margin-top:.6rem; }
#storageRecoveryItems h3 { margin:.85rem 0 .45rem; }
#storageRecoveryDetails { font-size:.93rem; }
#storageRecoveryMessage, #storageAuditMessage { overflow-wrap:anywhere; }
#storageRecovery .storagePrimary { width:100%; }
@media (max-width:700px) {
  #upload { padding: 1rem; }
  #storagePicker { padding: 1rem; }
  .storageDrop { padding: .7rem; }
  .storageDrop small { display: none; }
  .storageCategories button { padding-inline: .3rem; }
  #upload #grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
