:root {
  --font-sans: var(--sd-font-sans, "Inter", "Avenir Next", "Segoe UI", sans-serif);
  --font-display: "Manrope", "Segoe UI", sans-serif;
  --bg-base: #f4f7fb;
  --bg-secondary: #eef3f9;
  --surface: rgba(255, 255, 255, 0.7);
  --surface-strong: rgba(255, 255, 255, 0.88);
  --surface-soft: rgba(255, 255, 255, 0.54);
  --surface-muted: rgba(237, 242, 250, 0.9);
  --surface-border: rgba(255, 255, 255, 0.72);
  --surface-line: rgba(154, 170, 196, 0.2);
  --text-main: #182233;
  --text-soft: #5a6578;
  --text-faint: #7b8497;
  --accent: #2858e8;
  --accent-strong: #163fc0;
  --accent-soft: rgba(40, 88, 232, 0.12);
  --accent-alt: #1da88f;
  --success: #1f9d65;
  --success-soft: rgba(31, 157, 101, 0.14);
  --danger: #d74b61;
  --danger-soft: rgba(215, 75, 97, 0.14);
  --warning: #d39a20;
  --warning-soft: rgba(211, 154, 32, 0.14);
  --info: #1481d7;
  --info-soft: rgba(20, 129, 215, 0.12);
  --radius-sm: 16px;
  --radius-md: 22px;
  --radius-lg: 30px;
  --shadow-soft: 0 24px 64px rgba(21, 37, 72, 0.12);
  --shadow-strong: 0 30px 80px rgba(12, 22, 42, 0.2);
  --sperr-global-header-h: 44px;
}

