/* ==========================================================================
   UA Living Spec Book: client uploads panel (right slide-over).
   Styles for UA.components.uploadsPanel: the panel shell, the share form,
   and the shared-file list with download and inline-remove actions.
   Consumes tokens from css/tokens.css only, no raw brand hex.
   ========================================================================== */

@keyframes up-slide-in {
  from {
    transform: translateX(48px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.up-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(420px, 94vw);
  padding: var(--ua-s6) var(--ua-s5) var(--ua-s5);
  background: var(--ua-bg-raised);
  border-left: 1px solid var(--ua-line);
  box-shadow: var(--ua-shadow-pop);
  overflow-y: auto;
  animation: up-slide-in var(--ua-slow) var(--ua-ease) both;
}

.up-panel__close {
  position: absolute;
  top: var(--ua-s4);
  right: var(--ua-s4);
}

.up-panel h2 {
  margin: 0 0 var(--ua-s2);
  padding-right: var(--ua-s7);
  font-family: var(--ua-font-display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: var(--ua-text-strong);
}

.up-panel__lede {
  margin: 0 0 var(--ua-s5);
  color: var(--ua-text-muted);
  font-size: var(--ua-fs-small);
  font-weight: 200;
  line-height: 1.5;
}

/* =======================
   Share form
   ======================= */
.up-form {
  display: grid;
  gap: var(--ua-s3);
  padding: var(--ua-s4);
  border: 1px solid var(--ua-line-soft);
  border-radius: var(--ua-radius-lg);
  background: var(--ua-bg-card);
}

.up-form__row {
  display: flex;
  align-items: center;
  gap: var(--ua-s3);
  flex-wrap: wrap;
  min-width: 0;
}

/* The label is the visible button; the input stays focusable underneath. */
.up-file {
  position: relative;
}

.up-file:focus-within {
  outline: 2px solid var(--ua-ink);
  outline-offset: 2px;
}

.up-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.up-form__chosen {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: var(--ua-fs-tiny);
  overflow-wrap: anywhere;
}

/* =======================
   Shared-file list
   ======================= */
.up-panel__list {
  margin-top: var(--ua-s5);
}

.up-panel__list > .u-muted {
  font-size: var(--ua-fs-small);
}

.up-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.up-row {
  display: flex;
  align-items: flex-start;
  gap: var(--ua-s2);
  padding-block: var(--ua-s3);
  border-top: 1px solid var(--ua-line-soft);
}

.up-row__main {
  flex: 1;
  min-width: 0;
}

.up-row__name {
  display: block;
  font-weight: 400;
  font-size: var(--ua-fs-small);
  color: var(--ua-text-strong);
  overflow-wrap: anywhere;
}

.up-row__meta {
  font-size: var(--ua-fs-tiny);
  font-weight: 200;
  color: var(--ua-text-muted);
}

.up-row__note {
  margin: var(--ua-s1) 0 0;
  font-size: var(--ua-fs-small);
  font-weight: 300;
  line-height: 1.5;
  color: var(--ua-text);
  overflow-wrap: anywhere;
}

.up-row__actions {
  display: flex;
  align-items: center;
  gap: var(--ua-s1);
  flex-shrink: 0;
}

.up-confirm__label {
  font-size: var(--ua-fs-tiny);
  white-space: nowrap;
}

.up-panel .ua-empty {
  margin-block: var(--ua-s5);
}

/* =======================
   Responsive
   ======================= */
@media (max-width: 480px) {
  .up-panel {
    width: 100vw;
    border-left: 0;
  }

  .up-row {
    flex-wrap: wrap;
  }

  .up-row__actions {
    margin-left: auto;
  }
}

/* =======================
   Reduced motion
   ======================= */
@media (prefers-reduced-motion: reduce) {
  .up-panel {
    animation: none;
  }
}
