:root {
  --sn-neon: #c9b38f;
  --sn-drprep-neon: #7dff5b;
  --sn-text: #e9ffe9;
  --sn-bg: #000000;
  --sn-bg-panel: #001b00;
  --sn-border: rgba(187,163,119,0.3);
  --sn-sand: #bba377;
  --sn-beige: #d8c39b;
  --sn-dark-red: #4b1118;
  --sn-dark-red-glow: rgba(75,17,24,0.72);
  --audio-player-offset: 0px;
  --sn-btn-height: 40px;
}

* {
  box-sizing: border-box;
}

/* iOS Safari zoom prevention: inputs below 16px font-size trigger auto-zoom.
   !important is intentional – overrides all specific selectors that set sub-16px font sizes. */
input, select, textarea {
  font-size: max(16px, 1em) !important;
  touch-action: manipulation;
}

body {
  background: var(--sn-bg);
  color: var(--sn-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", monospace;
  margin: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  max-width: 100vw;
}

/* Navigation oben */
.sn-title-carousel {
  position: fixed;
  top: 40px;
  left: 0;
  right: 0;
  height: 56px;
  overflow: hidden; /* wichtig */
  background: linear-gradient(180deg, rgba(20,8,10,0.97) 0%, rgba(8,14,6,0.97) 100%);
  border-bottom: 1px solid rgba(75,17,24,0.55);
  padding: 2px 0;
  z-index: 20;
}

.sn-top-utility {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: linear-gradient(180deg, rgba(16, 10, 8, 0.98), rgba(8, 12, 6, 0.96));
  border-bottom: 1px solid rgba(75, 17, 24, 0.45);
  z-index: 30;
  gap: 8px;
}

.sn-system-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.sn-system-status::-webkit-scrollbar {
  display: none;
}

.sn-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(187, 163, 119, 0.45);
  background: rgba(34, 22, 16, 0.75);
  color: #e0d8c9;
  font-size: 0.74rem;
  white-space: nowrap;
}

.sn-status-chip.is-online {
  border-color: rgba(159, 186, 123, 0.7);
  background: rgba(40, 58, 24, 0.55);
  color: #d7efbf;
}

.sn-status-chip.is-offline {
  border-color: rgba(170, 96, 96, 0.68);
  background: rgba(78, 28, 28, 0.5);
  color: #efb3b3;
}

.sn-status-chip.is-pending {
  border-color: rgba(187, 163, 119, 0.45);
  background: rgba(42, 34, 27, 0.4);
  color: #e0d8c9;
}

.sn-status-refresh-btn {
  min-height: 24px;
  min-width: 26px;
  border-radius: 999px;
  border: 1px solid rgba(187, 163, 119, 0.42);
  background: rgba(34, 22, 16, 0.75);
  color: var(--sn-beige);
  cursor: pointer;
  line-height: 1;
}

.sn-status-refresh-btn:hover,
.sn-status-refresh-btn:focus-visible {
  border-color: rgba(216, 195, 155, 0.75);
  box-shadow: 0 0 10px rgba(75, 17, 24, 0.55);
}

.sn-mesh-unread-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  border: 1px solid rgba(187, 163, 119, 0.42);
  background: linear-gradient(180deg, rgba(45, 20, 18, 0.9), rgba(23, 16, 12, 0.92));
  color: var(--sn-beige);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
  cursor: pointer;
}

.sn-mesh-unread-btn:hover,
.sn-mesh-unread-btn:focus-visible {
  border-color: rgba(216, 195, 155, 0.75);
  box-shadow: 0 0 10px rgba(75, 17, 24, 0.55);
}

.sn-mesh-unread-icon {
  opacity: 0.95;
}

.sn-mesh-unread-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  padding: 0 6px;
  background: rgba(187, 163, 119, 0.2);
  border: 1px solid rgba(216, 195, 155, 0.55);
  color: var(--sn-beige);
  font-size: 0.76rem;
  font-weight: 700;
}

.sn-top-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid rgba(187, 163, 119, 0.42);
  background: linear-gradient(180deg, rgba(45, 20, 18, 0.9), rgba(23, 16, 12, 0.92));
  color: var(--sn-beige);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.82rem;
  text-decoration: none;
  white-space: nowrap;
}

.sn-top-link:hover,
.sn-top-link:focus-visible {
  border-color: rgba(216, 195, 155, 0.75);
  box-shadow: 0 0 10px rgba(75, 17, 24, 0.55);
}

@media (max-width: 640px) {
  .sn-mesh-unread-btn {
    min-width: 32px;
    padding: 4px 8px;
  }

  .sn-mesh-unread-btn .sn-mesh-unread-icon {
    margin-right: 0;
  }
}

.sn-title-track {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 640px;
}

.sn-title-carousel::-webkit-scrollbar {
  display: none;
}

.sn-title-item {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--sn-text);
  opacity: 0.3;
  transition: opacity 0.22s ease, transform 0.22s ease, text-shadow 0.22s ease, color 0.22s ease, background-color 0.22s ease, border-color 0.22s ease;
  transform-origin: center center;
  white-space: nowrap;
  border-radius: 10px;
  border: 1px solid rgba(187,163,119,var(--sn-title-card-border-alpha, 0.22));
  background: rgba(50,16,22,var(--sn-title-card-alpha, 0.2));
  box-shadow: inset 0 0 0 1px rgba(216,195,155,0.08), 0 2px 10px rgba(0,0,0,0.35);
  backdrop-filter: blur(1px);
}

.sn-title-item.active {
  opacity: 1;
  color: var(--sn-beige);
  font-size: 1.14rem;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,0.95), 0 0 14px rgba(75,17,24,0.78), 0 0 2px rgba(0,0,0,0.9);
  background: rgba(75,17,24,0.78);
  border-color: rgba(216,195,155,0.68);
  box-shadow: inset 0 0 0 1px rgba(216,195,155,0.2), 0 0 14px rgba(75,17,24,0.62);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.sn-button:focus-visible,
.sn-tool-anchor:focus-visible,
.sn-book-card:focus-visible,
.sn-result-item:focus-visible,
.sn-mesh-node-btn.is-selected {
  outline: none;
  border-color: rgba(216,195,155,0.72) !important;
  box-shadow: 0 0 0 1px rgba(216,195,155,0.35), 0 0 12px var(--sn-dark-red-glow);
}

button:active,
.sn-button:active,
.sn-tool-anchor:active {
  box-shadow: 0 0 10px rgba(75,17,24,0.75);
}


/* Slides / Seiten */

#sn-slides-wrapper {
  position: fixed;
  top: calc(96px + env(safe-area-inset-top));
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--sn-vh, 100dvh) - 96px - env(safe-area-inset-top));
  overflow: hidden;
  background: #000;
}

#sn-slides {
  display: flex;
  height: 100%;
  min-height: 0;
  transition: transform 0.30s ease-out;
}

.sn-slide {
  flex: 0 0 100vw;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 85% 8%, rgba(75,17,24,0.22), transparent 34%),
    radial-gradient(circle at 18% 0%, rgba(187,163,119,0.11), transparent 30%),
    #000;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior-y: contain;
  padding-bottom: calc(var(--audio-player-offset) + env(safe-area-inset-bottom) + 20px);
  scroll-padding-bottom: calc(var(--audio-player-offset) + env(safe-area-inset-bottom) + 20px);
}

@supports not (height: 100dvh) {
  #sn-slides-wrapper {
    height: calc(100vh - 96px - env(safe-area-inset-top));
  }
}


/* Module / Karten */

.sn-module {
  max-width: 860px;
  margin: 0 auto;
  padding: 12px max(14px, calc(env(safe-area-inset-right) + 14px)) 28px max(14px, calc(env(safe-area-inset-left) + 14px));
}

.sn-module-title {
  font-size: 1.55rem;
  color: #d6c3a1;
  text-shadow: 0 0 6px rgba(75,17,24,0.5), 0 0 16px rgba(75,17,24,0.3);
  margin-bottom: 16px;
  letter-spacing: 0.01em;
}

/* Home module list with better spacing */
.sn-home-list {
  list-style: none;
  padding-left: 0;
}
.sn-home-list li {
  padding: 5px 2px;
  border-bottom: 1px solid rgba(187,163,119,0.1);
  font-size: 0.95rem;
}
.sn-home-list li:last-child { border-bottom: none; }

