:root {
  --bg: #f8fbfd; --surface: #fff; --surface-soft: #f0f7fb; --ink: #25323e; --muted: #607383; --line: #e1ebf1;
  --brand: #21a5ee; --brand-strong: #066d9f; --brand-hover: #62c1f7; --accent: #567bc0; --danger: #b42318;
  --hover: #f0f9ff; --active: #e8f7ff; --sidebar: #fff; --input: #fff; --focus: #21a5ee24;
  --danger-bg: #fff0ee; --danger-line: #e6aaa5; --success-bg: #e3f3eb; --success: #137044; --warning: #956000;
  --icon-filter: none; --shadow: 0 2px 8px #17202a08;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111214; --surface: #191b1f; --surface-soft: #24272c; --ink: #f1f2f4; --muted: #acb2bc; --line: #34383f;
  --brand: #82d0ff; --brand-strong: #b9e5ff; --brand-hover: #b9e5ff; --accent: #93bbf5; --danger: #ffaba3;
  --hover: #2a2e35; --active: #1c3342; --sidebar: #16181b; --input: #202328; --focus: #82d0ff30;
  --danger-bg: #351e21; --danger-line: #874641; --success-bg: #1e392e; --success: #8be0b5; --warning: #edc273;
  --icon-filter: invert(1); --shadow: none;
}
html { scrollbar-color: var(--muted) var(--bg); }
body { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); }
body > main { flex: 1 0 auto; min-width: 0; }
a { color: var(--brand-strong); text-underline-offset: 3px; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
.account-session-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 12px 0; flex-wrap: wrap; }
.account-session-row > div { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.account-session-row strong { display: block; margin-bottom: 4px; }
button { font: inherit; }
button:not([class]) { padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); cursor: pointer; }
input, select, textarea { background: var(--input); color: var(--ink); border-color: var(--line); border-radius: 6px; min-width: 0; }
input:not([type="checkbox"]):not([type="radio"]), select { min-height: 40px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.primary-button, .danger-button, .text-button, .icon-button { border-radius: 6px; font-weight: 600; }
.primary-button { background: var(--brand); color: #07344f; }
.primary-button:hover { background: var(--brand-hover); }
.primary-button img { filter: none; }
.text-button, .icon-button { color: var(--ink); background: var(--surface); }
.text-button:hover:not(:disabled), .icon-button:hover:not(:disabled) { background: var(--hover); }
.danger-button { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.app-header { padding: 22px 32px; gap: 16px; }
.app-header h1 { font-size: 22px; line-height: 1.4; }
.eyebrow { color: var(--muted); font-weight: 500; }
.layout { padding: 28px 32px 40px; }
.form, .mail-fields { gap: 16px; }
.panel, .visitor-panel { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.panel { padding: 0; }
.content-grid { gap: 28px; }
.detail-panel { border-left: 1px solid var(--line); padding-left: 28px; }
.stats { gap: 0; border-block: 1px solid var(--line); padding-block: 18px; margin-bottom: 24px; }
.stats div { background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 0 24px; border-right: 1px solid var(--line); }
.stats div:first-child { padding-left: 0; }
.stats div:last-child { border-right: 0; }
.stats span { font-size: 28px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stats div:nth-child(2) span { color: var(--accent); }
.stats div:nth-child(3) span { color: var(--success); }
.record-card { background: var(--surface); border-radius: 6px; padding: 16px; }
.record-card:hover { background: var(--hover); border-color: var(--line); }
.record-card.active { background: var(--active); border-color: var(--brand); }
.record-address { color: var(--ink); }
.badge { border-radius: 4px; background: var(--surface-soft); color: var(--accent); font-weight: 600; }
.badge.received { background: var(--success-bg); color: var(--success); }
.wl-filters { padding-bottom: 22px; border-bottom: 1px solid var(--line); gap: 16px; }
.table-scroll { border: 1px solid var(--line); border-radius: 6px; }
.wl-table { background: var(--surface); font-size: 13px; }
.wl-table th { background: var(--surface-soft); padding: 13px 16px; font-weight: 600; }
.wl-table td { padding: 14px 16px; }
.wl-table tbody tr:hover { background: var(--hover); }
.wl-table tbody tr:last-child td { border-bottom: 0; }
.owner-settings summary { color: var(--muted); font-size: 13px; }
.owner-settings[open] summary { color: var(--ink); }
.connection-test-results li { padding-block: 18px; }
.connection-check-state.pass, .receipt-yes { color: var(--success); }
.connection-check-state.fail, .receipt-no { color: var(--danger); }
.connection-check-state.warn { color: var(--warning); }
.connection-check-state.skip, .receipt-unknown { color: var(--muted); }
.receipt-tooltip { background: var(--surface); color: var(--ink); }
.eqsl-notice { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); font-weight: 500; border-radius: 0 6px 6px 0; }
.account-profile { font-size: 14px; }
.account-settings-section h2 { margin-bottom: 20px; }
.request-layout, .account-layout { padding-top: 32px; }
.visitor-page { display: flex; align-items: stretch; padding: 0; }
.visitor-page > main { width: min(560px,100%); margin-inline: auto; padding: 40px 24px; }
.visitor-panel { padding: 0; }
.photo-dialog { background: var(--surface); color: var(--ink); }
.photo-controls button { background: var(--surface); color: var(--ink); }
.empty { background: var(--surface-soft); }
.admin-shell { padding-left: 232px; }
.admin-shell > .app-header { min-height: 88px; padding: 16px 28px; align-items: center; }
.admin-shell > .app-header > div:not(.header-actions) { flex: 1 1 180px; }
.admin-shell > .app-header h1 { margin: 0; font-size: 20px; }
.admin-shell > .app-header .site-home-link [data-site-name] { display: none; }
.admin-shell > .app-header .site-home-link { font-size: 12px; font-weight: 500; gap: 7px; }
.admin-shell > .app-header .site-home-link .qsl-logo { width: 24px; height: 24px; flex-basis: 24px; }
.admin-shell .header-actions { margin-left: auto; justify-content: flex-end; }
.admin-shell .navigation-language span { display: none; }
.admin-shell .navigation-language select { min-width: 110px; font-size: 13px; }
.site-navigation { position: fixed; inset: 0 auto 0 0; z-index: 1100; width: 232px; display: flex; flex-direction: column; flex-wrap: nowrap; gap: 0; padding: 0 14px 20px; background: var(--sidebar); border: 0; border-right: 1px solid var(--line); overflow-y: auto; }
.navigation-brand { display: flex; gap: 12px; align-items: center; padding: 0 14px 24px; font-size: 23px; font-weight: 650; color: var(--brand-strong); }
.navigation-brand img { opacity: .85; }
.navigation-brand img { flex: 0 0 24px; }
.navigation-brand [data-site-name] { min-width: 0; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; }
.app-header .eyebrow[data-site-name] { text-transform: none; overflow-wrap: anywhere; }
.app-header > div:not(.header-actions) { min-width: 0; }
.site-home-link { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; min-width: 0; color: var(--brand-strong); text-decoration: none; font-size: 14px; font-weight: 600; line-height: 1.5; }
.site-home-link [data-site-name] { min-width: 0; overflow-wrap: anywhere; }
.site-home-link .qsl-logo { flex: 0 0 36px; }
.site-home-link:hover { color: var(--ink); }
.navigation-group { display: grid; gap: 4px; padding-block: 12px; border-top: 1px solid var(--line); }
.navigation-brand + .navigation-group { border-top: 0; }
.navigation-group:has(a):not(:has(a:not([hidden]))) { display: none; }
.site-navigation a { position: relative; display: flex; gap: 12px; align-items: center; min-height: 42px; padding: 10px 12px; border: 0; border-radius: 6px; color: var(--ink); font-size: 14px; line-height: 1.4; text-decoration: none; }
.site-navigation a span { min-width: 0; overflow-wrap: anywhere; }
.site-navigation a img { flex: 0 0 18px; opacity: .72; }
.site-navigation a:hover { background: var(--hover); color: var(--ink); }
.site-navigation a[aria-current="page"] { background: var(--active); color: var(--brand-strong); font-weight: 600; }
.site-navigation a[aria-current="page"]::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: var(--brand); }
.site-navigation a[aria-current="page"] img { opacity: 1; }
.site-navigation a.navigation-brand { min-height: 88px; flex-shrink: 0; margin-inline: -14px; padding: 14px 24px; gap: 10px; color: var(--ink); border-radius: 0; border-bottom: 1px solid var(--line); }
.site-navigation a.navigation-brand .qsl-logo { flex: 0 0 36px; }
.qsl-logo { width: 36px; height: 36px; object-fit: contain; filter: none !important; opacity: 1 !important; }
.navigation-toggle { display: none; flex: 0 0 40px; width: 40px; height: 40px; padding: 0; line-height: 1; }
.navigation-toggle img { display: block; }
.site-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; padding: 20px 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; background: var(--surface); margin-top: auto; }
.footer-details { display: flex; flex-wrap: wrap; gap: 8px 20px; overflow-wrap: anywhere; }
.footer-details:empty { display: none; }
.footer-details a { color: var(--muted); text-decoration: none; }
.footer-details a:hover { text-decoration: underline; }
.footer-credit { white-space: nowrap; }
.footer-credit a { color: inherit; text-decoration: none; }
.footer-credit a:hover { color: var(--brand-strong); text-decoration: underline; }
.theme-picker { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12px; font-weight: 400; }
.theme-picker select { min-width: 112px; width: auto; min-height: 34px; padding: 6px 10px; font-size: 12px; }
.login-page { display: flex; background: var(--surface); color: var(--ink); }
.login-page .login-main { flex: 1; }
.login-page .login-header { border-color: var(--line); }
.login-page .login-brand-mark { background: var(--active); }
.login-page .login-content label { color: var(--muted); }
.login-page .login-content input, .login-page .navigation-language select { border-color: var(--line); }
.login-page .login-register { border-color: var(--line); }
.login-register { display: grid; gap: 12px; }
#recoveryStatus { overflow-wrap: anywhere; }
#recoveryCode { min-height: 68px; font-family: ui-monospace, Consolas, monospace; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; resize: vertical; }
.login-page #loginError { color: var(--danger); }
.login-page #loginError:not(:empty) { background: var(--danger-bg); border-color: var(--danger-line); }
.login-page .login-notice { background: var(--active); }
:root[data-theme="dark"] .primary-button { color: #102337; }
:root[data-theme="dark"] .site-navigation img, :root[data-theme="dark"] .login-brand img, :root[data-theme="dark"] .login-register img, :root[data-theme="dark"] button:not(.image-preview):not(.gallery-photo):not(.primary-button) > img { filter: var(--icon-filter); }
:root[data-theme="dark"] .primary-button img { filter: none; }
:root[data-theme="dark"] .label-preview { background: var(--surface-soft); }
:root[data-theme="dark"] .label-warning { color: var(--warning); }
:root[data-theme="dark"] .label-error { color: var(--danger); }
:root[data-theme="dark"] .photo-dialog .photo-controls { color: var(--ink); }
@media (min-width: 1101px) {
  .admin-shell > .app-header .site-home-link { display: none; }
}
@media (max-width: 1300px) and (min-width: 1101px) { .content-grid { grid-template-columns: minmax(0,1fr) minmax(300px,360px); gap: 22px; } .detail-panel { padding-left: 22px; } .shipment-filters { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 1100px) {
  .admin-shell { padding-left: 0; }
  .admin-shell > .app-header { flex-direction: row; align-items: center; flex-wrap: wrap; padding: 18px 24px; min-height: 74px; }
  .admin-shell > .app-header > div:not(.header-actions) { flex: 1 1 0; display: flex; align-items: center; min-height: 40px; gap: 8px; }
  .admin-shell > .app-header h1 { display: flex; align-items: center; min-height: 40px; margin: 0; padding: 0; font-size: 20px; line-height: 24px; }
  .admin-shell > .app-header .site-home-link { flex: 0 0 40px; width: 40px; height: 40px; justify-content: center; }
  .admin-shell > .app-header .site-home-link .qsl-logo { display: block; width: 32px; height: 32px; flex-basis: 32px; }
  .admin-shell .header-actions { flex-direction: row; flex-wrap: wrap; }
  .navigation-toggle { display: grid; place-items: center; }
  .site-navigation { display: none; position: static; width: 100%; padding: 12px 24px; border: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .navigation-open .site-navigation { display: flex; flex-direction: row; align-items: start; flex-wrap: wrap; gap: 0 16px; }
  .navigation-brand, .site-navigation a.navigation-brand { display: none; }
  .navigation-group { flex: 1 1 200px; padding-block: 8px; border: 0; }
}
@media (max-width: 860px) { .detail-panel { padding-left: 0; padding-top: 24px; border-left: 0; border-top: 1px solid var(--line); } }
@media (max-width: 600px) {
  .app-header, .admin-shell > .app-header { padding: 18px; gap: 12px; }
  .app-header h1 { font-size: 20px; }
  .admin-shell .header-actions { flex-basis: 100%; justify-content: flex-start; }
  .layout { padding: 24px 18px 32px; }
  .site-navigation { padding-inline: 14px; }
  .navigation-group { flex-basis: 100%; border-top: 1px solid var(--line); }
  .stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .stats div { padding-inline: 12px; }
  .stats span { font-size: 24px; }
  .stats small { font-size: 11px; }
  .site-footer { padding: 18px; gap: 14px; }
  .footer-details { flex-basis: 100%; }
  .theme-picker { gap: 6px; }
  .theme-picker > span { display: none; }
  .wl-table td, .wl-table th { padding: 12px; }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px; }
  .date-parts input { font-size: 14px; }
}
@media print { .admin-shell { padding-left: 0; } .site-navigation, .navigation-toggle, .site-footer { display: none !important; } }
.platform-audit { border-top: 1px solid var(--line); padding-top: 24px; min-width: 0; }
.platform-audit summary { cursor: pointer; font-size: 20px; font-weight: 600; margin-bottom: 20px; }
.audit-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.audit-filters label { display: grid; gap: 6px; flex: 1 1 180px; min-width: 0; }
.audit-filters select { width: 100%; min-width: 0; }
.audit-rows { list-style: none; padding: 0; margin: 16px 0; }
.audit-rows li { border-bottom: 1px solid var(--line); padding: 16px 0; overflow-wrap: anywhere; }
.audit-rows time { display: block; color: var(--muted); font-size: 13px; margin-top: 6px; }
.audit-rows p { margin: 8px 0 0; font-size: 14px; }
.has-language-menu > .app-header { position: relative; padding-right: 76px; }
.app-header > .language-menu { position: absolute; top: 16px; right: 18px; z-index: 1200; min-height: 0; }
.language-menu > .icon-button, .theme-choice { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; flex: 0 0 40px; }
.language-menu img, .theme-choice img { display: block; }
.language-options { position: absolute; top: 48px; right: 0; width: 170px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: 0 6px 24px #0002; }
.language-options[hidden] { display: none; }
.language-options button { display: block; width: 100%; min-height: 40px; padding: 8px 12px; text-align: left; border: 0; background: transparent; color: var(--ink); }
.language-options button:hover, .language-options button:focus-visible { background: var(--hover); }
.language-options button[aria-checked="true"] { background: var(--active); color: var(--brand-strong); font-weight: 600; }
.theme-picker { gap: 4px; }
.theme-choice { border-color: transparent; background: var(--surface); }
.theme-choice[data-current-theme="light"] > img { filter: none !important; }
.theme-choice[data-current-theme="dark"] > img { filter: none !important; }
@media print { .language-menu { display: none !important; } }
