/* === APP PAGE STYLES === */
/* Nav auth-link styles live in theme.css (loaded on ALL pages incl. landing). */

.nav-back {
  margin-left: auto;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: background 0.15s;
}

.nav-back:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.app-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.app-header {
  margin-bottom: 36px;
  text-align: center;
}

.app-title {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.app-sub {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Static disclaimer shown below subtitle — always visible */
.app-disclaimer {
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.app-disclaimer a {
  color: var(--text-muted);
  text-decoration: underline;
}

/* === UPLOAD ZONE === */
.upload-zone {
  width: 100%;
}

.upload-zone-inner {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--white);
  position: relative;
}

.upload-zone-inner:hover,
.upload-zone-inner.drag-over {
  border-color: var(--navy);
  background: var(--bg);
}

.upload-zone-inner.has-file {
  padding: 24px;
}

.upload-icon {
  margin: 0 auto 16px;
  display: block;
}

.upload-primary {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.upload-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* === PREVIEW === */
.preview-container {
  margin-top: 16px;
  text-align: center;
}

.preview-img {
  max-width: 100%;
  max-height: 320px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  object-fit: contain;
}

/* === ANALYZE BUTTON === */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
  padding: 14px 24px;
  background: var(--navy);
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn-primary:hover:not(:disabled) {
  background: var(--navy-light);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spinner {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* === ERROR === */
.error-msg {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  color: #dc2626;
  font-size: 0.875rem;
}

/* === RESULTS === */
.results {
  animation: fadeUp 0.3s ease-out;
}

.results-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.results-check {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: #f0fdf4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.results-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.25rem;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.results-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-ghost {
  margin-left: auto;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-ghost:hover {
  border-color: var(--navy);
  color: var(--navy);
}

/* === RESULT CARDS === */
.result-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 14px;
}

.card-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.card-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--navy);
}

.card-summary {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.7;
}

/* === BILLING CARD (Konto page) === */
.billing-status p + p {
  margin-top: 4px;
}

.billing-plan-button {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--navy);
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.billing-plan-button:hover:not(:disabled) {
  border-color: var(--navy);
  background: var(--bg-alt);
}

.billing-plan-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.billing-plan-popular {
  position: relative;
}

.billing-plan-popular-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--white);
  background: var(--navy);
  padding: 3px 8px;
  border-radius: 100px;
  margin-bottom: 6px;
}

.billing-plan-button--popular {
  border-color: var(--navy);
  border-width: 2px;
}

/* Deadlines */
.deadline-card {
  border-color: #fde68a;
  background: #fffbeb;
}

.deadline-list,
.amount-list,
.next-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.deadline-item {
  font-size: 0.9375rem;
  color: var(--navy);
  font-weight: 500;
  padding: 8px 12px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid #fde68a;
}

/* Amounts */
.amount-card {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.amount-item {
  font-size: 1rem;
  font-weight: 600;
  color: #15803d;
  padding: 8px 12px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid #bbf7d0;
}

/* Next Steps */
.next-card {
  border-color: var(--border);
}

.next-item {
  font-size: 0.9375rem;
  color: var(--text);
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.next-item::before {
  content: '→';
  color: var(--navy);
  font-weight: 600;
  flex-shrink: 0;
}

/* Raw text */
.raw-text-section {
  margin-top: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.raw-toggle {
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.raw-toggle:hover {
  color: var(--text);
}

.raw-content {
  padding: 16px;
  font-family: 'DM Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
}

/* Utility */
.hidden { display: none !important; }

/* Visually hidden (accessible label) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles — visible outline for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 2px;
}

/* === LOADING TIME HINT === */
.upload-time-hint {
  margin-top: 8px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

/* === RESULTS DISCLAIMER === */
.results-disclaimer {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  line-height: 1.5;
}

.results-disclaimer a {
  color: var(--text-muted);
  text-decoration: underline;
}

/* === DEADLINE OBJECT FORM === */
.deadline-main {
  display: block;
  font-weight: 500;
}

.deadline-basis {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
  font-family: 'DM Mono', monospace;
}

/* Verified norms list — shown under legalBasis when DB confirms the citation */
.deadline-verified-list {
  list-style: none;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.deadline-verified-item {
  font-size: 0.75rem;
  font-weight: 400;
}

.deadline-verified-link {
  color: #15803d; /* muted green, same as amount-item */
  text-decoration: none;
  opacity: 0.85;
  font-family: 'DM Mono', monospace;
  word-break: break-word;
}

.deadline-verified-link:hover {
  text-decoration: underline;
  opacity: 1;
}

/* === REMINDER OPT-IN (one per deadline, archive detail) === */
.reminder-optin {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}

.reminder-optin:hover {
  background: #fef3c7;
  border-color: #fcd34d;
}

/* Checked state on the whole row — progressive enhancement, the box + copy
   below already carry the state on browsers without :has(). */
.reminder-optin:has(.reminder-optin-input:checked) {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.reminder-optin-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.reminder-optin-box {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid #d97706;
  border-radius: 6px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.reminder-optin-box svg {
  opacity: 0;
  transition: opacity 0.12s;
}

.reminder-optin-input:checked + .reminder-optin-box {
  background: #16a34a;
  border-color: #16a34a;
}

.reminder-optin-input:checked + .reminder-optin-box svg {
  opacity: 1;
}

.reminder-optin-input:focus-visible + .reminder-optin-box {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.reminder-optin-input:disabled + .reminder-optin-box {
  opacity: 0.5;
}

.reminder-optin-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reminder-optin-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
}

.reminder-optin-hint {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.45;
}

.reminder-optin-hint--on {
  display: none;
  color: #15803d;
}

.reminder-optin-input:checked ~ .reminder-optin-text .reminder-optin-hint--off {
  display: none;
}

.reminder-optin-input:checked ~ .reminder-optin-text .reminder-optin-hint--on {
  display: block;
}

/* Bell follows the state colour of the row */
.reminder-optin-input:checked ~ .reminder-optin-text .reminder-optin-title svg path {
  stroke: #15803d;
}

.reminder-optin-sent {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.75rem;
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 100px;
  padding: 2px 10px;
}

/* === LETTER TYPE BADGE === */
.card-sender-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.letter-type-badge {
  display: inline-block;
  padding: 3px 10px;
  background: var(--navy);
  color: var(--white);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 100px;
}

/* === REMINDER CARD === */
.reminder-card {
  border-color: #c7d2fe;
  background: #eef2ff;
}

.reminder-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.reminder-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 10px;
}

.reminder-email-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--navy);
  background: var(--white);
  min-width: 0;
}

.reminder-email-input:focus {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
  border-color: var(--amber);
}

.btn-reminder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--navy);
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}

.btn-reminder:hover:not(:disabled) {
  background: var(--navy-light);
}

.btn-reminder:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.reminder-consent-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.reminder-checkbox {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--navy);
  cursor: pointer;
}

.reminder-consent-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  cursor: pointer;
}

.reminder-consent-label a {
  color: var(--navy);
  text-decoration: underline;
}

.reminder-success {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  color: #15803d;
}

@media (max-width: 480px) {
  .reminder-input-row {
    flex-direction: column;
  }

  .btn-reminder {
    width: 100%;
  }
}

/* === LEGAL PAGES === */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.legal-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.legal-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.legal-section {
  margin-bottom: 36px;
}

.legal-section h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.25rem;
  color: var(--navy);
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  padding-top: 8px;
}

.legal-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  margin-top: 20px;
  margin-bottom: 8px;
}