/* Wissen primary link button */
.sn-wissen-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.sn-text {
  font-size: 0.95rem;
  line-height: 1.58;
  margin-bottom: 12px;
  max-width: 95%;
}

.sn-module-intro {
  margin-top: -2px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-left: 3px solid rgba(187,163,119,0.45);
  background: linear-gradient(90deg, rgba(22,28,16,0.62), rgba(14,20,10,0.28));
  border-radius: 6px;
  line-height: 1.6;
}

.sn-text-small {
  font-size: 0.85rem;
  line-height: 1.52;
  color: rgba(208,255,208,0.88);
}

.sn-card {
  background:
    linear-gradient(180deg, rgba(0,24,0,0.62), rgba(0,14,0,0.68)),
    linear-gradient(135deg, rgba(187,163,119,0.08), rgba(75,17,24,0.12));
  border: 1px solid rgba(187,163,119,0.28);
  box-shadow: inset 0 0 0 1px rgba(187,163,119,0.08);
  padding: 14px;
  margin-bottom: 16px;
  border-radius: 8px;
}

.sn-card h3:first-child,
.sn-card h4:first-child {
  margin-top: 0;
}

.sn-card > p + h3,
.sn-card > p + h4 {
  margin-top: 10px;
}

.sn-topic-card {
  border-left: 3px solid rgba(187,163,119,0.42);
  box-shadow: inset 0 0 0 1px rgba(187,163,119,0.09), 0 8px 22px rgba(0,0,0,0.22);
}

.sn-list {
  padding-left: 18px;
  margin: 8px 0;
  font-size: 0.9rem;
  line-height: 1.62;
}

.sn-faq {
  margin-top: 10px;
  border: 1px solid rgba(187,163,119,0.28);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(16,22,12,0.55);
}

.sn-faq summary {
  cursor: pointer;
  color: var(--sn-sand);
  font-size: 0.88rem;
  line-height: 1.5;
  font-weight: 500;
}

.sn-faq summary::-webkit-details-marker {
  display: none;
}

.sn-faq summary,
.sn-secondary-actions summary,
.sn-tool-section > summary {
  position: relative;
  padding-left: 28px;
  padding-right: 26px;
}

.sn-faq summary::before,
.sn-secondary-actions summary::before,
.sn-tool-section > summary::before {
  content: "▸";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95em;
  color: var(--sn-beige);
  transition: transform 0.16s ease;
  opacity: 0.95;
}

.sn-faq summary::after,
.sn-secondary-actions summary::after,
.sn-tool-section > summary::after {
  content: "+";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85em;
  color: var(--sn-sand);
  opacity: 0.9;
  font-weight: 700;
}

.sn-faq[open] summary::before,
.sn-secondary-actions[open] summary::before,
.sn-tool-section[open] > summary::before {
  transform: translateY(-50%) rotate(90deg);
}

.sn-faq[open] summary::after,
.sn-secondary-actions[open] summary::after,
.sn-tool-section[open] > summary::after {
  content: "−";
}

.sn-faq[open] summary {
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(187,163,119,0.15);
}

/* Headings - Typography & Icons */
h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--sn-sand);
  margin: 14px 0 10px 0;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

h4 {
  font-size: 0.98rem;
  font-weight: 600;
  color: rgba(187,163,119,0.95);
  margin: 12px 0 8px 0;
  line-height: 1.38;
  letter-spacing: 0.005em;
}

/* Chat / DrPrep */

.sn-chat {
  min-height: 200px;
  max-height: calc(var(--sn-vh, 100dvh) - 180px);
  padding: 8px;
  background: rgba(0,20,0,0.3);
  border: 1px solid var(--sn-border);
  overflow-y: auto;
}

body.sn-keyboard-open .sn-chat {
  min-height: 110px;
  max-height: calc(var(--sn-vh, 100dvh) - 240px);
}

.sn-answer {
  color: var(--sn-drprep-neon);
  margin-bottom: 12px;
  text-shadow: 0 0 6px rgba(125,255,91,0.62);
  white-space: pre-wrap;
  font-size: 0.95rem;
}

.sn-notice {
  margin-bottom: 8px;
  padding: 6px 8px;
  border: 1px dashed rgba(187,163,119,0.5);
  color: var(--sn-neon);
  font-size: 0.85rem;
}

.sn-domain-filter {
  margin: 8px 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--sn-border);
  background: rgba(0, 20, 0, 0.45);
  border-radius: 4px;
}

.sn-domain-filter-title {
  color: var(--sn-neon);
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.sn-domain-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  margin-bottom: 4px;
}

.sn-domain-option:last-child {
  margin-bottom: 0;
}

.sn-domain-option input[type="checkbox"] {
  accent-color: var(--sn-neon);
}

.sn-sources {
  margin-top: 8px;
  font-size: 0.8rem;
}

.sn-source {
  margin-bottom: 6px;
}

/* Neue Quellen-Box */
.sn-sources-box {
  margin-top: 12px;
  padding: 10px;
  background: rgba(0,20,0,0.5);
  border: 1px solid var(--sn-border);
  border-radius: 4px;
}

.sn-sources-title {
  font-weight: bold;
  color: var(--sn-neon);
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.sn-source-link {
  margin-bottom: 4px;
  padding: 4px 6px;
  background: rgba(0,10,0,0.3);
  border-left: 2px solid var(--sn-neon);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}

.sn-source-link:hover {
  background: rgba(0,20,0,0.6);
}

.sn-chat-input {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.sn-chat-input input {
  flex: 1;
  padding: 8px;
  background: #000;
  color: var(--sn-text);
  border: 1px solid rgba(187,163,119,0.4);
  border-radius: 3px;
  font-size: 0.95rem;
}

.sn-chat-input button {
  padding: 8px 12px;
  background: #040;
  color: var(--sn-neon);
  border: 1px solid var(--sn-border);
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.9rem;
}

.sn-chat-input button:active {
  background: #060;
  box-shadow: 0 0 10px rgba(75,17,24,0.72);
}

.sn-inline-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.sn-inline-row input,
.sn-inline-row select,
.sn-inline-row button {
  min-height: var(--sn-btn-height);
}

.sn-inline-row input,
.sn-inline-row select {
  flex: 1;
  padding: 8px;
  background: #000;
  color: var(--sn-text);
  border: 1px solid rgba(187,163,119,0.35);
  border-radius: 4px;
}

.sn-inline-row select,
.sn-input-labeled select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--sn-sand) 50%),
    linear-gradient(135deg, var(--sn-sand) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

select {
  border-color: rgba(187,163,119,0.35);
  border-radius: 6px;
  background-color: #000;
  color: var(--sn-text);
}

details {
  border-radius: 8px;
}

.sn-inline-row button,
.sn-book-card,
.sn-result-item {
  background: linear-gradient(180deg, rgba(8,34,8,0.96), rgba(6,26,6,0.96));
  color: var(--sn-text);
  border: 1px solid var(--sn-border);
  border-radius: 4px;
}

.sn-setup-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  background: #062006;
  color: var(--sn-text);
  border: 1px solid var(--sn-border);
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
}

.sn-setup-link:focus-visible,
.sn-setup-link:hover {
  outline: none;
  border-color: var(--sn-beige);
  color: var(--sn-beige);
  box-shadow: 0 0 12px var(--sn-dark-red-glow);
}

.sn-mesh-faq-link {
  min-height: 28px;
  padding: 4px 12px;
  font-size: 0.82rem;
}

.sn-inline-row button {
  padding: 8px 14px;
  font-size: 0.92rem;
  cursor: pointer;
}

button,
.sn-button,
.sn-inline-row button,
.sn-button-row button,
.sn-chat-input button,
.sn-clear-btn {
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.08s ease;
}

button:hover,
.sn-button:hover,
.sn-inline-row button:hover,
.sn-button-row button:hover,
.sn-chat-input button:hover,
.sn-clear-btn:hover {
  border-color: rgba(216,195,155,0.58);
  box-shadow: 0 0 10px rgba(75,17,24,0.55);
}

button:active,
.sn-button:active {
  transform: translateY(1px);
}

