:root {
  --wine: #6f2f45;
  --wine-dark: #451d2b;
  --wine-deep: #30131e;
  --wine-soft: #91566a;
  --ink: #282327;
  --muted: #71696c;
  --cream: #f4f0eb;
  --paper: #fffdfa;
  --sand: #dfd5cc;
  --white: #fff;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow: 0 32px 90px rgba(49, 20, 31, .18);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; background: var(--cream); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; }
button { color: inherit; }
img, svg { display: block; }
a { color: inherit; }
[hidden] { display: none !important; }

.intern-home-link {
  position: fixed;
  z-index: 20;
  top: 24px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .62rem .85rem;
  color: rgba(255,255,255,.9);
  background: rgba(48,19,30,.35);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 750;
  text-decoration: none;
  backdrop-filter: blur(12px);
  transition: background .2s ease, transform .2s ease;
}
.intern-home-link:hover,
.intern-home-link:focus-visible { background: rgba(48,19,30,.62); transform: translateY(-1px); }
.intern-home-link svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 90px 24px 48px;
  background:
    radial-gradient(circle at 18% 15%, rgba(255,255,255,.13), transparent 28%),
    radial-gradient(circle at 82% 85%, rgba(255,255,255,.08), transparent 30%),
    linear-gradient(135deg, var(--wine-deep), var(--wine) 55%, #805067);
  overflow: hidden;
}
.login-screen::before,
.login-screen::after {
  content: "";
  position: fixed;
  width: min(36vw, 520px);
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 50%;
  pointer-events: none;
}
.login-screen::before { left: -15vw; top: -12vw; }
.login-screen::after { right: -12vw; bottom: -16vw; }

.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
  padding: clamp(2rem, 5vw, 3.3rem);
  text-align: center;
  background: rgba(255,253,250,.98);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 4px;
  box-shadow: var(--shadow);
}
.login-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(111,47,69,.1);
  pointer-events: none;
}
.login-logo {
  width: min(280px, 78%);
  margin: 0 auto 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5dcd6;
}
.login-logo img { width: 100%; height: auto; }
.intern-kicker {
  margin: 0 0 .65rem;
  color: var(--wine);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .17em;
  line-height: 1.4;
  text-transform: uppercase;
}
.login-card h1,
.catalog-intro h1,
.gallery-toolbar h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1.02;
}
.login-card h1 { font-size: clamp(2.8rem, 8vw, 4.2rem); }
.login-copy { max-width: 360px; margin: 1rem auto 1.8rem; color: var(--muted); font-size: .94rem; }
.login-form { position: relative; z-index: 1; text-align: left; }
.login-form label {
  display: block;
  margin-bottom: .45rem;
  color: #4d4548;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.password-field { position: relative; }
.password-field input {
  width: 100%;
  min-height: 54px;
  padding: .82rem 3.3rem .82rem 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfc4bd;
  border-radius: 2px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.password-field input:focus { border-color: var(--wine); box-shadow: 0 0 0 4px rgba(111,47,69,.1); }
.password-field input[aria-invalid="true"] { border-color: #a42b3e; box-shadow: 0 0 0 4px rgba(164,43,62,.09); }
.password-toggle {
  position: absolute;
  top: 50%;
  right: .65rem;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #6d6266;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.password-toggle:hover,
.password-toggle:focus-visible { color: var(--wine); background: rgba(111,47,69,.07); }
.password-toggle svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.login-error { min-height: 1.55rem; margin: .4rem 0 .55rem; color: #9a2639; font-size: .8rem; font-weight: 700; }
.login-submit {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  padding: .85rem 1.2rem;
  color: #fff;
  background: var(--wine);
  border: 1px solid var(--wine);
  border-radius: 2px;
  font-size: .8rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.login-submit:hover,
.login-submit:focus-visible { background: var(--wine-dark); transform: translateY(-1px); box-shadow: 0 12px 28px rgba(75,31,46,.22); }
.login-submit:disabled { cursor: wait; opacity: .7; }
.login-submit svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.login-note {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .45rem;
  margin: 1.4rem 0 0;
  color: #7b7174;
  font-size: .72rem;
}
.login-note svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.login-card.is-error { animation: login-shake .38s ease; }
@keyframes login-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }

.catalog-screen { min-height: 100vh; background: var(--cream); }
.catalog-header {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 16px clamp(24px, 5vw, 72px);
  background: rgba(255,253,250,.97);
  border-bottom: 1px solid rgba(111,47,69,.12);
  box-shadow: 0 5px 20px rgba(59,34,43,.05);
}
.catalog-brand { width: min(285px, 38vw); text-decoration: none; }
.catalog-brand img { width: 100%; height: auto; }
.catalog-header__actions { display: flex; align-items: center; gap: 1rem; }
.catalog-status { display: inline-flex; align-items: center; gap: .5rem; color: #675d60; font-size: .76rem; font-weight: 750; }
.catalog-status i { width: 8px; height: 8px; background: #4e8e63; border-radius: 50%; box-shadow: 0 0 0 4px rgba(78,142,99,.12); }
.logout-button,
.gallery-back {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 42px;
  padding: .58rem .82rem;
  color: var(--wine);
  background: transparent;
  border: 1px solid rgba(111,47,69,.28);
  border-radius: 2px;
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
.logout-button:hover,
.logout-button:focus-visible,
.gallery-back:hover,
.gallery-back:focus-visible { color: #fff; background: var(--wine); transform: translateY(-1px); }
.logout-button svg,
.gallery-back svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.catalog-main { min-height: calc(100vh - 180px); padding: clamp(3rem, 7vw, 7rem) clamp(24px, 5vw, 72px); }
.category-view,
.gallery-view { width: min(1180px, 100%); margin-inline: auto; }
.catalog-intro { max-width: 760px; margin-bottom: clamp(2.2rem, 5vw, 4rem); }
.catalog-intro h1 { font-size: clamp(3rem, 7vw, 5.7rem); }
.catalog-intro > p:last-child { max-width: 650px; margin: 1.2rem 0 0; color: var(--muted); }
.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.2rem, 3vw, 2.4rem); }
.category-card {
  position: relative;
  min-height: 390px;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  padding: 0;
  text-align: left;
  background: var(--paper);
  border: 0;
  box-shadow: 0 22px 60px rgba(66,37,46,.1);
  cursor: pointer;
  isolation: isolate;
  transition: transform .28s ease, box-shadow .28s ease;
}
.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 1px solid rgba(111,47,69,.13);
  pointer-events: none;
}
.category-card:hover,
.category-card:focus-visible { transform: translateY(-6px); box-shadow: 0 34px 80px rgba(66,37,46,.16); outline: none; }
.category-card__art {
  position: relative;
  min-height: 245px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(145deg, var(--wine-dark), var(--wine-soft));
}
.category-card__art::before,
.category-card__art::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.category-card__art::before { width: 330px; height: 330px; right: -130px; top: -160px; }
.category-card__art::after { width: 210px; height: 210px; left: -90px; bottom: -110px; }
.category-card__art--coffin { background: linear-gradient(145deg, #32272a, #71545c); }
.category-card__art svg { position: relative; z-index: 1; width: 145px; fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 10px 20px rgba(0,0,0,.18)); transition: transform .3s ease; }
.category-card:hover .category-card__art svg,
.category-card:focus-visible .category-card__art svg { transform: scale(1.045); }
.category-card__content { display: grid; padding: 1.8rem 5rem 1.8rem 2rem; }
.category-card__count { margin-bottom: .2rem; color: var(--wine); font-size: .68rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.category-card__content strong { font-family: var(--serif); font-size: clamp(2.2rem, 4vw, 3.2rem); font-weight: 400; line-height: 1.1; }
.category-card__content > span:last-child { margin-top: .45rem; color: var(--muted); font-size: .85rem; }
.category-card__arrow { position: absolute; right: 1.8rem; bottom: 2rem; width: 44px; height: 44px; display: grid; place-items: center; color: var(--wine); border: 1px solid rgba(111,47,69,.22); border-radius: 50%; transition: color .2s ease, background .2s ease; }
.category-card:hover .category-card__arrow,
.category-card:focus-visible .category-card__arrow { color: #fff; background: var(--wine); }
.category-card__arrow svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.gallery-view { animation: view-in .35s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.gallery-toolbar { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 1.5rem; margin-bottom: 2rem; }
.gallery-toolbar__title { text-align: center; }
.gallery-toolbar h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
.gallery-toolbar .intern-kicker { margin-bottom: .3rem; }
.gallery-counter { min-width: 80px; padding-bottom: .55rem; color: var(--wine); font-size: .82rem; font-weight: 850; letter-spacing: .08em; text-align: right; }
.gallery-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(270px, .65fr); background: var(--paper); box-shadow: var(--shadow); }
.gallery-stage { position: relative; min-width: 0; padding: clamp(1rem, 3vw, 2rem); background: #ece6e1; outline: none; touch-action: pan-y; }
.gallery-stage:focus-visible { box-shadow: inset 0 0 0 3px rgba(111,47,69,.45); }
.gallery-image-frame { position: relative; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; background: #e5ded8; box-shadow: 0 16px 38px rgba(56,37,44,.13); }
.gallery-image-frame img { width: 100%; height: 100%; object-fit: cover; transform: translateX(0); opacity: 1; transition: opacity .16s ease, transform .16s ease; will-change: transform, opacity; }
.gallery-image-frame img.is-leaving-left { opacity: 0; transform: translateX(-3.5%); }
.gallery-image-frame img.is-leaving-right { opacity: 0; transform: translateX(3.5%); }
.gallery-image-frame img.is-entering-left { opacity: 0; transform: translateX(3.5%); transition: none; }
.gallery-image-frame img.is-entering-right { opacity: 0; transform: translateX(-3.5%); transition: none; }
.gallery-placeholder-label { position: absolute; right: 1rem; bottom: 1rem; padding: .4rem .62rem; color: rgba(255,255,255,.92); background: rgba(48,19,30,.66); border-radius: 2px; font-size: .65rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; backdrop-filter: blur(8px); }
.gallery-control { position: absolute; top: 50%; z-index: 3; width: 48px; height: 48px; display: grid; place-items: center; padding: 0; color: var(--wine); background: rgba(255,253,250,.94); border: 0; border-radius: 50%; box-shadow: 0 12px 28px rgba(40,25,31,.18); transform: translateY(-50%); cursor: pointer; transition: color .2s ease, background .2s ease, transform .2s ease; }
.gallery-control:hover,
.gallery-control:focus-visible { color: #fff; background: var(--wine); transform: translateY(-50%) scale(1.04); }
.gallery-control--previous { left: clamp(1.35rem, 3vw, 2.5rem); }
.gallery-control--next { right: clamp(1.35rem, 3vw, 2.5rem); }
.gallery-control svg { width: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.gallery-info { display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem, 5vw, 4.5rem); border-left: 1px solid #e4dbd4; }
.gallery-info__category { margin: 0 0 .7rem; color: var(--wine); font-size: .7rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.gallery-info h2 { margin: 0; font-family: var(--serif); font-size: clamp(2.7rem, 5vw, 4.4rem); font-weight: 400; letter-spacing: -.04em; line-height: 1.04; }
.gallery-info > p:not(.gallery-info__category) { margin: 1.2rem 0 0; color: var(--muted); font-size: .9rem; }
.gallery-progress { height: 3px; margin-top: 2.2rem; overflow: hidden; background: #e5ddd6; }
.gallery-progress span { display: block; width: 6.666%; height: 100%; background: var(--wine); transition: width .24s ease; }
.gallery-mobile-actions { display: none; }
.thumbnail-strip { display: flex; gap: .7rem; margin-top: 1.25rem; padding: .35rem 0 .75rem; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: rgba(111,47,69,.45) transparent; }
.thumbnail-button { flex: 0 0 82px; aspect-ratio: 4 / 5; overflow: hidden; padding: 0; background: #e5ddd7; border: 2px solid transparent; opacity: .58; cursor: pointer; scroll-snap-align: center; transition: opacity .2s ease, border-color .2s ease, transform .2s ease; }
.thumbnail-button:hover,
.thumbnail-button:focus-visible { opacity: .9; transform: translateY(-2px); outline: none; }
.thumbnail-button.is-active { border-color: var(--wine); opacity: 1; }
.thumbnail-button img { width: 100%; height: 100%; object-fit: cover; }
.catalog-footer { display: flex; justify-content: space-between; gap: 2rem; padding: 1.3rem clamp(24px, 5vw, 72px); color: #756b6e; background: var(--paper); border-top: 1px solid #e3dad3; font-size: .76rem; }
.catalog-footer div { display: flex; gap: 1.2rem; }
.catalog-footer a { text-decoration: none; }
.catalog-footer a:hover,
.catalog-footer a:focus-visible { color: var(--wine); text-decoration: underline; }
.noscript-message { position: fixed; z-index: 100; inset: auto 1rem 1rem; padding: 1rem; color: #fff; background: #922f41; text-align: center; }

@media (max-width: 860px) {
  .catalog-main { padding-top: 3rem; }
  .category-grid { grid-template-columns: 1fr; }
  .category-card { min-height: 330px; }
  .gallery-toolbar { grid-template-columns: auto 1fr; align-items: center; }
  .gallery-toolbar__title { text-align: right; }
  .gallery-counter { grid-column: 1 / -1; width: 100%; padding: 0; text-align: center; }
  .gallery-layout { grid-template-columns: 1fr; }
  .gallery-info { border-top: 1px solid #e4dbd4; border-left: 0; }
}

@media (max-width: 620px) {
  .intern-home-link { top: 14px; left: 14px; }
  .intern-home-link span { display: none; }
  .login-screen { padding: 72px 16px 28px; }
  .login-card { padding: 2rem 1.35rem; }
  .login-card::before { inset: 7px; }
  .login-logo { margin-bottom: 1.5rem; }
  .catalog-header { min-height: 78px; padding: 12px 18px; }
  .catalog-brand { width: 190px; max-width: 52vw; }
  .catalog-status { display: none; }
  .logout-button { width: 42px; padding: 0; justify-content: center; }
  .logout-button span { display: none; }
  .catalog-main { padding: 2.5rem 18px 3rem; }
  .catalog-intro h1 { font-size: clamp(2.7rem, 14vw, 4rem); }
  .category-card { min-height: 300px; }
  .category-card__art { min-height: 185px; }
  .category-card__art svg { width: 112px; }
  .category-card__content { padding: 1.45rem 4.5rem 1.45rem 1.35rem; }
  .category-card__arrow { right: 1.3rem; bottom: 1.55rem; }
  .gallery-toolbar { gap: .75rem; margin-bottom: 1.2rem; }
  .gallery-back { width: 42px; padding: 0; justify-content: center; }
  .gallery-back span { display: none; }
  .gallery-toolbar h1 { font-size: 2.65rem; }
  .gallery-toolbar .intern-kicker { display: none; }
  .gallery-stage { padding: .65rem; }
  .gallery-control { display: none; }
  .gallery-placeholder-label { right: .65rem; bottom: .65rem; }
  .gallery-info { padding: 1.6rem 1.25rem; }
  .gallery-info h2 { font-size: 2.75rem; }
  .gallery-mobile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: 1.5rem; }
  .gallery-mobile-actions button { min-height: 46px; display: flex; align-items: center; justify-content: center; gap: .4rem; color: var(--wine); background: #fff; border: 1px solid rgba(111,47,69,.28); font-size: .76rem; font-weight: 800; cursor: pointer; }
  .gallery-mobile-actions button:last-child { color: #fff; background: var(--wine); border-color: var(--wine); }
  .gallery-mobile-actions svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .thumbnail-button { flex-basis: 68px; }
  .catalog-footer { flex-direction: column; align-items: center; gap: .5rem; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Sichtbarkeit des Rücklinks richtet sich nach dem Anmeldestatus. */
body:not(.is-locked) .intern-home-link { display: none; }

/* Datei-Upload */
.password-toggle { transform: translateY(-50%); }

.category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.category-card__art--upload { background: linear-gradient(145deg, #4b3240, #9a6378); }
.category-card__art--upload svg { width: 138px; }

.upload-view { width: min(1180px, 100%); margin-inline: auto; animation: view-in .35s ease both; }
.upload-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.upload-toolbar__title { text-align: center; }
.upload-toolbar h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1.02;
}
.upload-toolbar .intern-kicker { margin-bottom: .3rem; }
.upload-counter {
  min-width: 80px;
  padding-bottom: .55rem;
  color: var(--wine);
  font-size: .82rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-align: right;
}
.upload-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.upload-dropzone {
  min-height: 330px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  padding: 2rem;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 15%, rgba(111,47,69,.07), transparent 32%),
    #eee7e2;
  border: 2px dashed rgba(111,47,69,.28);
  cursor: pointer;
  text-align: center;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.upload-dropzone:hover,
.upload-dropzone:focus-within,
.upload-dropzone.is-dragover {
  background-color: #e8ddd7;
  border-color: var(--wine);
}
.upload-dropzone.is-dragover { transform: scale(.992); }
.upload-dropzone input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.upload-dropzone__icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin-bottom: .35rem;
  color: #fff;
  background: var(--wine);
  border-radius: 50%;
  box-shadow: 0 14px 34px rgba(111,47,69,.24);
}
.upload-dropzone__icon svg { width: 36px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.upload-dropzone strong { font-family: var(--serif); font-size: clamp(1.55rem, 3vw, 2.2rem); font-weight: 400; line-height: 1.15; }
.upload-dropzone > span:last-child { max-width: 480px; color: var(--muted); font-size: .82rem; }
.upload-panel__text { display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem, 4vw, 3.6rem); border-left: 1px solid #e4dbd4; }
.upload-panel__text h2 { margin: 0; font-family: var(--serif); font-size: clamp(2.3rem, 4vw, 3.7rem); font-weight: 400; letter-spacing: -.035em; line-height: 1.04; }
.upload-panel__text > p:not(.intern-kicker) { margin: 1.1rem 0 1.6rem; color: var(--muted); font-size: .9rem; }
.upload-select-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  align-self: flex-start;
  padding: .75rem 1rem;
  color: #fff;
  background: var(--wine);
  border: 1px solid var(--wine);
  border-radius: 2px;
  font-size: .76rem;
  font-weight: 850;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.upload-select-button:hover,
.upload-select-button:focus-visible { background: var(--wine-dark); transform: translateY(-1px); }
.upload-select-button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.upload-select-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.upload-message { min-height: 1.5rem; margin: 1rem 0 .6rem; color: var(--wine); font-size: .82rem; font-weight: 750; }
.upload-message.is-error { color: #a42b3e; }
.upload-empty { padding: clamp(3rem, 7vw, 6rem) 1.5rem; color: var(--muted); text-align: center; background: rgba(255,253,250,.58); border: 1px solid rgba(111,47,69,.1); }
.upload-empty svg { width: 54px; margin: 0 auto 1rem; fill: none; stroke: rgba(111,47,69,.55); stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.upload-empty h2 { margin: 0; color: var(--ink); font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 400; }
.upload-empty p { margin: .55rem 0 0; }
.upload-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.upload-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid rgba(111,47,69,.12);
  box-shadow: 0 14px 34px rgba(59,33,42,.09);
}
.upload-card__image { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #e7dfda; }
.upload-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .28s ease, filter .28s ease; }
.upload-card:hover .upload-card__image img,
.upload-card:focus-within .upload-card__image img { transform: scale(1.035); filter: brightness(.76); }
.upload-card__actions {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  padding: 1rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
}
.upload-card:hover .upload-card__actions,
.upload-card:focus-within .upload-card__actions { opacity: 1; transform: translateY(0); }
.upload-card__action {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--wine);
  background: rgba(255,253,250,.95);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(31,19,24,.22);
  cursor: pointer;
  text-decoration: none;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
.upload-card__action:hover,
.upload-card__action:focus-visible { color: #fff; background: var(--wine); transform: scale(1.06); outline: none; }
.upload-card__action--delete:hover,
.upload-card__action--delete:focus-visible { background: #982d3f; }
.upload-card__action svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.upload-card__meta { display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: .8rem .9rem; }
.upload-card__name { min-width: 0; overflow: hidden; color: #4d4548; font-size: .77rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.upload-card__size { flex: 0 0 auto; color: var(--muted); font-size: .68rem; }

@media (max-width: 1100px) {
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .upload-toolbar { grid-template-columns: auto 1fr; align-items: center; }
  .upload-toolbar__title { text-align: right; }
  .upload-counter { grid-column: 1 / -1; width: 100%; padding: 0; text-align: center; }
  .upload-panel { grid-template-columns: 1fr; }
  .upload-panel__text { border-top: 1px solid #e4dbd4; border-left: 0; }
}

@media (max-width: 620px) {
  .category-grid { grid-template-columns: 1fr; }
  .upload-toolbar { gap: .75rem; margin-bottom: 1.2rem; }
  .upload-toolbar h1 { font-size: 2.65rem; }
  .upload-toolbar .intern-kicker { display: none; }
  .upload-dropzone { min-height: 260px; padding: 1.4rem; }
  .upload-panel__text { padding: 1.6rem 1.25rem; }
  .upload-panel__text h2 { font-size: 2.6rem; }
  .upload-select-button { width: 100%; }
  .upload-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .upload-card__actions { opacity: 1; transform: none; align-items: flex-end; justify-content: flex-end; background: linear-gradient(transparent 42%, rgba(34,20,26,.58)); }
  .upload-card__action { width: 40px; height: 40px; }
  .upload-card__meta { display: block; padding: .65rem .7rem; }
  .upload-card__size { display: block; margin-top: .1rem; }
}