.legal-section p {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.75;
  margin-bottom: 12px;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section a {
  color: var(--navy);
  text-decoration: underline;
}

.legal-section a:hover {
  color: var(--amber);
}

.legal-list {
  list-style: disc;
  padding-left: 1.5em;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.legal-list li {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.65;
}

/* Highlight box for important legal section */
.legal-section--highlight {
  padding: 24px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-lg);
}

.legal-section--highlight h2 {
  color: #92400e;
}

.legal-section--highlight p {
  color: #78350f;
}

/* Inline highlight within datenschutz */
.legal-highlight {
  padding: 14px 16px;
  background: var(--bg-alt);
  border-left: 3px solid var(--amber);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9375rem !important;
  color: var(--text) !important;
}

/* === REPLY DRAFT CARD === */
.reply-card {
  border-color: #c7d2fe;
  background: #f5f7ff;
}

.reply-intro {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 14px;
}


.reply-note-label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

/* visually hidden label — displayed via placeholder; shown for screen readers */
.reply-note-label {
  /* keep accessible but visually subtle */
  clip: auto;
  overflow: visible;
  width: auto;
  height: auto;
  position: static;
  margin: 0 0 6px;
  white-space: normal;
}

.reply-note-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--navy);
  background: var(--white);
  resize: vertical;
  min-height: 72px;
  box-sizing: border-box;
  margin-bottom: 12px;
}