.sn-primary-btn {
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid rgba(216,195,155,0.55);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(34,52,25,0.95), rgba(22,35,17,0.95));
  color: var(--sn-beige);
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 0 0 1px rgba(75,17,24,0.32);
}

.sn-primary-btn:disabled {
  opacity: 0.55;
}

.sn-primary-action-bar {
  position: static;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid rgba(216,195,155,0.3);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(20,27,14,0.94), rgba(14,20,10,0.94));
}

.sn-secondary-actions {
  margin-top: 8px;
  margin-bottom: 10px;
  border: 1px solid rgba(187,163,119,0.34);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(20,27,14,0.94), rgba(14,20,10,0.94));
  padding: 6px 8px;
}

.sn-secondary-actions summary {
  cursor: pointer;
  color: var(--sn-beige);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  list-style: none;
}

.sn-faq-bubble .sn-card {
  margin-bottom: 0;
}

.sn-faq-qa-list {
  display: grid;
  gap: 10px;
}

.sn-faq-qa-item {
  padding: 10px;
  border: 1px solid rgba(187, 163, 119, 0.22);
  border-radius: 6px;
  background: rgba(9, 20, 8, 0.55);
}

.sn-faq-qa-item p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.sn-faq-qa-item p + p {
  margin-top: 6px;
}

.sn-secondary-actions summary::-webkit-details-marker {
  display: none;
}

.sn-secondary-actions[open] summary {
  margin-bottom: 8px;
}

.sn-mini-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sn-disclaimer,
.sn-plant-disclaimer {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.sn-disclaimer-critical,
.sn-plant-disclaimer {
  border: 1px solid rgba(190, 82, 82, 0.72);
  background: linear-gradient(180deg, rgba(58, 14, 14, 0.92), rgba(34, 10, 10, 0.95));
  color: #ffd4d4;
}

.sn-disclaimer-collapsible {
  padding: 0;
}

.sn-disclaimer-collapsible summary {
  cursor: pointer;
  font-weight: 800;
  padding: 10px 12px;
  list-style: none;
}

.sn-disclaimer-collapsible summary::-webkit-details-marker {
  display: none;
}

.sn-disclaimer-collapsible summary::before {
  content: "+";
  display: inline-block;
  width: 1rem;
  margin-right: 0.35rem;
  font-weight: 900;
}

.sn-disclaimer-collapsible[open] summary::before {
  content: "-";
}

.sn-disclaimer-collapsible > div {
  padding: 0 12px 10px;
}

.sn-plant-safety-tree {
  margin-bottom: 10px;
  border: 1px solid rgba(187, 163, 119, 0.34);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(20, 27, 14, 0.94), rgba(14, 20, 10, 0.94));
  padding: 8px 10px;
}

.sn-plant-tree {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid rgba(187, 163, 119, 0.34);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(20, 27, 14, 0.94), rgba(14, 20, 10, 0.94));
}

.sn-plant-tree-intro,
.sn-plant-tree-status {
  margin-bottom: 8px;
}

.sn-plant-tree-question {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(216, 195, 155, 0.28);
  background: rgba(9, 20, 8, 0.58);
  color: var(--sn-beige);
  font-weight: 700;
  line-height: 1.4;
}

.sn-plant-tree-actions {
  margin-bottom: 10px;
}

.sn-plant-tree-actions button {
  min-width: 110px;
}

.sn-plant-candidate-preview {
  padding: 10px;
  border-radius: 8px;
}

.sn-plant-tree-more {
  opacity: 0.9;
}

.sn-plant-safety-tree summary,
.sn-plant-result-section summary {
  cursor: pointer;
  color: var(--sn-beige);
  font-weight: 700;
}

.sn-plant-safety-tree summary::-webkit-details-marker,
.sn-plant-result-section summary::-webkit-details-marker {
  display: none;
}

.sn-plant-result {
  padding: 10px;
  border-radius: 8px;
}

.sn-plant-result.is-toxic {
  border-color: rgba(190, 82, 82, 0.62);
  background: linear-gradient(180deg, rgba(40, 11, 11, 0.96), rgba(24, 9, 9, 0.96));
}

.sn-plant-result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sn-plant-result-title {
  color: var(--sn-beige);
}

.sn-plant-result-latin,
.sn-plant-meta {
  margin-top: 2px;
  opacity: 0.9;
}

.sn-plant-badge {
  flex: 0 0 auto;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(187, 163, 119, 0.45);
  background: rgba(34, 22, 16, 0.75);
  color: var(--sn-beige);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.sn-plant-badge.is-toxic {
  border-color: rgba(190, 82, 82, 0.72);
  background: rgba(78, 22, 22, 0.85);
  color: #ffd3d3;
}

.sn-plant-warning,
.sn-plant-safety-rule {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.sn-plant-warning {
  border: 1px solid rgba(190, 82, 82, 0.58);
  background: rgba(70, 16, 16, 0.72);
  color: #ffd1d1;
}

.sn-plant-safety-rule {
  border: 1px solid rgba(187, 163, 119, 0.34);
  background: rgba(20, 28, 12, 0.72);
  color: #f2e7cf;
}

.sn-plant-result-section {
  margin-top: 8px;
  border: 1px solid rgba(187, 163, 119, 0.22);
  border-radius: 6px;
  padding: 6px 8px;
  background: rgba(9, 20, 8, 0.45);
}

.sn-plant-result-section[open] summary {
  margin-bottom: 6px;
}

.sn-plant-result-list {
  margin: 0;
  padding-left: 18px;
}

.sn-plant-result-list li + li {
  margin-top: 4px;
}

.sn-books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.sn-book-card {
  text-align: left;
  padding: 8px;
  cursor: pointer;
}

.sn-book-card img,
.sn-book-cover-fallback {
  width: 100%;
  height: 180px;
  border-radius: 4px;
  object-fit: cover;
  margin-bottom: 8px;
}

.sn-book-cover-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, rgba(0, 20, 0, 0.95), rgba(18, 48, 18, 0.92));
  color: var(--sn-neon);
  font-weight: 700;
}

.sn-book-title {
  color: var(--sn-neon);
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.sn-book-sub {
  font-size: 0.8rem;
  opacity: 0.9;
}

.sn-tool-section {
  margin-top: 18px;
  scroll-margin-top: 96px;
  border: 1px solid rgba(187,163,119,0.24);
  border-left: 3px solid rgba(187,163,119,0.45);
  border-radius: 10px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(10,18,10,0.38), rgba(8,14,8,0.4));
}

.sn-tool-section > summary {
  cursor: pointer;
  color: var(--sn-beige);
  font-size: 1.04rem;
  font-weight: 700;
  margin-bottom: 6px;
  list-style: none;
}

.sn-tool-section > summary::-webkit-details-marker {
  display: none;
}

.sn-tool-section-body {
  padding-top: 6px;
}

.sn-tool-section h3,
.sn-card h4 {
  color: var(--sn-neon);
  margin: 0 0 12px;
  letter-spacing: 0.01em;
}

.sn-tool-section h3 {
  font-size: 1.08rem;
  opacity: 0.95;
}

.sn-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.sn-button-row button {
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid rgba(216,195,155,0.55);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(34,52,25,0.95), rgba(22,35,17,0.95));
  color: var(--sn-beige);
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 0 0 1px rgba(75,17,24,0.32);
  font-size: 0.92rem;
  cursor: pointer;
}

.sn-inline-row button,
.sn-chat-input button,
.sn-clear-btn,
.sn-setup-link {
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid rgba(216,195,155,0.55);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(34,52,25,0.95), rgba(22,35,17,0.95));
  color: var(--sn-beige);
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 0 0 1px rgba(75,17,24,0.32);
}

.sn-clear-btn {
  min-height: 40px;
  padding: 6px 12px;
  font-size: 0.8rem;
}

.sn-quiz-head {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.sn-quiz-chip {
  border: 1px solid rgba(187,163,119,0.38);
  border-radius: 6px;
  padding: 6px 8px;
  background: linear-gradient(180deg, rgba(22,22,12,0.62), rgba(16,22,12,0.58));
  color: var(--sn-beige);
  font-size: 0.84rem;
}

.sn-quiz-progress {
  width: 100%;
  height: 8px;
  border: 1px solid var(--sn-border);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
  margin-bottom: 8px;
}

.sn-quiz-progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #6f4f2f, var(--sn-neon));
  transition: width 0.2s ease;
}

