:root {
  --inkt-900: #2a2520;
  --inkt-700: #4d443b;
  --inkt-500: #7a6f62;
  --inkt-400: #9c9081;
  --klei-500: #be6a48;
  --papier-0: #ffffff;
  --papier-50: #faf6f0;
  --papier-100: #f4ede2;
  --papier-200: #e6dccc;
  --papier-300: #d6c9b5;
  /* Light text on an accent-colored (or otherwise dark) surface — kept
     separate from --papier-50 (the page background) because the klant-
     pagina overrides --papier-50 to whatever background_color the
     photographer picked, which is sometimes dark; --on-accent must stay
     light regardless, since it's paired with --klei-500 (also
     photographer-chosen, but always used as an opaque fill button/chip/etc.
     needs light text on top of it, not a copy of the page background). */
  --on-accent: #faf6f0;

  /* Semantic status tints — pale badge/pill backgrounds paired with a
     saturated text/fill color, reused as-is across admin.css and app.css
     (badges, flash messages, danger buttons, meters). */
  --tint-klei-bg: #f7ebe3;
  --status-green: #3d6b4c;
  --status-green-bg: #e5f0e8;
  --status-amber: #9c7a2e;
  --status-amber-bg: #f7f0e3;
  --status-red: #9c4a2e;
  --status-red-bg: #fbeee7;
  --status-red-border: #f0d4c7;

  --font-title: "Newsreader", Georgia, serif;
  --font-body: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Dark palette — only ever applied via [data-theme="dark"] on <html>, which
   admin_layout.php en app_layout.php zetten (via js/theme_init.js + de
   profile-menu switch). De publieke klant-pagina (client_layout.php) laadt
   dat script niet en blijft dus altijd licht. */
:root[data-theme="dark"] {
  --inkt-900: #f2ece2;
  --inkt-700: #d6c9b5;
  --inkt-500: #a89a89;
  --inkt-400: #8a7d6c;
  --klei-500: #d98257;
  --tint-klei-bg: #3a2c22;
  --status-green: #7fbf8f;
  --status-green-bg: #1f3327;
  --status-amber: #d9b466;
  --status-amber-bg: #3a2f1a;
  --status-red: #e08a72;
  --status-red-bg: #3a201a;
  --status-red-border: #5c3b30;
  /* --papier-50 (page background) stays the darkest step, with --papier-0
     (card/surface background) a touch lighter so cards still lift off the
     page — same relationship as in light mode, just inverted. */
  --papier-50: #17130f;
  --papier-0: #211c17;
  --papier-100: #2c261f;
  --papier-200: #3a332a;
  --papier-300: #4d443b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--papier-50);
  color: var(--inkt-900);
  font-family: var(--font-body);
}

body.lightbox-open {
  overflow: hidden;
}

/* ---------- Page (placeholder host content) ---------- */

.page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.page__trigger {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  color: var(--on-accent);
  background: var(--klei-500);
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  cursor: pointer;
}

.page__logout {
  position: fixed;
  top: 20px;
  right: 20px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--inkt-500);
  text-decoration: none;
}

.page__logout:hover {
  color: var(--inkt-900);
}

/* ---------- Auth (login) ---------- */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 360px;
  background: var(--papier-0);
  border: 1px solid var(--papier-200);
  border-radius: 12px;
  padding: 32px;
}

.auth-card__title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-card__title h1 {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 26px;
  color: var(--inkt-900);
  margin: 0;
}

.auth-card__title p {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  color: var(--inkt-500);
  margin: 0;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--inkt-900);
}

.auth-field input {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--inkt-900);
  background: var(--papier-0);
  border: 1px solid var(--papier-300);
  border-radius: 8px;
  padding: 10px 12px;
}

.auth-field input:focus-visible {
  outline: 2px solid var(--klei-500);
  outline-offset: 2px;
}

.auth-field input::placeholder {
  color: var(--inkt-400);
  font-weight: 400;
}

.auth-field__control {
  position: relative;
  display: block;
}

.auth-field__control input {
  width: 100%;
  padding-right: 42px;
}