body.sd-theme-light {
  --bg-base: #f5f7fb;
  --bg-secondary: #eef2f8;
  --surface: rgba(255, 255, 255, 0.66);
  --surface-strong: rgba(255, 255, 255, 0.84);
  --surface-soft: rgba(255, 255, 255, 0.48);
  --surface-muted: rgba(237, 242, 250, 0.84);
  --surface-border: rgba(28, 45, 37, 0.14);
  --surface-line: rgba(28, 45, 37, 0.14);
  --text-main: #162033;
  --text-soft: #5f6980;
  --text-faint: #7f8796;
  --accent: var(--sd-accent, #238b4b);
  --accent-strong: var(--sd-accent-strong, #166637);
  --accent-soft: rgba(35, 139, 75, 0.12);
  --shadow-soft: var(--sd-shadow-sm, 0 24px 60px rgba(21, 37, 72, 0.14));
  --shadow-strong: var(--sd-shadow-md, 0 26px 70px rgba(12, 22, 42, 0.22));
}

body.sd-theme-dark {
  --bg-base: #0d1015;
  --bg-secondary: #151920;
  --surface: rgba(20, 24, 31, 0.74);
  --surface-strong: rgba(24, 28, 36, 0.9);
  --surface-soft: rgba(34, 39, 49, 0.68);
  --surface-muted: rgba(36, 41, 51, 0.92);
  --surface-border: rgba(218, 238, 228, 0.14);
  --surface-line: rgba(218, 238, 228, 0.14);
  --text-main: #edf1f7;
  --text-soft: #a7b0c0;
  --text-faint: #7d8698;
  --accent: var(--sd-accent, #58d982);
  --accent-strong: var(--sd-accent-strong, #8bf0a8);
  --accent-soft: rgba(88, 217, 130, 0.16);
  --accent-alt: #6bc3b3;
  --success: #5fcb91;
  --success-soft: rgba(95, 203, 145, 0.14);
  --danger: var(--sd-danger, #ff7a8b);
  --danger-soft: rgba(255, 122, 139, 0.16);
  --warning: #edb85b;
  --warning-soft: rgba(237, 184, 91, 0.14);
  --info: #75b8ff;
  --info-soft: rgba(117, 184, 255, 0.14);
  --shadow-soft: var(--sd-shadow-sm, 0 26px 70px rgba(0, 0, 0, 0.34));
  --shadow-strong: var(--sd-shadow-md, 0 36px 90px rgba(0, 0, 0, 0.52));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1000px 500px at 12% 0%, rgba(40, 88, 232, 0.08), transparent 60%),
    radial-gradient(900px 520px at 88% 8%, rgba(29, 168, 143, 0.08), transparent 54%),
    linear-gradient(180deg, #fbfcfe 0%, var(--bg-base) 28%, var(--bg-secondary) 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
  pointer-events: none;
  z-index: -1;
}

body.nav-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

canvas {
  display: block;
  margin: 12px auto;
  max-width: 260px;
  background: rgba(255, 255, 255, 0.74);
  border-radius: 50%;
  box-shadow: var(--shadow-soft);
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

p,
ul,
ol {
  margin-top: 0;
}

.app-shell {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 28px 0 44px;
  flex: 1;
}

.is-login-screen .app-shell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.is-login-screen .container {
  max-width: 560px;
}

.container {
  width: 100%;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1200;
  padding: 16px 16px 0;
}

.header-bar,
.footer-bar {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: var(--surface);
  backdrop-filter: blur(22px) saturate(150%);
  box-shadow: var(--shadow-soft);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: var(--text-main);
}

.brand-lockup:hover {
  color: var(--text-main);
}

.brand-mark {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(230, 237, 248, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7px;
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-copy small {
  display: block;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quick-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--surface-border);
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.quick-pill-accent {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
}

.burger-btn,
.drawer-close,
.footer-link,
.nav-link-button {
  appearance: none;
  font: inherit;
}

.burger-btn {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  border: 1px solid var(--surface-border);
  background: linear-gradient(145deg, var(--surface-strong), rgba(230, 236, 247, 0.84));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.burger-btn span {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--text-main);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

body.nav-open .burger-btn span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.nav-open .burger-btn span:nth-child(2) {
  opacity: 0;
}

body.nav-open .burger-btn span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 20, 33, 0.24);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 1250;
}

body.nav-open .nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.nav-drawer {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: min(420px, calc(100vw - 32px));
  transform: translateX(108%);
  transition: transform 0.26s ease;
  z-index: 1300;
}

body.nav-open .nav-drawer {
  transform: translateX(0);
}

.nav-drawer-panel {
  height: 100%;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
  background: var(--surface-strong);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(28px) saturate(160%);
}

.nav-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.nav-drawer-head h2 {
  margin: 2px 0 0;
  font-size: 1.5rem;
  line-height: 1.1;
}

.drawer-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: var(--surface-muted);
  color: var(--text-main);
  cursor: pointer;
  font-size: 1.9rem;
  line-height: 1;
}

.nav-section {
  display: grid;
  gap: 12px;
}

.nav-section-last {
  margin-top: auto;
}

.nav-section-title {
  margin: 0;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 800;
}

.nav-grid {
  display: grid;
  gap: 10px;
}

.nav-link,
.nav-link-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--surface-line);
  background: var(--surface-soft);
  color: var(--text-main);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.nav-link:hover,
.nav-link.active,
.nav-link-button:hover {
  transform: translateY(-1px);
  background: var(--accent-soft);
  border-color: rgba(43, 108, 255, 0.18);
  color: var(--text-main);
}

.nav-link-danger {
  color: var(--danger);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.logo {
  display: block;
  margin: 0 auto 12px;
  max-height: 92px;
  width: auto;
  padding: 12px 18px;
  border-radius: 24px;
  background: var(--surface-strong);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-soft);
}

.title {
  display: table;
  margin: 0 auto 18px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.title h3 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.card {
  width: 100%;
  max-width: 100%;
  margin: 0 auto 16px;
  padding: clamp(18px, 2.4vw, 30px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(24px) saturate(160%);
}

.card.narrow {
  max-width: 560px;
}

.thread-card .title {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.center,
.form-center {
  text-align: center;
}

label {
  display: block;
  margin: 0 0 8px;
  color: var(--text-main);
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  margin: 0 0 14px;
  padding: 13px 14px;
  border-radius: 18px;
  border: 1px solid var(--surface-line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-main);
  font: inherit;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.44);
}

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

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(43, 108, 255, 0.42);
  box-shadow: 0 0 0 4px rgba(43, 108, 255, 0.11);
}

button:not(.footer-link):not(.drawer-close):not(.nav-link-button):not(.modal-close):not(.burger-btn),
.btn,
.btn-export,
.btn-download,
.btn-linkpage,
.edit-btn,
.toggle-btn,
.danger,
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 16px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.18s ease, filter 0.18s ease, background 0.18s ease;
}

button:not(.footer-link):not(.drawer-close):not(.nav-link-button):not(.modal-close):not(.burger-btn),
.btn,
.btn-export,
.btn-download {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
}

.btn-linkpage,
.edit-btn {
  background: linear-gradient(135deg, #1c2637, #33445f);
  color: #fff;
}

.toggle-btn.active {
  background: linear-gradient(135deg, #1f9d65, #13794b);
  color: #fff;
}

.toggle-btn.inactive,
.danger,
button.danger {
  background: linear-gradient(135deg, var(--danger), #af3047);
  color: #fff;
}

button:hover,
.btn:hover,
.btn-export:hover,
.btn-download:hover,
.btn-linkpage:hover,
.edit-btn:hover,
.toggle-btn:hover,
.danger:hover,
.page-link:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-strong);
  font-weight: 700;
}

.btn-link.danger {
  color: var(--danger);
}

.form-actions,
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.flash-card {
  margin: 0 auto 16px;
  padding: 15px 18px;
  border-radius: 20px;
  border: 1px solid transparent;
  box-shadow: var(--shadow-soft);
  font-weight: 700;
  background: var(--surface-strong);
}

.flash-card.success {
  background: rgba(31, 157, 101, 0.1);
  border-color: rgba(31, 157, 101, 0.22);
  color: #155c3d;
}

.flash-card.error {
  background: rgba(215, 75, 97, 0.11);
  border-color: rgba(215, 75, 97, 0.18);
  color: #8f2237;
}

.flash-card.info {
  background: rgba(20, 129, 215, 0.1);
  border-color: rgba(20, 129, 215, 0.16);
  color: #105f9d;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.badge.verified {
  background: var(--success-soft);
  color: var(--success);
}

.badge.not-verified {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.badge.inactive {
  background: rgba(117, 126, 145, 0.12);
  color: var(--text-soft);
}

.badge.old {
  background: var(--warning-soft);
  color: #8a6110;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--surface-line);
  background: var(--surface-strong);
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

.chip-active {
  background: var(--accent-soft);
  border-color: rgba(43, 108, 255, 0.2);
  color: var(--accent-strong);
}

.per-buttons,
.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-form {
  display: grid;
  gap: 12px;
}

.search-row,
.reply-box {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.search-row input[type="text"],
.reply-box textarea {
  flex: 1;
  margin-bottom: 0;
}

.reply-box button,
.search-row button {
  flex: 0 0 auto;
}

.result-info,
.hint-text,
.muted,
.thread-info,
.download-info p,
.meta {
  color: var(--text-soft);
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.page-link {
  background: var(--surface-strong);
  border: 1px solid var(--surface-line);
  color: var(--text-main);
}

.page-link.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  border-color: transparent;
}

.thread-list {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.thread-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.thread-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--surface-line);
}

.message-thread {
  border-radius: 24px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.message {
  max-width: min(72%, 720px);
  margin: 8px 0;
  padding: 12px 14px;
  border-radius: 18px;
  clear: both;
}

.message.me {
  margin-left: auto;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
}

.message.other {
  margin-right: auto;
  background: var(--surface-muted);
}

.message small {
  display: block;
  margin-top: 6px;
  opacity: 0.78;
  font-size: 0.76rem;
}

.delete-form {
  margin: 0;
}

.delete-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--danger), #af3047);
  color: #fff;
}

#strength-text,
#match {
  margin: 8px 0 10px;
  font-weight: 700;
}

.strength-bar {
  height: 10px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(176, 186, 205, 0.22);
  overflow: hidden;
}

.strength-bar-inner {
  height: 100%;
  width: 0;
  transition: width 0.24s ease, background 0.24s ease;
}

.download-card {
  position: relative;
}

.download-content {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.download-thumb {
  flex: 0 0 132px;
  width: 132px;
  height: 176px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--surface-line);
  background: var(--surface-muted);
}

.download-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.no-image {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--text-faint);
  font-size: 0.82rem;
}

.download-info {
  flex: 1;
}

.download-info h4 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.download-actions {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 8px;
}

.profile-pic-preview {
  width: 148px;
  height: 148px;
  object-fit: cover;
  border-radius: 999px;
  display: block;
  margin: 0 auto 12px;
  border: 3px solid rgba(255, 255, 255, 0.82);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 22px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--surface-line);
  white-space: nowrap;
}

.data-table th {
  color: var(--text-soft);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.storage-bar {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(176, 186, 205, 0.22);
}

.storage-bar > div,
.storage-bar .used {
  height: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.storage-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 6px;
  background: var(--accent);
}

.fullwidth {
  width: 100%;
}

.inline {
  display: inline;
}

.disclaimer {
  color: var(--text-soft);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(12, 18, 31, 0.32);
  backdrop-filter: blur(10px);
  z-index: 2000;
}

.modal-content {
  position: relative;
  width: min(760px, 100%);
  max-height: min(78vh, 860px);
  padding: 26px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
  background: var(--surface-strong);
  box-shadow: var(--shadow-strong);
  overflow: hidden;
}

.modal-content h3 {
  margin: 0 0 16px;
}

.modal-scroll {
  max-height: calc(78vh - 90px);
  overflow-y: auto;
  padding-right: 4px;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--surface-muted);
  color: var(--text-main);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.site-footer {
  margin-top: auto;
  padding: 0 16px 18px;
}

.is-login-screen .site-footer {
  position: sticky;
  bottom: 0;
  z-index: 1100;
}

.footer-brand {
  display: grid;
  gap: 2px;
}

.footer-brand strong {
  font-size: 0.96rem;
}

.footer-brand span {
  color: var(--text-soft);
  font-size: 0.88rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid var(--surface-line);
  background: var(--surface-strong);
  color: var(--text-main);
  cursor: pointer;
  text-decoration: none;
}

.footer-link:hover {
  background: var(--accent-soft);
  color: var(--text-main);
}

.mail-protect a {
  color: var(--accent-strong);
}

.page-content {
  width: 100%;
}

@media (max-width: 900px) {
  .site-header {
    position: relative;
    padding: 12px 10px 0;
  }

  .is-login-screen .site-header {
    position: sticky;
    top: 0;
    z-index: 1300;
  }

  .header-bar,
  .footer-bar {
    width: calc(100% - 20px);
  }

  .header-bar {
    padding: 12px 14px;
  }

  .app-shell {
    width: calc(100% - 20px);
    padding: 14px 0 24px;
  }

  .is-login-screen .app-shell {
    align-items: flex-start;
  }

  .container {
    min-width: 0;
  }

  .brand-copy small,
  .quick-pill {
    display: none;
  }

  .nav-drawer {
    top: 10px;
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }

  .nav-drawer-panel {
    padding: 18px;
  }

  .logo {
    max-height: 68px;
    padding: 8px 14px;
  }

  .title {
    width: 100%;
    border-radius: 22px;
    padding: 12px 14px;
  }

  .card {
    padding: 16px;
    border-radius: 24px;
  }

  .form-actions,
  .flex-between,
  .search-row,
  .reply-box,
  .download-content {
    flex-direction: column;
    align-items: stretch;
  }

  .message {
    max-width: 100%;
  }

  .download-thumb {
    width: 100%;
    flex-basis: auto;
    height: 180px;
  }

  .download-actions {
    position: static;
    margin-top: 10px;
  }

  .table-wrapper {
    border-radius: 18px;
  }

  .site-footer {
    display: none;
  }

  .is-login-screen .site-footer {
    display: block;
    position: sticky;
    bottom: 0;
    z-index: 1200;
    padding: 10px 10px max(10px, env(safe-area-inset-bottom));
  }

  .is-login-screen .footer-bar {
    width: 100%;
    border-radius: 20px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  .brand-copy strong {
    font-size: 0.94rem;
  }

  .nav-drawer-head h2 {
    font-size: 1.3rem;
  }

  .modal {
    padding: 12px;
  }

  .modal-content {
    padding: 20px 16px;
  }
}

/* Shared Schnueddels UI bridge */
body.sd-has-global-header .site-header {
  top: var(--sperr-global-header-h);
}

body.sd-has-global-header .nav-backdrop {
  top: var(--sperr-global-header-h);
}

body.sd-has-global-header .nav-drawer {
  top: calc(var(--sperr-global-header-h) + 16px);
}

.header-bar,
.footer-bar,
.nav-drawer-panel,
.card,
.thread-card,
.message-thread,
.table-wrapper,
.modal-content,
.logo,
.title,
.flash-card {
  border-color: var(--sd-border, var(--surface-border));
  box-shadow: var(--sd-shadow-sm, var(--shadow-soft));
}

.header-bar,
.footer-bar,
.nav-drawer-panel,
.card,
.thread-card,
.message-thread,
.table-wrapper,
.modal-content,
.logo,
.title,
.flash-card {
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
}

.nav-link,
.nav-link-button,
.quick-pill,
.footer-link,
.drawer-close,
.burger-btn,
.page-link,
.chip {
  border-color: var(--sd-border, var(--surface-line));
  border-radius: var(--sd-radius-lg, 14px);
}

button:not(.footer-link):not(.drawer-close):not(.nav-link-button):not(.modal-close):not(.burger-btn),
.btn,
.btn-export,
.btn-download,
.btn-linkpage,
.edit-btn,
.toggle-btn,
.danger,
.page-link {
  border-radius: var(--sd-radius-md, 8px);
}

button:not(.footer-link):not(.drawer-close):not(.nav-link-button):not(.modal-close):not(.burger-btn),
.btn,
.btn-export,
.btn-download,
.quick-pill-accent,
.nav-badge,
.page-link.active,
.message.me,
.storage-bar > div,
.storage-bar .used {
  background: var(--sd-accent, var(--accent));
  color: var(--sd-accent-ink, #fff);
}

.btn-linkpage,
.edit-btn {
  background: var(--sd-surface-2, #1d2738);
  color: var(--sd-text, #fff);
  border: 1px solid var(--sd-border, transparent);
}

.toggle-btn.active {
  background: color-mix(in srgb, var(--sd-accent, var(--success)) 18%, transparent);
  color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 35%, transparent);
}

.toggle-btn.inactive,
.danger,
button.danger,
.delete-btn {
  background: color-mix(in srgb, var(--sd-danger, var(--danger)) 16%, transparent);
  color: var(--sd-danger, var(--danger));
  border: 1px solid color-mix(in srgb, var(--sd-danger, var(--danger)) 38%, transparent);
}

input,
textarea,
select {
  border-color: var(--sd-border, var(--surface-line));
  border-radius: var(--sd-radius-lg, 18px);
  background: var(--surface-strong);
  color: var(--text-main);
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible,
.btn:focus-visible,
.btn-export:focus-visible,
.btn-download:focus-visible,
.btn-linkpage:focus-visible,
.edit-btn:focus-visible,
.toggle-btn:focus-visible,
.danger:focus-visible,
.page-link:focus-visible,
.nav-link:focus-visible,
.nav-link-button:focus-visible,
.quick-pill:focus-visible,
.footer-link:focus-visible,
.burger-btn:focus-visible,
.drawer-close:focus-visible,
.modal-close:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--sd-accent, var(--accent)) 55%, transparent);
  box-shadow: var(--sd-focus, 0 0 0 4px rgba(43, 108, 255, 0.11));
}

.badge,
.nav-badge,
.quick-pill,
.chip {
  border-radius: var(--sd-radius-pill, 999px);
}

@media (max-width: 760px) {
  :root {
    --sperr-global-header-h: 46px;
  }
}

@media (max-width: 900px) {
  body.sd-has-global-header.is-login-screen .site-header {
    top: var(--sperr-global-header-h);
  }

  body.sd-has-global-header .nav-drawer {
    top: calc(var(--sperr-global-header-h) + 10px);
  }
}

body.sd-theme-dark {
  color-scheme: dark;
  background: linear-gradient(180deg, #202630 0%, var(--bg-secondary) 34%, var(--bg-base) 100%);
}

body.sd-theme-light {
  color-scheme: light;
  background: linear-gradient(180deg, #fbfcfe 0%, var(--bg-base) 28%, var(--bg-secondary) 100%);
}

body.sd-theme-dark::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
}

body.sd-theme-light::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
}

body.sd-theme-dark .brand-mark,
body.sd-theme-dark .burger-btn {
  background: var(--surface-muted);
  border-color: var(--surface-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.sd-theme-light .brand-mark,
body.sd-theme-light .burger-btn {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(230, 237, 248, 0.72));
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.sd-theme-dark .brand-mark img {
  filter: brightness(1.08) contrast(1.05);
}

body.sd-theme-light .brand-mark img {
  filter: none;
}

body.sd-theme-dark canvas,
body.sd-theme-dark input,
body.sd-theme-dark textarea,
body.sd-theme-dark select,
body.sd-theme-dark .brand-mark,
body.sd-theme-dark .burger-btn,
body.sd-theme-dark .nav-link,
body.sd-theme-dark .nav-link-button,
body.sd-theme-dark .quick-pill,
body.sd-theme-dark .footer-link,
body.sd-theme-dark .drawer-close {
  color-scheme: dark;
}

body.sd-theme-light canvas,
body.sd-theme-light input,
body.sd-theme-light textarea,
body.sd-theme-light select,
body.sd-theme-light .brand-mark,
body.sd-theme-light .burger-btn,
body.sd-theme-light .nav-link,
body.sd-theme-light .nav-link-button,
body.sd-theme-light .quick-pill,
body.sd-theme-light .footer-link,
body.sd-theme-light .drawer-close {
  color-scheme: light;
}