.sn-quiz-question {
  font-size: 1rem;
  line-height: 1.4;
  margin: 8px 0 10px;
}

.sn-quiz-answers {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.sn-quiz-answers button {
  text-align: left;
  min-height: 44px;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--sn-border);
  background: #061906;
  color: var(--sn-text);
  cursor: pointer;
}

.sn-quiz-answers button.correct {
  border-color: #cdb38a;
  background: rgba(24, 90, 35, 0.7);
}

.sn-quiz-answers button.wrong {
  border-color: rgba(216, 130, 130, 0.65);
  background: linear-gradient(180deg, rgba(75, 17, 24, 0.78), rgba(42, 10, 14, 0.82));
}

.sn-quiz-answers button:disabled {
  opacity: 0.95;
  cursor: default;
}

.sn-quiz-explain {
  white-space: pre-wrap;
  margin: 0 0 10px;
  padding: 8px;
  border: 1px dashed var(--sn-border);
  border-radius: 6px;
  background: rgba(0, 18, 0, 0.5);
  color: var(--sn-text);
  min-height: 52px;
  font-size: 0.88rem;
  font-family: inherit;
}

/* Labeled input group for survival calculator */
.sn-survival-inputs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.sn-input-labeled {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 70px;
}

.sn-input-labeled span {
  font-size: 0.72rem;
  color: rgba(187,163,119,0.65);
  white-space: nowrap;
}

.sn-input-labeled input {
  width: 100%;
  padding: 6px 8px;
  background: #000;
  color: var(--sn-text);
  border: 1px solid rgba(187,163,119,0.35);
  border-radius: 4px;
  min-height: 36px;
}

.sn-tool-result {
  background: rgba(0, 16, 0, 0.55);
  border: 1px solid var(--sn-border);
  border-radius: 6px;
  padding: 10px;
}

.sn-tool-result-title {
  color: var(--sn-neon);
  font-weight: 700;
  margin-bottom: 8px;
}

.sn-tool-result-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
  margin-top: 8px;
  margin-bottom: 4px;
}

.sn-tool-result-text {
  font-size: 0.9rem;
  line-height: 1.4;
}

.sn-tool-result-list {
  margin-top: 4px;
  margin-bottom: 0;
}

.sn-comm-card {
  background:
    linear-gradient(180deg, rgba(16, 20, 12, 0.8), rgba(8, 12, 8, 0.84)),
    radial-gradient(circle at 86% 6%, rgba(75, 17, 24, 0.28), transparent 42%);
}

.sn-comm-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.sn-comm-pane {
  border: 1px solid rgba(187, 163, 119, 0.32);
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(20, 22, 14, 0.65), rgba(10, 14, 9, 0.7));
  display: grid;
  gap: 8px;
}

.sn-comm-section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(187, 163, 119, 0.95);
  font-weight: 700;
}

.sn-comm-card .sn-inline-row {
  gap: 8px;
  flex-wrap: wrap;
}

.sn-comm-card .sn-inline-row button {
  background: linear-gradient(180deg, rgba(34, 22, 16, 0.9), rgba(20, 14, 10, 0.92));
  color: var(--sn-beige);
  border: 1px solid rgba(187, 163, 119, 0.45);
  border-radius: 6px;
}

.sn-comm-secondary-row button {
  flex: 1 1 0;
}

.sn-comm-card .sn-inline-row button:hover,
.sn-comm-card .sn-inline-row button:focus-visible {
  color: var(--sn-beige);
  border-color: rgba(216, 195, 155, 0.78);
  outline: none;
}

.sn-comm-card .sn-inline-row button.is-selected {
  color: var(--sn-beige);
  border-color: rgba(216, 195, 155, 0.78);
  box-shadow: inset 0 0 0 1px rgba(187,163,119,0.45), 0 0 12px rgba(75,17,24,0.4);
}

.sn-comm-card input {
  border-radius: 6px;
  border-color: rgba(187, 163, 119, 0.45);
  background: rgba(16, 18, 10, 0.88);
  color: var(--sn-text);
}

.sn-comm-send-row button {
  flex: 0 0 auto;
  min-width: 112px;
}

.sn-comm-address-row #mesh-destination {
  flex: 1 1 auto;
}

.sn-comm-address-row #mesh-channel {
  flex: 0 0 112px;
  max-width: 132px;
}

.sn-mesh-nodes-wrap {
  margin-top: 8px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--sn-border);
  border-radius: 6px;
  padding: 6px;
  background: rgba(0, 10, 0, 0.45);
}

.sn-mesh-node-btn {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid rgba(187,163,119,0.25);
  border-radius: 6px;
  background: rgba(0, 22, 8, 0.55);
  color: var(--sn-text);
  cursor: pointer;
}

.sn-mesh-node-btn:hover,
.sn-mesh-node-btn:focus-visible {
  border-color: var(--sn-neon);
  color: var(--sn-neon);
  outline: none;
}

.sn-mesh-node-btn.is-selected {
  border-color: var(--sn-neon);
  box-shadow: inset 0 0 0 1px rgba(187,163,119,0.45), 0 0 12px rgba(75,17,24,0.72);
}

.sn-mesh-node-sub {
  opacity: 0.85;
  font-size: 0.8rem;
  margin-top: 2px;
}

.sn-mesh-node-card {
  border: 1px solid rgba(187,163,119,0.22);
  border-radius: 7px;
  background: rgba(0, 22, 8, 0.45);
  margin-bottom: 8px;
}

.sn-mesh-node-card.is-selected {
  border-color: var(--sn-neon);
  box-shadow: inset 0 0 0 1px rgba(187,163,119,0.35);
}

.sn-mesh-node-summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 10px;
  display: grid;
  gap: 4px;
}

.sn-mesh-node-summary::-webkit-details-marker {
  display: none;
}

.sn-mesh-node-name {
  font-weight: 700;
}

.sn-mesh-node-meta {
  font-size: 0.8rem;
  opacity: 0.85;
}

.sn-mesh-node-status {
  font-size: 0.78rem;
  width: fit-content;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(187, 163, 119, 0.45);
  background: rgba(42, 31, 20, 0.35);
}

.sn-mesh-node-status.is-online {
  color: #d7f0c2;
  border-color: rgba(162, 191, 128, 0.72);
  background: rgba(43, 63, 26, 0.45);
}

.sn-mesh-node-status.is-offline {
  color: #e5bf96;
  border-color: rgba(187, 123, 86, 0.7);
  background: rgba(72, 36, 24, 0.45);
}

.sn-mesh-role-pill {
  font-size: 0.76rem;
  width: fit-content;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(176, 196, 176, 0.5);
}

.sn-mesh-role-relay {
  color: var(--sn-beige);
  border-color: rgba(216, 195, 155, 0.65);
  background: rgba(52, 34, 24, 0.45);
}

.sn-mesh-role-static {
  color: #d8d2c0;
  border-color: rgba(178, 162, 132, 0.52);
  background: rgba(44, 40, 34, 0.35);
}

.sn-mesh-role-mobile {
  color: #f0d48f;
  border-color: rgba(187, 163, 119, 0.68);
  background: rgba(79, 56, 18, 0.4);
}

.sn-mesh-fav {
  font-size: 0.88rem;
  color: #ffe06d;
}

.sn-mesh-node-body {
  padding: 8px 10px 10px;
  border-top: 1px solid rgba(187,163,119,0.16);
  display: grid;
  gap: 8px;
}

.sn-mesh-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sn-mesh-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(187, 163, 119, 0.45);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.78rem;
  line-height: 1.2;
}

.sn-mesh-chip-good {
  color: #d7efbf;
  border-color: rgba(159, 186, 123, 0.68);
  background: rgba(40, 58, 24, 0.48);
}

.sn-mesh-chip-warn {
  color: #f0d293;
  border-color: rgba(187, 163, 119, 0.7);
  background: rgba(84, 58, 20, 0.45);
}

.sn-mesh-chip-bad {
  color: #efb3b3;
  border-color: rgba(170, 96, 96, 0.68);
  background: rgba(78, 28, 28, 0.45);
}