.auth-field__reveal {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--inkt-400);
  cursor: pointer;
  border-radius: 8px;
}

.auth-field__reveal:hover {
  color: var(--inkt-700);
}

.auth-field__reveal:focus-visible {
  outline: 2px solid var(--klei-500);
  outline-offset: -2px;
}

.auth-field__reveal svg[hidden] {
  display: none;
}

.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Login: foto links, formulier in een vaste rechterkolom.
   account_deleted.php blijft de gecentreerde .auth-page gebruiken. */
.login-body {
  background: var(--papier-50);
}

.login-split {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.login-split__visual {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  background: var(--papier-100);
}

.login-split__visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 58%;
}

.login-split__panel {
  flex: 0 0 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 44px 28px;
  background: var(--papier-50);
  border-left: 1px solid var(--papier-200);
  overflow: auto;
}

.login-split__stack {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  width: 100%;
  max-width: 340px;
  min-height: 100%;
}

.login-split__logo,
.legal-page__logo {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 22px;
  line-height: 1;
  color: var(--inkt-900);
  text-decoration: none;
}

.login-split__logo em,
.legal-page__logo em {
  color: var(--klei-500);
  font-style: italic;
}

.login-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  flex: 1 0 auto;
  width: 100%;
  padding: 40px 0;
}

.login-form .auth-field + .auth-field {
  margin-top: -8px;
}

.login-form .panel__upload {
  flex: none;
  width: 100%;
}

.login-form__note {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  color: var(--status-green);
}

.login-split__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
}

.login-split__legal a,
.legal-page__nav a {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 13px;
  color: var(--inkt-500);
  text-decoration: none;
}

.login-split__legal a:hover,
.legal-page__nav a:hover {
  color: var(--inkt-900);
  text-decoration: underline;
}

.login-split__legal a:focus-visible,
.legal-page__nav a:focus-visible,
.legal-page__logo:focus-visible {
  outline: 2px solid var(--klei-500);
  outline-offset: 2px;
  border-radius: 2px;
}

.legal-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 36px 24px 28px;
  background: var(--papier-50);
}

.legal-page__inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  max-width: 640px;
}

.legal-page__doc {
  padding: 36px 0 28px;
}

.legal-page__doc h1 {
  margin: 0 0 16px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 32px;
  color: var(--inkt-900);
}

.legal-page__doc h2 {
  margin: 28px 0 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  color: var(--inkt-900);
}

.legal-page__doc p {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  color: var(--inkt-700);
}

.legal-page__doc a {
  color: var(--klei-500);
}

.legal-page__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: auto;
}

.legal-page__nav a[aria-current="page"] {
  color: var(--inkt-900);
  font-weight: 600;
}

@media (max-width: 860px) {
  .login-split {
    flex-direction: column;
  }

  .login-split__visual {
    flex: 0 0 34vh;
    min-height: 200px;
  }

  .login-split__panel {
    flex: 1 1 auto;
    border-left: none;
    border-top: 1px solid var(--papier-200);
    padding: 28px 24px 24px;
  }
}

/* ---------- Panel (zijscherm) ---------- */

.panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 37, 32, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
}

.panel-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 450px;
  max-width: 100vw;
  background: var(--papier-50);
  border-left: 1px solid var(--papier-300);
  box-shadow: -24px 0 60px rgba(42, 25, 15, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 50;
}

.panel.is-open {
  transform: translateX(0);
}

.panel__close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--inkt-400);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.panel__close:hover {
  background: var(--papier-200);
  color: var(--inkt-900);
}

.panel__content {
  flex: 1 0 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 48px 40px;
}

.panel__title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.panel__title h1 {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 32px;
  line-height: normal;
  color: var(--inkt-900);
  margin: 0;
}

.panel__title p {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  color: var(--inkt-500);
  margin: 0;
}

.panel__dropzone {
  flex: 1 0 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--papier-0);
  border: 1px dashed var(--papier-300);
  border-radius: 12px;
  cursor: pointer;
  padding: 24px;
  text-align: center;
}