.reply-note-input:focus {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
  border-color: var(--amber);
}

.btn-reply {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: var(--navy);
  color: var(--white);
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn-reply:hover:not(:disabled) {
  background: var(--navy-light);
}

.btn-reply:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.reply-result-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  margin-top: 4px;
}

.reply-type-badge {
  display: inline-block;
  padding: 3px 10px;
  background: #1a2744;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 100px;
  flex-shrink: 0;
  margin-top: 2px;
}

.reply-subject {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.4;
}

.reply-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9375rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  line-height: 1.75;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  max-height: 480px;
  overflow-y: auto;
}

.reply-hints {
  margin-bottom: 12px;
}

.reply-hints-heading {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

.reply-hints-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: -4px 0 10px;
}

.reply-hints-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Each checklist item is a real, tickable checkbox — the tick is client-side
   only (never persisted); the copy in .reply-hints-sub says so. */
.reply-hint-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}

.reply-hint-label:hover {
  background: var(--bg-alt);
  border-color: #cbd5e1;
}

.reply-hint-check {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.reply-hint-box {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1.5px solid #94a3b8;
  border-radius: 5px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.reply-hint-box svg {
  opacity: 0;
  transition: opacity 0.12s;
}

.reply-hint-check:checked + .reply-hint-box {
  background: #16a34a;
  border-color: #16a34a;
}

.reply-hint-check:checked + .reply-hint-box svg {
  opacity: 1;
}

.reply-hint-check:focus-visible + .reply-hint-box {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.reply-hint-text {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.5;
}

.reply-hint-check:checked ~ .reply-hint-text {
  color: var(--text-muted);
  text-decoration: line-through;
}

.reply-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.btn-copy {
  padding: 8px 18px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--navy);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-copy:hover:not(:disabled) {
  background: var(--bg-alt);
  border-color: var(--navy);
}

.btn-copy:disabled {
  color: #16a34a;
  border-color: #bbf7d0;
  background: #f0fdf4;
  cursor: default;
}

.reply-not-saved-warning {
  font-size: 0.875rem;
  font-weight: 600;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
}

.reply-disclaimer {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 8px 12px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.reply-disclaimer a {
  color: var(--text-muted);
  text-decoration: underline;
}

/* === RDG / EU-AI-ACT UI ELEMENTS === */

/* Pre-use disclaimer — visible above the analyze button (RDG requirement) */
.pre-use-disclaimer {
  margin-top: 14px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.55;
  text-align: center;
  padding: 8px 12px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* AI label badge — EU AI Act Art. 50 transparency marker */
.ai-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
}

/* Deadline footnote — legal-check caveat */
.deadline-footnote {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

@media (max-width: 480px) {
  .app-container {
    padding: 32px 16px 60px;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .btn-ghost {
    margin-left: 0;
    width: 100%;
  }

  .legal-page {
    padding: 32px 16px 60px;
  }
}

/* === ANALYSIS PROGRESS CARD === */
.progress-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 0;
}

/* Slim progress bar across the top */
.progress-bar-track {
  height: 3px;
  background: var(--bg-alt);
  width: 100%;
}

.progress-bar-fill {
  height: 100%;
  background: var(--amber);
  border-radius: 0 2px 2px 0;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

@media (prefers-reduced-motion: reduce) {
  .progress-bar-fill {
    transition: none;
  }
}

.progress-card-inner {
  padding: 24px 24px 20px;
}

/* Small thumbnail shown above stages */
.progress-thumb {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.progress-thumb-img {
  width: 36px;
  height: 44px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.progress-thumb-icon {
  width: 36px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border-radius: 3px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.progress-thumb-name {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

/* Stage list */
.progress-stages {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-stage {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  transition: opacity 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  .progress-stage {
    transition: none;
  }
}

/* Stage icon area: 20×20 circle */
.stage-icon-wrap {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Pending state: hollow circle */
.stage-icon-wrap .stage-pending-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
}

/* Active state: amber pulsing dot */
.stage-icon-wrap .stage-active-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .progress-stage[data-state="active"] .stage-active-dot {
    animation: stagePulse 1.4s ease-in-out infinite;
  }
}

@keyframes stagePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.75); }
}

/* Done state: green checkmark SVG */
.stage-icon-wrap .stage-done-check {
  display: none;
}

/* State: pending (default) */
.progress-stage[data-state="pending"] {
  opacity: 0.45;
}
.progress-stage[data-state="pending"] .stage-pending-dot { display: block; }
.progress-stage[data-state="pending"] .stage-active-dot { display: none; }
.progress-stage[data-state="pending"] .stage-done-check { display: none; }

/* State: active */
.progress-stage[data-state="active"] {
  opacity: 1;
}
.progress-stage[data-state="active"] .stage-pending-dot { display: none; }
.progress-stage[data-state="active"] .stage-active-dot { display: block; }
.progress-stage[data-state="active"] .stage-done-check { display: none; }

/* State: done */
.progress-stage[data-state="done"] {
  opacity: 0.6;
}
.progress-stage[data-state="done"] .stage-pending-dot { display: none; }
.progress-stage[data-state="done"] .stage-active-dot { display: none; }
.progress-stage[data-state="done"] .stage-done-check { display: flex; }

/* Stage label */
.stage-label {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.4;
}

.progress-stage[data-state="active"] .stage-label {
  font-weight: 600;
  color: var(--navy);
}

.progress-stage[data-state="done"] .stage-label {
  font-weight: 400;
  color: var(--text-muted);
}

.progress-stage[data-state="pending"] .stage-label {
  font-weight: 400;
  color: var(--text-muted);
}

/* Slow note shown after ~35s */
.progress-slow-note {
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* === INLINE PROGRESS CARD (reply draft) === */
/* Compact variant: no thumbnail section, fits inside a result card */
.progress-card--inline {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  margin-top: 0;
}

.progress-card--inline .progress-bar-track {
  border-radius: 2px;
  margin-bottom: 16px;
}

.progress-card--inline .progress-card-inner {
  padding: 0;
}

.progress-card--inline .progress-stages {
  gap: 6px;
}

.progress-card--inline .progress-stage {
  padding: 5px 0;
  gap: 10px;
}

.progress-card--inline .stage-label {
  font-size: 0.875rem;
}

.progress-card--inline .progress-slow-note {
  margin-top: 12px;
  font-size: 0.8125rem;
}


/* === NOTICE BANNERS (WP-Q) === */

.notice-banner {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 12px;
}

.notice-banner--success {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.notice-banner--info {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

/* ===================================================================
   ARCHIVE (WP-R)
   =================================================================== */

/* === ARCHIVE LIST === */

.archive-empty {
  text-align: center;
  padding: 48px 24px;
  background: var(--white);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.archive-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.archive-row:hover {
  border-color: var(--navy);
  box-shadow: 0 2px 8px rgba(26,39,68,0.07);
}

.archive-row-main {
  flex: 1;
  min-width: 0;
}

.archive-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.archive-row-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.archive-badge {
  font-size: 0.625rem;
  padding: 2px 8px;
}

.archive-row-sender {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archive-row-lastaction {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.archive-row-retention {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.archive-row-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.archive-deadline-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #92400e;
  white-space: nowrap;
}

/* Lock badge — amber, used in list and detail meta */
.archive-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #92400e;
  white-space: nowrap;
}

/* Quota-lock badge — distinct from the age-based .archive-lock-badge (amber):
   shown when a Vorgang was never unlocked (no credit consumed yet). */
.archive-quota-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #b91c1c;
  white-space: nowrap;
}

/* Active status badge — green pill */
.archive-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.archive-status-badge--active {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.archive-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* === ARCHIVE LOCK CARD (detail — locked state) === */

.archive-lock-card {
  text-align: center;
  padding: 40px 32px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
}

.archive-lock-icon {
  margin: 0 auto 16px;
}

.archive-lock-heading {
  font-family: 'DM Serif Display', serif;
  font-size: 1.25rem;
  color: #92400e;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.archive-lock-text {
  font-size: 0.9375rem;
  color: #78350f;
  line-height: 1.6;
  margin-bottom: 12px;
}

.archive-lock-cta-text {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #92400e;
  line-height: 1.5;
}

/* === ARCHIVE REPLIES LIST (detail — stored drafts) === */

.archive-replies-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.archive-reply-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}

.archive-reply-item[open] {
  border-color: #c7d2fe;
}

.archive-reply-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  font-size: 0.875rem;
  color: var(--navy);
  list-style: none;
  flex-wrap: wrap;
}

.archive-reply-summary::-webkit-details-marker {
  display: none;
}

.archive-reply-summary::before {
  content: '▶';
  font-size: 0.625rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.15s;
}

details[open] > .archive-reply-summary::before {
  transform: rotate(90deg);
}

.archive-reply-subject {
  flex: 1;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-reply-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

.archive-reply-body {
  padding: 16px;
  border-top: 1px solid var(--border);
  background: #f5f7ff;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .archive-row {
    padding: 12px 14px;
  }

  .archive-row-sender {
    font-size: 0.875rem;
  }

  .archive-lock-card {
    padding: 28px 20px;
  }

  .archive-reply-summary {
    gap: 6px;
  }
}

/* ===================================================================
   WP-Q2 — Paywall redesign + warning banner
   Overrides the WP-Q skeleton/CTA rules above. These definitions
   appear last and win on all selectors that were redefined.
   =================================================================== */

/* === WARNING BANNER === */

.warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 3px solid #dc2626;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}

.warning-banner-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.warning-banner-text {
  font-size: 0.9375rem;
  color: #991b1b;
  line-height: 1.55;
  margin: 0;
}

.warning-banner-text strong {
  font-weight: 700;
}

/* === PAYWALL BLOCK REDESIGN (WP-Q2) === */
/* Strategy: skeleton is absolutely-positioned background layer.
   CTA card is in-flow → drives container height → nothing clips. */

.paywall-block {
  position: relative;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  /* no overflow:hidden — that was the clipping cause */
  overflow: visible;
}

/* Skeleton: absolute fill behind the CTA card */
.paywall-skeleton {
  position: absolute;
  inset: 0;
  padding: 24px 24px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  filter: blur(3px);
  user-select: none;
  pointer-events: none;
  overflow: hidden;
}

/* Fade-out gradient at bottom of skeleton */
.paywall-skeleton::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to bottom, transparent, var(--bg-alt));
  pointer-events: none;
}

.skeleton-line {
  height: 13px;
  background: var(--text-muted);
  opacity: 0.22;
  border-radius: 4px;
  margin-bottom: 14px;
}
.skeleton-line--long   { width: 88%; }
.skeleton-line--medium { width: 62%; }
.skeleton-line--short  { width: 38%; }

/* Fake card stub inside skeleton */
.skeleton-card-stub {
  height: 64px;
  background: var(--white);
  opacity: 0.5;
  border-radius: var(--radius);
  margin-top: 8px;
  border: 1px solid var(--border);
}

/* CTA card — in-flow, on top of skeleton via stacking context */
.paywall-cta {
  position: relative;      /* creates stacking context above absolute skeleton */
  z-index: 1;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
  padding: 28px 28px 24px;
  text-align: center;
  max-width: 440px;
  margin: 24px auto 0;      /* space above so skeleton peeks out at top */
}

/* Lock icon circle */
.paywall-lock-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fef3c7;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

/* Heading */
.paywall-heading {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1875rem;
  font-weight: 400;
  color: var(--navy);
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0 0 8px;
}

/* Quota-exhausted message — shown instead of the register/login CTA copy
   when lockedReason==='quota_exhausted' (logged-in user, no credit left) */
.paywall-quota-message {
  font-size: 0.9375rem;
  color: #78350f;
  line-height: 1.5;
  margin: 0 0 12px;
}

/* Stats line */
.paywall-stats {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0 0 16px;
  letter-spacing: 0.01em;
  min-height: 1em; /* reserve space even when empty */
}

/* Benefits list */
.paywall-benefits {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  text-align: left;
  width: 100%;
}

.paywall-benefits li {
  font-size: 0.875rem;
  color: var(--text);
  padding: 5px 0 5px 22px;
  position: relative;
  line-height: 1.45;
}

.paywall-benefits li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #16a34a;
  font-weight: 700;
  font-size: 0.9375rem;
}

/* Actions */
.paywall-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: 100%;
}

/* Primary CTA — amber, full width */
.paywall-btn-primary {
  display: block;
  width: 100%;
  padding: 13px 20px;
  background: var(--amber);
  color: var(--navy);
  font-size: 0.9375rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 0.15s, opacity 0.15s;
  letter-spacing: 0.01em;
  box-sizing: border-box;
}

.paywall-btn-primary:hover {
  background: #d97706;
  color: var(--white);
}

/* Secondary text link */
.paywall-btn-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color 0.15s;
}

.paywall-btn-text:hover {
  color: var(--navy);
}

/* Remove old paywall-btn / paywall-btn-secondary in this context */
/* (the old classes stay in the DOM for any cached HTML but no longer used in WP-Q2) */

/* === MOBILE: paywall + warning === */
@media (max-width: 480px) {
  .paywall-cta {
    max-width: 100%;
    padding: 20px 18px;
    margin: 20px 0 0;
  }

  .paywall-btn-primary {
    padding: 13px 16px;
  }

  .warning-banner {
    padding: 12px 14px;
    gap: 10px;
  }

  .warning-banner-text {
    font-size: 0.875rem;
  }
}

/* Note shown to non-German readers: the reply draft itself stays German
   (views/upload.ejs, key lang.germanOnlyNotice). */
.reply-lang-note {
  margin: -4px 0 14px;
  padding: 8px 12px;
  border-inline-start: 3px solid var(--amber, #f59e0b);
  background: #fffbeb;
  border-radius: 0 var(--radius, 6px) var(--radius, 6px) 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #92400e;
}

/* Notice on the German-only legal pages for readers in another language
   (views/partials/legal-notice.ejs). */
.legal-lang-notice {
  margin: 0 0 28px;
  padding: 14px 18px;
  border-inline-start: 3px solid var(--amber, #f59e0b);
  background: #fffbeb;
  border-radius: 0 var(--radius-lg, 10px) var(--radius-lg, 10px) 0;
}

.legal-lang-notice-heading {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9375rem;
  color: #92400e;
}

.legal-lang-notice-body {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #92400e;
}