.sn-mesh-chip-neutral {
  color: #d9d2c4;
  border-color: rgba(187, 163, 119, 0.5);
  background: rgba(45, 38, 30, 0.42);
}

.sn-mesh-muted {
  opacity: 0.75;
  font-size: 0.82em;
}

.sn-mesh-detail-card {
  border: 1px solid rgba(187,163,119,0.25);
  border-radius: 8px;
  background: rgba(0, 20, 8, 0.5);
  padding: 10px;
  display: grid;
  gap: 10px;
}

.sn-mesh-detail-title {
  font-weight: 700;
  color: var(--sn-neon);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.sn-mesh-detail-section {
  border: 1px solid rgba(187,163,119,0.15);
  border-radius: 6px;
  background: rgba(2, 15, 6, 0.45);
  padding: 8px;
  display: grid;
  gap: 6px;
}

.sn-mesh-detail-heading {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(187, 163, 119, 0.95);
}

.sn-mesh-kv-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(130px, 1.3fr);
  gap: 8px;
  align-items: center;
}

.sn-mesh-kv-label {
  font-size: 0.84rem;
  opacity: 0.85;
}

.sn-mesh-kv-value {
  font-size: 0.85rem;
  border-radius: 5px;
  padding: 3px 8px;
  border: 1px solid rgba(187, 163, 119, 0.4);
  background: rgba(42, 34, 27, 0.4);
  color: #e0d8c9;
}

.sn-mesh-kv-value.is-good {
  color: #d7efbf;
  border-color: rgba(159, 186, 123, 0.68);
  background: rgba(40, 58, 24, 0.44);
}

.sn-mesh-kv-value.is-warn {
  color: #f0d293;
  border-color: rgba(187, 163, 119, 0.7);
  background: rgba(84, 58, 20, 0.4);
}

.sn-mesh-kv-value.is-bad {
  color: #efb3b3;
  border-color: rgba(170, 96, 96, 0.68);
  background: rgba(78, 28, 28, 0.42);
}

.sn-mesh-kv-value.is-neutral {
  color: #e0d8c9;
}

.sn-mesh-chat {
  display: grid;
  gap: 8px;
}

.sn-mesh-day-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: rgba(224, 216, 201, 0.8);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sn-mesh-day-divider::before,
.sn-mesh-day-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(187, 163, 119, 0), rgba(187, 163, 119, 0.6), rgba(187, 163, 119, 0));
}

#mesh-messages {
  max-height: clamp(220px, 42vh, 480px);
  overflow-y: auto;
  padding-right: 4px;
}

.sn-mesh-msg-row {
  display: flex;
  width: 100%;
}

.sn-mesh-msg-row.tx {
  justify-content: flex-end;
}

.sn-mesh-msg-row.rx {
  justify-content: flex-start;
}

.sn-mesh-msg-bubble {
  position: relative;
  width: fit-content;
  max-width: min(92%, 620px);
  border-radius: 12px;
  border: 1px solid rgba(187, 163, 119, 0.55);
  padding: 8px 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.24);
}

.sn-mesh-msg-bubble.is-replyable {
  cursor: pointer;
}

.sn-mesh-msg-bubble.is-replyable:hover,
.sn-mesh-msg-bubble.is-replyable:focus-visible {
  border-color: rgba(216, 195, 155, 0.9);
  box-shadow: 0 0 0 1px rgba(216, 195, 155, 0.35), 0 4px 14px rgba(0, 0, 0, 0.32);
}

.sn-mesh-msg-row.tx .sn-mesh-msg-bubble {
  background: linear-gradient(180deg, rgba(17, 42, 20, 0.92), rgba(11, 28, 14, 0.95));
}

.sn-mesh-msg-row.rx .sn-mesh-msg-bubble {
  background: linear-gradient(180deg, rgba(54, 20, 23, 0.92), rgba(36, 14, 16, 0.95));
}

.sn-mesh-msg-bubble.is-dm {
  border-color: rgba(231, 199, 132, 0.96);
  box-shadow: inset 0 0 0 1px rgba(231, 199, 132, 0.32), 0 0 0 1px rgba(231, 199, 132, 0.26), 0 4px 14px rgba(0, 0, 0, 0.32);
}

.sn-mesh-msg-row.rx .sn-mesh-msg-bubble.is-dm {
  background: linear-gradient(180deg, rgba(98, 28, 33, 0.97), rgba(58, 16, 21, 0.99));
}

.sn-mesh-msg-bubble.is-dm::before {
  content: "DM";
  position: absolute;
  top: -9px;
  right: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(231, 199, 132, 0.95);
  background: rgba(80, 22, 22, 0.96);
  color: #f5deae;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.sn-mesh-msg-row.rx .sn-mesh-msg-bubble.is-dm::before {
  left: 10px;
  right: auto;
}

.sn-mesh-msg-row.tx .sn-mesh-msg-bubble::after,
.sn-mesh-msg-row.rx .sn-mesh-msg-bubble::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  bottom: 8px;
  transform: rotate(45deg);
  border-bottom: 1px solid rgba(187, 163, 119, 0.55);
  border-right: 1px solid rgba(187, 163, 119, 0.55);
}

.sn-mesh-msg-row.tx .sn-mesh-msg-bubble::after {
  right: -6px;
  background: rgba(11, 28, 14, 0.95);
}

.sn-mesh-msg-row.rx .sn-mesh-msg-bubble::after {
  left: -6px;
  background: rgba(36, 14, 16, 0.95);
  transform: rotate(225deg);
}

.sn-mesh-msg-meta {
  font-size: 0.7rem;
  color: rgba(216, 195, 155, 0.95);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sn-mesh-msg-kind {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(187, 163, 119, 0.5);
  padding: 0 6px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.sn-mesh-msg-kind.is-dm {
  background: rgba(231, 199, 132, 0.26);
  border-color: rgba(231, 199, 132, 0.96);
  color: #ffebb9;
}

.sn-mesh-msg-kind.is-ch {
  background: rgba(126, 142, 102, 0.16);
  border-color: rgba(126, 142, 102, 0.58);
  color: #c5d5ab;
}

.sn-mesh-msg-text {
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--sn-text);
  white-space: pre-wrap;
  word-break: break-word;
}

@media (min-width: 960px) {
  .sn-comm-layout {
    grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  }
}

.sn-reader {
  width: 100%;
  min-height: 240px;
  background: rgba(0, 10, 0, 0.65);
  color: var(--sn-text);
  border: 1px solid var(--sn-border);
  border-radius: 4px;
  padding: 10px;
  resize: vertical;
  margin: 8px 0;
}

.sn-reader-touch {
  width: 100%;
  min-height: 58vh;
  border: 1px solid var(--sn-border);
  border-radius: 6px;
  background: #020;
  margin: 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
  overflow: hidden;
}

.sn-reader-fullscreen-open {
  overflow: hidden;
}

.sn-reader-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 5000;
  margin: 0;
  border-radius: 0;
  border: 0;
  background: #000;
  padding: 8px;
  display: flex !important;
  flex-direction: column;
  gap: 8px;
}

.sn-reader-fullscreen .sn-inline-row {
  flex-wrap: nowrap;
  gap: 6px;
}

.sn-reader-fullscreen .sn-inline-row button {
  min-height: 40px;
}

.sn-reader-fullscreen .sn-reader-touch {
  flex: 1;
  min-height: 0;
  margin: 0;
}

.sn-map-touch {
  position: relative;
  overflow: hidden;
  border: 1px dashed rgba(187,163,119,0.5);
  border-radius: 6px;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--sn-neon);
  background: radial-gradient(circle at 50% 20%, rgba(0, 40, 0, 0.45), rgba(0, 10, 0, 0.75));
  padding: 0;
}

.sn-map-tile {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  border-radius: 4px;
}

.sn-map-touch .maplibregl-map {
  width: 100%;
  min-height: 320px;
}

.sn-map-touch .maplibregl-canvas {
  cursor: grab;
}

.sn-map-touch .maplibregl-canvas:active {
  cursor: grabbing;
}