.panel__dropzone.is-dragover {
  background: var(--papier-50);
  border-color: var(--klei-500);
}

.panel__dropzone.has-files {
  flex: 0 0 auto;
  min-height: 170px;
}

.panel__dropzone[hidden] {
  display: none;
}

.panel__dropzone-icon {
  display: block;
  width: 32px;
  height: 32px;
  color: var(--klei-500);
}

.panel__dropzone-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  line-height: 1.5;
}

.panel__dropzone-text strong {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--inkt-900);
  max-width: min(290px, 100%);
}

.panel__dropzone-text small {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 10px;
  color: var(--inkt-400);
  max-width: min(255px, 100%);
}

.panel__warning {
  flex-shrink: 0;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fbeee7;
  color: #9c4a2e;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  line-height: 1.4;
}

.panel__warning[hidden] {
  display: none;
}

.panel__warning a {
  color: inherit;
  text-decoration: underline;
}

.panel__files {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 0 0;
  min-height: 0;
}

.panel__files[hidden] {
  display: none;
}

.panel__files-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.panel__files-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel__files-clear {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  color: var(--inkt-500);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  transition: color 0.15s ease;
}

.panel__files-clear:hover:not(:disabled) {
  color: var(--klei-500);
}

.panel__files-clear:disabled {
  color: var(--inkt-400);
  cursor: not-allowed;
  opacity: 0.6;
}

.panel__files-clear:focus-visible {
  outline: 2px solid var(--klei-500);
  outline-offset: 2px;
}

.panel__files-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  color: var(--inkt-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.panel__files-count {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  color: var(--klei-500);
  background: #f7ebe3;
  border-radius: 999px;
  padding: 2px 8px;
  min-width: 18px;
  text-align: center;
}

.panel__upload-status {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--papier-0);
  border: 1px solid var(--papier-200);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.panel__upload-status[hidden] {
  display: none;
}

.panel__upload-status-ring {
  position: relative;
  width: 64px;
  height: 64px;
}

.panel__upload-status-ring svg {
  transform: rotate(-90deg);
}

.panel__upload-status-track {
  stroke: var(--papier-200);
}

.panel__upload-status-fill {
  stroke: var(--klei-500);
  stroke-dasharray: 169.6;
  stroke-dashoffset: 169.6;
  transition: stroke-dashoffset 0.2s ease, stroke 0.2s ease;
}

.panel__upload-status.is-done .panel__upload-status-fill {
  stroke: #5b8a6b;
}

.panel__upload-status-percent {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  color: var(--inkt-900);
}

.panel__upload-status-text {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 13px;
  color: var(--inkt-500);
}

.upload-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  background: var(--papier-0);
  border: 1px solid var(--papier-300);
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(42, 37, 32, 0.14);
  padding: 6px 6px 6px 16px;
}

.upload-toast[hidden] {
  display: none;
}

.upload-toast__open {
  border: none;
  background: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--inkt-900);
  cursor: pointer;
  padding: 6px 4px;
  text-align: left;
}

.upload-toast__open:focus-visible,
.upload-toast__stop:focus-visible {
  outline: 2px solid var(--klei-500);
  outline-offset: 2px;
}

.upload-toast__stop {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  color: var(--inkt-900);
  background: var(--papier-100);
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.upload-toast__stop:hover {
  background: var(--papier-200);
}

.upload-toast__stop[hidden] {
  display: none;
}

.panel__file-list {
  list-style: none;
  margin: 0;
  padding: 0 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 0 0;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--papier-300) transparent;
}

.panel__file-list::-webkit-scrollbar {
  width: 6px;
}

.panel__file-list::-webkit-scrollbar-track {
  background: transparent;
}

.panel__file-list::-webkit-scrollbar-thumb {
  background: var(--papier-300);
  border-radius: 999px;
}

.panel__file-list::-webkit-scrollbar-thumb:hover {
  background: var(--inkt-400);
}

.panel__file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--papier-0);
  border: 1px solid var(--papier-200);
  border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.panel__file:hover {
  border-color: var(--papier-300);
  box-shadow: 0 2px 10px rgba(42, 37, 32, 0.06);
}

