/* my.vuzio.app: the gallery and its sign-in, on top of vuzio.css (tokens, buttons, inputs). */

.shell { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; gap: 32px; padding: 20px 0 32px; }
.page-gallery .shell, .page-login .shell { grid-template-rows: auto 1fr; }
.page-login .shell { grid-template-rows: auto auto 1fr; }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.bar form { margin: 0; }
.logo-sub { font: 600 15px/1 var(--font-head); color: var(--text-2); padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--border); }
.btn-sm { min-height: 40px; padding: 0 14px; gap: 8px; font-size: 14px; border-radius: 12px; }

.spinner {
  display: inline-block; width: 14px; height: 14px; flex: none;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: my-spin 0.8s linear infinite;
}
@keyframes my-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* ---- sign-in ---- */
.login { display: grid; gap: 18px; align-content: start; animation: vz-rise var(--dur-enter) var(--ease-out) both; }
.login h1 { margin: 0; }
.lead { margin: 0; color: var(--text-2); font-size: 16px; line-height: 24px; text-wrap: pretty; }
/* A QR code stays dark-on-white in dark mode too: phone cameras read it that way. */
.qr { justify-self: start; padding: 16px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); line-height: 0; }
.qr svg { width: 200px; height: 200px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 21px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--blue); }
.status { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--text-2); font-size: 14px; }
.status .spinner { color: var(--blue-text); }
.ended { display: grid; gap: 14px; }
.ended p { margin: 0; font-weight: 600; }
.login[data-state="done"] .qr { opacity: 0.25; }
.foot { margin: 0; color: var(--text-2); font-size: 13px; line-height: 20px; }

/* ---- gallery ---- */
.gallery { display: grid; gap: 24px; align-content: start; }
.drop {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px 20px;
  padding: 20px; border: 1.5px dashed color-mix(in srgb, var(--blue) 30%, var(--border));
  border-radius: var(--radius-lg); background: var(--surface);
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.drop.is-over { background: var(--ice); border-color: var(--blue); }
.drop-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--ice); color: var(--blue-text); }
.drop-text { display: grid; gap: 2px; min-width: 0; }
.drop-text .title { font-size: 17px; }
.drop-text p { margin: 0; }
.drop-buttons { display: flex; gap: 8px; }
.drop-buttons .btn { min-height: 44px; padding: 0 16px; gap: 8px; font-size: 14px; cursor: pointer; }
.drop.is-busy .drop-buttons { opacity: 0.5; pointer-events: none; }
.progress, .drop-error { grid-column: 1 / -1; margin: 0; }
.progress { display: grid; gap: 8px; }
.progress-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-2); }
.progress-head span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-track { height: 6px; border-radius: 99px; background: var(--ice); overflow: hidden; }
.progress-track span { display: block; height: 100%; width: 0; background: var(--blue); border-radius: inherit; transition: width var(--dur-base) linear; }
.drop-error { color: var(--error-text); font-size: 14px; line-height: 21px; }

.section-title { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; }
.count { font: 600 13px/1 var(--font-body); color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 99px; padding: 5px 9px; }
.empty { margin: 0; padding: 32px 0; color: var(--text-2); max-width: 46ch; }

.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 248px), 1fr)); }
.work { display: grid; gap: 12px; min-width: 0; animation: vz-rise var(--dur-enter) var(--ease-out) both; }
.thumb {
  position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: var(--radius); background: var(--ice); border: 1px solid var(--border); color: var(--blue-text);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform var(--dur-slow) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  a.thumb:hover img { transform: scale(1.02); }
  .work:has(a.thumb:hover) .work-title { color: var(--blue-text); }
}
.thumb-kind { display: grid; justify-items: center; gap: 6px; }
.thumb-kind .icon { width: 30px; height: 30px; }
.thumb-kind b { font: 700 13px/1 var(--font-body); letter-spacing: 0.04em; }
.thumb-note { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.thumb-note.is-error { color: var(--error-text); }
.work-body { display: flex; align-items: flex-start; gap: 8px; }
.work-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.work-title {
  color: var(--text); font-weight: 600; font-size: 15px; line-height: 21px; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
a.work-title:hover { color: var(--blue-text); }
.work-meta { margin: 0; font-size: 13px; line-height: 20px; color: var(--text-2); }
.work-error { margin: 2px 0 0; font-size: 13px; line-height: 19px; color: var(--error-text); }
.work-actions { display: flex; gap: 2px; margin: -6px -8px 0 0; }
.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px;
  background: none; color: var(--text-2); cursor: pointer; list-style: none;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn:hover, .menu[open] > .icon-btn { background: var(--ice); color: var(--blue-text); }
.menu { position: relative; }
/* Cards rise in with a transform, so each is its own layer: the one with an open menu goes on top. */
.work { position: relative; }
.work:has(.menu[open]) { z-index: 6; }
.menu-list {
  position: absolute; right: 0; top: 40px; z-index: 5; min-width: 200px; display: grid; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-md);
  transform-origin: top right; animation: my-menu var(--dur-fast) var(--ease-out) both;
}
@keyframes my-menu { from { opacity: 0; transform: scale(0.96); } }
.menu-list > * {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px;
  border: 0; border-radius: 9px; background: none; color: var(--text); font: 500 14px/1 var(--font-body);
  text-align: left; cursor: pointer;
}
.menu-list > *:hover { background: var(--bg); text-decoration: none; }
.menu-list .icon { color: var(--text-2); }
.menu-list .danger, .menu-list .danger .icon { color: var(--error-text); }

dialog { width: min(400px, 100% - 32px); padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-md); }
dialog[open] { animation: vz-rise var(--dur-base) var(--ease-out) both; }
dialog::backdrop { background: rgb(11 17 32 / 0.4); }
.dialog { display: grid; gap: 16px; padding: 20px; }
.dialog p { margin: -6px 0 0; overflow-wrap: anywhere; }
/* The main button comes first in the markup (Enter submits it) and sits on the right. */
.dialog-buttons { display: flex; flex-direction: row-reverse; justify-content: flex-start; gap: 8px; }
.dialog-buttons .btn { min-height: 44px; padding: 0 18px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 10; padding: 10px 16px; border-radius: 12px;
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500; pointer-events: none;
  opacity: 0; transform: translate(-50%, 8px); transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .drop { grid-template-columns: auto minmax(0, 1fr); }
  .drop-buttons { grid-column: 1 / -1; }
  .drop-buttons .btn { flex: 1; }
  .logo-sub { display: none; }
}

[hidden] { display: none !important; }