.sn-map-overlay {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.58);
  border: 1px solid rgba(187, 163, 119, 0.45);
  color: var(--sn-neon);
  padding: 4px 8px;
  border-radius: 4px;
}

.sn-map-hint {
  font-size: 0.86rem;
  line-height: 1.35;
}

.sn-map-subtitle {
  margin-top: 10px;
  margin-bottom: 6px;
  color: var(--sn-neon);
  font-size: 0.86rem;
}

.sn-layer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sn-layer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--sn-border);
  border-radius: 999px;
  background: rgba(0, 20, 0, 0.55);
  font-size: 0.82rem;
}

.sn-layer-toggle input {
  accent-color: var(--sn-neon);
}

.sn-marker-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.sn-marker-row .sn-result-item {
  flex: 1;
}

.sn-marker-delete {
  min-width: 88px;
  border: 1px solid rgba(255, 95, 86, 0.45);
  color: #ff8b84;
  background: rgba(40, 8, 8, 0.65);
  border-radius: 4px;
}

.sn-result-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px;
  font-size: 0.85rem;
}

.sn-result-item:focus-visible,
.sn-book-card:focus-visible,
.sn-inline-row button:focus-visible {
  outline: 1px solid rgba(216,195,155,0.6);
  outline-offset: 1px;
}
/* Chat Bubbles */
.sn-chat-bubble {
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  max-width: 80%;
  word-wrap: break-word;
}

.sn-chat-user {
  background: linear-gradient(135deg, rgba(65,42,14,0.88), rgba(45,28,8,0.92));
  border: 1px solid rgba(187,163,119,0.38);
  color: var(--sn-beige);
  margin-left: auto;
  text-align: right;
}

.sn-chat-assistant {
  background: rgba(0,22,0,0.65);
  color: var(--sn-text);
  border: 1px solid var(--sn-border);
  margin-right: auto;
  max-width: 96%;
  line-height: 1.5;
  font-size: 0.94rem;
}

.sn-chat-system {
  background: rgba(255,100,100,0.15);
  color: #ffaaaa;
  border: 1px solid rgba(255,100,100,0.35);
  text-align: center;
  font-style: italic;
  max-width: 100%;
}

/* Module header row (title + clear btn) */
.sn-module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
}

.sn-module-header .sn-module-title {
  margin-bottom: 0;
  flex: 1;
}

/* Clear / Neu button */
.sn-clear-btn {
  font-size: 0.75rem;
  padding: 5px 10px;
  background: rgba(75,17,24,0.28);
  color: var(--sn-sand);
  border: 1px solid rgba(187,163,119,0.28);
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.04em;
  white-space: nowrap;
  min-height: 30px;
  flex-shrink: 0;
}
.sn-clear-btn:hover {
  background: rgba(75,17,24,0.55);
  color: var(--sn-beige);
  border-color: rgba(216,195,155,0.5);
}

/* Thinking animation (3 bouncing dots) */
.sn-thinking {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 4px;
  margin: 4px 0 6px;
}

.sn-thinking-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sn-sand);
  animation: sn-dot-bounce 1.4s infinite ease-in-out both;
}
.sn-thinking-dot:nth-child(1) { animation-delay: -0.32s; }
.sn-thinking-dot:nth-child(2) { animation-delay: -0.16s; }
.sn-thinking-dot:nth-child(3) { animation-delay: 0s; }

@keyframes sn-dot-bounce {
  0%, 80%, 100% { transform: scale(0.55); opacity: 0.45; }
  40%           { transform: scale(1);    opacity: 1; }
}

.sn-thinking-label {
  font-size: 0.78rem;
  color: var(--sn-sand);
  opacity: 0.75;
  margin-left: 4px;
  font-style: italic;
}

/* Typing cursor (shown while streaming) */
.sn-typing-cursor {
  display: inline-block;
  width: 2px;
  height: 0.9em;
  background: var(--sn-neon);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: sn-cursor-blink 0.65s step-start infinite;
}
@keyframes sn-cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Markdown rendering inside assistant bubbles */
.sn-chat-assistant .sn-md-h2 {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--sn-neon);
  margin: 10px 0 4px;
  text-shadow: 0 0 5px rgba(187,163,119,0.35);
}
.sn-chat-assistant .sn-md-h3 {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--sn-beige);
  margin: 8px 0 2px;
}
.sn-chat-assistant .sn-md-ul {
  margin: 4px 0 6px 16px;
  padding: 0;
}
.sn-chat-assistant .sn-md-ul li {
  margin-bottom: 3px;
  font-size: 0.93rem;
  line-height: 1.5;
}
.sn-chat-assistant p {
  margin: 0 0 6px;
}
.sn-chat-assistant strong {
  color: var(--sn-beige);
}
.sn-chat-assistant em {
  color: var(--sn-sand);
  font-style: italic;
}

/* Copy button on completed assistant answers */
.sn-copy-btn {
  display: block;
  margin-top: 8px;
  padding: 3px 10px;
  font-size: 0.75rem;
  background: rgba(0,12,0,0.45);
  border: 1px solid rgba(187,163,119,0.18);
  border-radius: 4px;
  color: var(--sn-sand);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.18s, border-color 0.18s;
  letter-spacing: 0.03em;
}
.sn-copy-btn:hover {
  opacity: 1;
  border-color: rgba(187,163,119,0.5);
}
/* Buttons / Center */

.sn-center {
  text-align: center;
}

.sn-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--sn-btn-height);
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid rgba(216,195,155,0.5);
  color: var(--sn-beige);
  text-decoration: none;
  background: linear-gradient(180deg, rgba(30,46,22,0.96), rgba(20,32,15,0.96));
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sn-button:active {
  background: linear-gradient(180deg, rgba(37,56,27,0.98), rgba(25,40,18,0.98));
  box-shadow: 0 0 10px rgba(75,17,24,0.75);
}

#drprep .sn-chat-input {
  margin-top: 10px;
}

#drprep .sn-domain-filter {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

#maps .sn-primary-action-bar .sn-primary-btn {
  width: 100%;
}

#maps .sn-primary-action-bar {
  margin-top: 0;
}

/* Loading */

.sn-loading {
  color: var(--sn-neon);
  text-shadow: 0 0 6px rgba(187,163,119,0.6);
  font-size: 0.9rem;
}

.sn-btn-loading {
  opacity: 0.85;
}

.sn-btn-loading::after {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-left: 8px;
  border: 2px solid rgba(216,195,155,0.38);
  border-top-color: var(--sn-neon);
  border-radius: 50%;
  animation: sn-spin 0.8s linear infinite;
}

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

.sn-marker-copy {
  min-width: 70px;
  border: 1px solid rgba(216,195,155,0.42);
  color: var(--sn-beige);
  background: rgba(24, 18, 8, 0.55);
  border-radius: 4px;
}

.sn-marker-coord {
  color: var(--sn-neon);
  font-variant-numeric: tabular-nums;
}

/* Mobile Tweaks */

@media (min-width: 768px) {
  .sn-tab {
    font-size: 0.95rem;
  }
}

@media (max-width: 767px) {
  .sn-tools-overview,
  .sn-button-row {
    flex-wrap: wrap;
  }

  .sn-inline-row {
    flex-wrap: wrap;
    align-items: stretch;
  }

  .sn-inline-row input {
    flex: 1 1 100%;
  }

  .sn-inline-row select,
  .sn-inline-row button,
  .sn-inline-row .sn-button {
    flex: 1 1 calc(50% - 4px);
    min-width: 140px;
  }

  .sn-primary-action-bar {
    padding: 8px;
  }

  .sn-primary-action-bar .sn-primary-btn {
    flex: 1 1 44%;
  }

  #tools .sn-tools-overview .sn-tool-anchor {
    flex: 1 1 calc(50% - 4px);
  }

  .sn-comm-address-row #mesh-channel {
    flex: 1 1 calc(50% - 4px);
    max-width: none;
  }
}

/* Audio Player */

#audio-player {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
}

/* Ausklappbarer Bereich – final, stabil, nicht blockierend */

#audio-player-expanded {
    position: fixed;
    left: 0;
    right: 0;

    /* sitzt direkt über der Player-Bar + safe-area */
  bottom: calc(84px + env(safe-area-inset-bottom));

    max-height: 50vh;
    overflow-y: auto;

    background: var(--sn-bg-panel);
    border-top: 1px solid var(--sn-border);
    padding: 12px;
    box-shadow: 0 -2px 12px rgba(75,17,24,0.65);

    z-index: 3002;
}