.panel__file-thumb {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--papier-200);
  border: 1px solid var(--papier-200);
}

.panel__file-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.panel__file-thumb.is-loading img {
  opacity: 0;
}

.panel__file-thumb.has-error img {
  display: none;
}

.panel__file-thumb-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.panel__file-thumb.is-loading .panel__file-thumb-spinner {
  opacity: 1;
}

.panel__file-thumb-spinner svg {
  animation: panel-spin 0.8s linear infinite;
  transform-origin: center;
}

.panel__spinner-track {
  stroke: var(--papier-300);
}

.panel__spinner-arc {
  stroke: var(--klei-500);
  stroke-dasharray: 26 100;
}

@keyframes panel-spin {
  to {
    transform: rotate(360deg);
  }
}

.panel__file-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.panel__file-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--inkt-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel__file-meta {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 11px;
  color: var(--inkt-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel__file-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.panel__file-progress[hidden] {
  display: none;
}

.panel__file-progress-bar {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--papier-200);
  overflow: hidden;
}

.panel__file-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--klei-500);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.panel__file-progress-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 10px;
  color: var(--inkt-400);
  min-width: 30px;
  text-align: right;
}

.panel__file.is-done .panel__file-progress-fill {
  background: #5b8a6b;
}

.panel__file.is-done .panel__file-progress-label {
  color: #5b8a6b;
}

.panel__file.is-error .panel__file-progress-fill {
  background: #9c4a2e;
}

.panel__file.is-error .panel__file-progress-label {
  color: #9c4a2e;
}

.panel__file.is-uploading .panel__file-meta,
.panel__file.is-done .panel__file-meta,
.panel__file.is-error .panel__file-meta {
  display: none;
}

.panel__file.is-uploading .panel__file-remove,
.panel__file.is-done .panel__file-remove,
.panel__file.is-error .panel__file-remove,
.panel__file-remove:disabled {
  opacity: 0;
  pointer-events: none;
}

.panel__file-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: none;
  border-radius: 5px;
  background: none;
  color: var(--inkt-400);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.panel__file-remove:hover {
  background: var(--papier-200);
  color: var(--inkt-900);
}

.panel__file-remove:focus-visible {
  outline: 2px solid var(--klei-500);
  outline-offset: 2px;
}

.panel__footer {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 40px;
  border-top: 1px solid var(--papier-200);
  background: var(--papier-50);
}

/* Twee losse .panel__footer-blokken (zie het downloadpaneel's stap-1/stap-2
   opzet, client.php) tonen elkaar via het hidden-attribuut — zonder deze
   regel wint .panel__footer's eigen display: flex altijd van de browser's
   ingebouwde [hidden]-stijl (auteur-CSS wint van user-agent-CSS, ongeacht
   specificiteit), dus zouden ze allebei zichtbaar blijven. */
.panel__footer[hidden] {
  display: none;
}

.panel__upload {
  flex: 1;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  color: var(--on-accent);
  background: var(--klei-500);
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

/* Also used as a plain link (account_deleted.php's "Naar de inlogpagina")
   instead of a submit button — same look, but needs its own display/
   text-decoration since <a> isn't a button by default. */
a.panel__upload {
  display: block;
  text-align: center;
  text-decoration: none;
}

.panel__upload:hover:not(:disabled) {
  background: #a85c3d;
}

.panel__upload--danger {
  background: var(--status-red);
}

.panel__upload--danger:hover:not(:disabled) {
  background: #7a3a22;
}

.panel__upload:active:not(:disabled) {
  transform: scale(0.97);
}

.panel__upload:disabled {
  background: var(--papier-300);
  color: var(--inkt-400);
  cursor: not-allowed;
}

.panel__cancel {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  color: var(--inkt-500);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s ease;
}

.panel__cancel:hover {
  color: var(--inkt-900);
}

.panel__upload:focus-visible,
.panel__cancel:focus-visible,
.panel__close:focus-visible,
.page__trigger:focus-visible {
  outline: 2px solid var(--klei-500);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .page {
    padding: 16px;
  }

  .panel {
    left: 0;
    width: auto;
    max-width: none;
    box-shadow: none;
  }

  .panel__close {
    top: calc(14px + env(safe-area-inset-top, 0px));
    right: 14px;
  }

  .panel__content {
    padding: 64px 20px 24px;
    gap: 24px;
  }

  .panel__title h1 {
    font-size: 26px;
  }

  .panel__dropzone {
    padding: 20px 16px;
    gap: 12px;
  }

  .panel__dropzone-icon {
    width: 26px;
    height: 26px;
  }

  .panel__footer {
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    gap: 24px;
  }
}

@media (max-height: 560px) {
  .panel__dropzone.has-files {
    min-height: auto;
  }
}

/* ---------- Support tickets ---------- */

.support-layout {
  max-width: 720px;
}

.support-lead {
  margin: 12px 0 0;
  max-width: 38em;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--inkt-500);
}

.support-card {
  background: var(--papier-0);
  border: 1px solid var(--papier-200);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 20px;
}

.support-form h2 {
  margin: 0 0 16px;
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 22px;
  color: var(--inkt-900);
}

.support-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--inkt-700);
}

.support-field input,
.support-field textarea,
.support-field select {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--papier-300);
  border-radius: 10px;
  background: var(--papier-0);
  color: var(--inkt-900);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
}

.support-field textarea {
  min-height: 120px;
  resize: vertical;
}

.support-field select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%237a6f62' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 12px;
}

.support-new {
  margin-bottom: 20px;
}

.support-row__badges,
.support-detail-bar__badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.support-badge--category {
  color: var(--inkt-700);
  background: var(--papier-100);
}

.support-close {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.support-field input:focus-visible,
.support-field textarea:focus-visible,
.support-field select:focus-visible {
  outline: 2px solid var(--klei-500);
  outline-offset: 1px;
}

.support-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.support-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: var(--papier-0);
  border: 1px solid var(--papier-200);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
}

.support-row:hover {
  border-color: var(--klei-500);
}

.support-row__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.support-row__subject {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  color: var(--inkt-900);
  overflow-wrap: anywhere;
}

.support-row__preview,
.support-row__meta,
.support-note {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  color: var(--inkt-500);
}

.support-note {
  margin: 0 0 16px;
}

.support-badge {
  display: inline-flex;
  align-items: center;
  flex: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.25px;
  text-transform: uppercase;
  padding: 6px 8px;
  border-radius: 4px;
}

.support-badge--open {
  color: var(--status-amber);
  background: var(--status-amber-bg);
}

.support-badge--answered {
  color: var(--status-green);
  background: var(--status-green-bg);
}

.support-badge--closed {
  color: var(--inkt-500);
  background: var(--papier-200);
}

.support-detail-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.support-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.support-msg {
  background: var(--papier-0);
  border: 1px solid var(--papier-200);
  border-radius: 14px;
  padding: 16px 18px;
}

.support-msg--mine {
  background: var(--papier-0);
}

.support-msg--admin,
.admin-page .support-msg--mine {
  background: var(--tint-klei-bg);
  border-color: transparent;
}

.support-msg__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--inkt-500);
}

.support-msg__meta strong {
  color: var(--inkt-900);
  font-weight: 700;
}

.support-msg__body {
  margin: 8px 0 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--inkt-900);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.app-page-header__actions > .support-badge {
  height: auto;
  padding: 6px 8px;
}

.support-actions {
  display: flex;
  gap: 10px;
}

.support-form .admin-btn--primary,
.support-form .app-btn--primary {
  min-height: 44px;
}

@media (max-width: 640px) {
  .support-card {
    padding: 16px;
  }

  .support-actions,
  .support-detail-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .support-actions .app-btn,
  .support-detail-bar .app-btn,
  .support-detail-bar .admin-btn,
  .support-form .admin-btn,
  .support-layout > form .app-btn,
  .support-layout > form .admin-btn {
    width: 100%;
  }
}