/* AUDIO – Now Playing bubble */
#audio-now-playing {
  margin: 0 10px 14px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(75,17,24,0.32), rgba(12,24,10,0.72));
  border: 1px solid rgba(180,20,30,0.45);
  border-radius: 10px;
  color: var(--sn-beige);
  font-size: 0.88rem;
  font-weight: 600;
  display: none;
  gap: 8px;
}

#audio-now-playing:not(:empty) {
  display: flex;
  align-items: center;
}



#audio-album-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    padding: 10px;
    padding-bottom: calc(var(--audio-player-offset) + 12px);
  }

.audio-album {
  background: linear-gradient(180deg, rgba(18,28,14,0.92), rgba(12,20,10,0.92));
  border: 1px solid rgba(216,195,155,0.42);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
}

.audio-album:hover {
  box-shadow: 0 0 12px rgba(75,17,24,0.72);
}

  .audio-album.playing {
    border-color: rgba(180,20,30,0.85);
    box-shadow: 0 0 0 2px rgba(180,20,30,0.9), 0 0 28px rgba(120,10,18,0.9), 0 0 8px rgba(120,10,18,0.6) inset;
  }

.audio-album * {
    pointer-events: none;
}

.audio-cover {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 6px;
}

.audio-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.audio-cover-placeholder {
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 50% 45%, #0d2010 0%, #050a05 100%);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.audio-cover-placeholder::before {
    content: "DR";
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--sn-beige);
    text-shadow: 0 0 14px rgba(75,17,24,0.75);
    letter-spacing: 0.12em;
}

.audio-cover-placeholder::after {
    content: "PREP";
    font-size: 0.58rem;
    font-weight: 700;
    color: rgba(216,195,155,0.8);
    letter-spacing: 0.35em;
}

.audio-title {
    margin-top: 8px;
    font-size: 13px;
    color: var(--sn-beige);
    line-height: 1.3;
    display: -webkit-box;
  line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

/* AUDIO – Spotify‑Style Player */

#audio-player-bar {
    position: fixed;
    left: 0;
    right: 0;

    /* WICHTIG: über der Home-Leiste sitzen */
    bottom: env(safe-area-inset-bottom);

    /* visuelle Höhe der Bar */
    min-height: 60px;

    /* Platz nach unten für die safe-area */
    padding-bottom: env(safe-area-inset-bottom);

    background: var(--sn-bg-panel);
    border-top: 2px solid var(--sn-border);
    padding-top: 8px;
    padding-left: 12px;
    padding-right: 12px;
    box-shadow: 0 -2px 12px rgba(75,17,24,0.78);

    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 3001;
}

/* Obere Zeile: Expand + Titel */
#player-top-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

#player-track-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

#player-expand {
    background: none;
  border: 1px solid var(--sn-border);
  color: var(--sn-beige);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 14px;
}

#player-minimize {
  background: none;
  border: 1px solid var(--sn-border);
  color: var(--sn-beige);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 14px;
}

#player-track-title-wrap {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

#player-track-title {
  color: var(--sn-beige);
    font-size: 14px;
    white-space: nowrap;
  display: inline-block;
  padding-right: 24px;
}

#player-track-title.marquee {
  animation: player-title-marquee var(--marquee-duration, 14s) linear infinite;
}

#player-track-elapsed {
  color: var(--sn-text);
  font-size: 13px;
  min-width: 3.8ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}

@keyframes player-title-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-1 * var(--marquee-shift, 0px)));
  }
}

/* Untere Zeile: Play + Fortschritt */
#player-bottom-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

#player-transport-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

#player-prev,
#player-playpause,
#player-next {
    background: none;
  border: 1px solid var(--sn-border);
  color: var(--sn-beige);
  padding: 6px 10px;
    border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  min-width: 40px;
  height: 34px;
  cursor: pointer;
  transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.08s ease;
}

#player-playpause {
  min-width: 46px;
}

#player-prev:hover,
#player-playpause:hover,
#player-next:hover {
  background: rgba(216,195,155,0.12);
  box-shadow: 0 0 10px rgba(75,17,24,0.75);
}

#player-prev:active,
#player-playpause:active,
#player-next:active {
  transform: scale(0.96);
}

#player-progress {
    flex: 1 1 auto;
    height: 6px;
    margin: 0;
}

  .sn-flow-step {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(187,163,119,0.16);
  }

  .sn-flow-step:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .sn-flow-branches {
    display: grid;
    gap: 8px;
    margin-top: 8px;
  }

  .sn-flow-branch {
    display: inline-block;
    margin-bottom: 6px;
    padding: 2px 8px;
    border: 1px solid rgba(187,163,119,0.24);
    border-radius: 999px;
    color: var(--sn-neon);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
#player-expanded-tracklist .track-item {
    padding: 10px;
  border-bottom: 1px solid var(--sn-border);
    cursor: pointer;
  color: var(--sn-text);
}

#player-expanded-tracklist .track-item:hover {
  background: rgba(216,195,155,0.12);
}

/* Overlay Fix */

#audio-player {
    z-index: 3000;
}

#audio-player-bar {
    z-index: 3001;
}

#audio-player-expanded {
    z-index: 3002;
}

#player-restore {
  position: fixed;
  right: 12px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 3100;
  border: 1px solid rgba(187,163,119,0.5);
  background: linear-gradient(180deg, rgba(10,25,10,0.95), rgba(6,18,6,0.95));
  color: var(--sn-neon);
  border-radius: 999px;
  min-height: 40px;
  padding: 0 14px;
}

.hidden {
    display: none !important;
}

/* VIDEO SECTION */

.sn-reader-image {
  width: 100%;
  height: 100%;
  max-height: 72vh;
  object-fit: contain;
  background: #020;
}
/* VIDEO – Genre Section */

.video-genre {
    margin-bottom: 28px;
}

.video-genre-title {
    font-size: 1.2rem;
    color: var(--sn-neon);
    margin: 0 12px 8px 12px;
    text-shadow: 0 0 6px rgba(187,163,119,0.6);
}

.video-row {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 0 12px 6px 12px;
    scroll-snap-type: x mandatory;
}

.video-row::-webkit-scrollbar {
    display: none;
}

.video-item {
    flex: 0 0 auto;
    width: auto;
    min-width: 90px;
    max-width: 150px;
    scroll-snap-align: start;
    cursor: pointer;
    background: #0f140f;
    border: 1px solid var(--sn-border);
    border-radius: 6px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    transition: box-shadow 0.2s;
}

.video-item:active {
    box-shadow: 0 0 12px rgba(187,163,119,0.5);
}

.video-item img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--sn-border);
}

.video-cover-placeholder {
  width: 100%;
  aspect-ratio: 2 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 1px solid var(--sn-border);
  background: linear-gradient(160deg, rgba(0, 20, 0, 0.95), rgba(18, 48, 18, 0.92));
  color: var(--sn-neon);
  font-size: 2rem;
  font-weight: 700;
}

.video-item-title {
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--sn-text);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

#tab-wissen {
  display: none; /* wird per JS sichtbar gemacht */
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.chat-message {
  margin-bottom: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
}

.chat-user {
  background: #1e293b;
  align-self: flex-end;
}

.chat-assistant {
  background: #0f172a;
  align-self: flex-start;
}

#chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
}

#chat-input {
  flex: 1;
}

/* === Morse Touch-Eingabe === */
.morse-touch-key {
  display: block;
  width: 100%;
  min-height: 88px;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--sn-dark-red);
  color: var(--sn-beige);
  border: 2px solid var(--sn-sand);
  border-radius: 12px;
  margin: 8px 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: background 0.08s, transform 0.08s;
}
.morse-touch-key.pressed,
.morse-touch-key:active {
  background: var(--sn-sand);
  color: #000;
  transform: scale(0.97);
}
.morse-touch-symbols {
  font-family: monospace;
  font-size: 1.3rem;
  letter-spacing: 3px;
  min-height: 2.2em;
  max-height: 5em;
  overflow-y: auto;
  padding: 6px 10px;
  background: #0a0a0a;
  border: 1px solid var(--sn-border);
  border-radius: 6px;
  word-break: break-all;
  margin-bottom: 6px;
  color: var(--sn-neon);
}
.sn-hint {
  font-size: 0.82rem;
  color: #aaa;
  margin: 2px 0 6px;
}

.sn-kiwix-shell {
  padding: 10px;
}

.sn-kiwix-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.sn-kiwix-frame {
  display: block;
  width: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #0a0a0a;
}

body.sn-ui-v2 #wissen {
  overflow: hidden;
}

#wissen .sn-wissen-module,
body.sn-ui-v2 #wissen .sn-wissen-module {
  max-width: none;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
}

#wissen .sn-kiwix-full,
body.sn-ui-v2 #wissen .sn-kiwix-full {
  flex: 1;
  min-height: 0;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

#wissen .sn-kiwix-overlay-actions,
body.sn-ui-v2 #wissen .sn-kiwix-overlay-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  gap: 8px;
}

#wissen .sn-kiwix-open-link,
#wissen .sn-kiwix-overlay-btn,
body.sn-ui-v2 #wissen .sn-kiwix-open-link,
body.sn-ui-v2 #wissen .sn-kiwix-overlay-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(216,195,155,0.58);
  background: rgba(12, 10, 8, 0.72);
  color: var(--sn-beige);
  text-decoration: none;
  font-size: 0.8rem;
  backdrop-filter: blur(1px);
}

#wissen .sn-kiwix-overlay-btn,
body.sn-ui-v2 #wissen .sn-kiwix-overlay-btn {
  cursor: pointer;
}

#wissen .sn-kiwix-open-link:hover,
#wissen .sn-kiwix-open-link:focus-visible,
#wissen .sn-kiwix-overlay-btn:hover,
#wissen .sn-kiwix-overlay-btn:focus-visible,
body.sn-ui-v2 #wissen .sn-kiwix-open-link:hover,
body.sn-ui-v2 #wissen .sn-kiwix-open-link:focus-visible,
body.sn-ui-v2 #wissen .sn-kiwix-overlay-btn:hover,
body.sn-ui-v2 #wissen .sn-kiwix-overlay-btn:focus-visible {
  border-color: rgba(216,195,155,0.9);
  box-shadow: 0 0 10px rgba(75,17,24,0.55);
}

#wissen .sn-kiwix-frame,
body.sn-ui-v2 #wissen .sn-kiwix-frame {
  flex: 1;
  min-height: 0;
  height: 100%;
  width: 100%;
}

.morse-touch-advanced {
  margin: 6px 0 10px;
  border: 1px solid var(--sn-border);
  border-radius: 8px;
  background: rgba(8, 16, 8, 0.45);
}

.morse-touch-advanced > summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--sn-beige);
  padding: 8px 10px;
  user-select: none;
}

.morse-touch-advanced-body {
  padding: 0 10px 10px;
}

.morse-touch-range-row {
  margin-top: 8px;
}

.morse-touch-range-row label {
  display: block;
  font-size: 0.82rem;
  color: #b8c9b8;
  margin-bottom: 4px;
}

.morse-touch-range-row input[type="range"] {
  width: 100%;
}

/* === UI V2 (toggle via body.sn-ui-v2) === */
body.sn-ui-v2 .sn-module {
  max-width: 980px;
}

body.sn-ui-v2 .sn-module-title {
  margin-bottom: 10px;
}

body.sn-ui-v2 .sn-module-intro {
  opacity: 0.9;
  margin-bottom: 12px;
}

body.sn-ui-v2 .sn-module > .sn-card,
body.sn-ui-v2 .sn-module > details,
body.sn-ui-v2 .sn-module > .sn-tool-section {
  margin-bottom: 12px;
}

body.sn-ui-v2 .sn-card {
  border-color: rgba(187, 163, 119, 0.4);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  padding: 12px;
}

body.sn-ui-v2 .sn-topic-card h4 {
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(187, 163, 119, 0.24);
  color: var(--sn-beige);
  font-size: 1rem;
}

body.sn-ui-v2 .sn-inline-row {
  gap: 8px;
  align-items: center;
}

body.sn-ui-v2 .sn-inline-row input,
body.sn-ui-v2 .sn-inline-row select {
  min-height: 40px;
}

body.sn-ui-v2 .sn-inline-row button,
body.sn-ui-v2 .sn-button,
body.sn-ui-v2 .sn-primary-btn {
  min-height: 40px;
}

body.sn-ui-v2 .sn-mini-results {
  margin-top: 8px;
  border: 1px solid rgba(187, 163, 119, 0.2);
  background: rgba(6, 10, 6, 0.72);
  border-radius: 8px;
  padding: 8px;
}

body.sn-ui-v2 .sn-result-item + .sn-result-item {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(187, 163, 119, 0.2);
}

body.sn-ui-v2 .sn-secondary-actions > summary,
body.sn-ui-v2 .sn-tool-section > summary {
  font-weight: 700;
  letter-spacing: 0.01em;
}

body.sn-ui-v2 .sn-tool-section > summary {
  background: rgba(30, 18, 12, 0.55);
  border: 1px solid rgba(187, 163, 119, 0.22);
  border-radius: 8px;
}

body.sn-ui-v2 .sn-tool-section[open] > summary {
  border-color: rgba(216, 195, 155, 0.45);
}

body.sn-ui-v2 #tools .sn-tool-section {
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(14, 18, 12, 0.68), rgba(8, 10, 8, 0.82));
  border-color: rgba(187, 163, 119, 0.2);
}

body.sn-ui-v2 #tools .sn-tool-section > summary {
  margin: 0;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(40, 20, 18, 0.8), rgba(18, 18, 12, 0.88));
  border: 0;
  border-radius: 0;
}

body.sn-ui-v2 #tools .sn-tool-section[open] {
  border-color: rgba(216, 195, 155, 0.4);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
}

body.sn-ui-v2 #tools .sn-tool-section[open] > summary {
  border-bottom: 1px solid rgba(216, 195, 155, 0.16);
}

body.sn-ui-v2 #tools .sn-tool-section-body {
  padding: 14px;
  background:
    radial-gradient(circle at 100% 0%, rgba(187, 163, 119, 0.08), transparent 28%),
    rgba(5, 8, 5, 0.5);
}

body.sn-ui-v2 #tools .sn-tool-section-body > .sn-card + .sn-card {
  margin-top: 12px;
}

body.sn-ui-v2 #tools .sn-tool-section-body > .sn-card {
  background: rgba(10, 16, 10, 0.86);
  border: 1px solid rgba(187, 163, 119, 0.22);
}

.sn-cockpit {
  margin-bottom: 12px;
  padding: 12px;
}

.sn-cockpit-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.sn-cockpit-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--sn-beige);
}

.sn-cockpit-hint {
  font-size: 0.78rem;
  color: #c6b79c;
  opacity: 0.85;
}

.sn-cockpit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sn-cockpit-tile {
  text-align: left;
  border: 1px solid rgba(187, 163, 119, 0.46);
  background: linear-gradient(180deg, rgba(45, 20, 18, 0.9), rgba(20, 16, 12, 0.94));
  color: var(--sn-text);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  min-height: 72px;
}

.sn-cockpit-tile strong {
  display: block;
  color: var(--sn-beige);
  font-size: 0.94rem;
  margin-bottom: 2px;
}

.sn-cockpit-tile span {
  display: block;
  font-size: 0.78rem;
  color: #d6d1c7;
  opacity: 0.92;
}

.sn-cockpit-tile:hover,
.sn-cockpit-tile:focus-visible {
  border-color: rgba(216, 195, 155, 0.8);
  box-shadow: 0 0 0 1px rgba(216, 195, 155, 0.35), 0 0 12px var(--sn-dark-red-glow);
}

@media (max-width: 640px) {
  body.sn-ui-v2 .sn-inline-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.sn-ui-v2 .sn-inline-row button,
  body.sn-ui-v2 .sn-inline-row .sn-button,
  body.sn-ui-v2 .sn-primary-btn {
    width: 100%;
  }

  .sn-cockpit-grid {
    grid-template-columns: 1fr;
  }
}
