:root {
  --bg: #313338;
  --panel-bg: #2b2d31;
  --workspace-bg: #1e1f22;
  --accent: #0ea5e9;
  --text: #f2f3f5;
  --border: #444;
  --input-bg: #1e1f22;
  --input-border: #555;
  --node-text: #dcddde;
  --inputs-color: #358f8e;
  --snake-color: #e67e22;
  --io-color: #3498db;
  --drivers-color: #9b59b6;
  --header-height: 52px;
  --footer-height: 56px;
  --content-padding: 1rem;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
}

body.light {
  --bg: #e6e7ea; /* subtle gray background */
  --panel-bg: #f5f6f8; /* panels slightly darker than bg */
  --workspace-bg: #dcdfe3; /* workspace area */
  --accent: #0ea5e9;
  --text: #1c1c1e;
  --border: #b8b9be;
  --input-bg: #f7f8fa;
  --input-border: #c5c7cc;
  --node-text: #000;
  --inputs-color: #48b6a5;
  --snake-color: #e9a23b;
  --io-color: #5dade2;
  --drivers-color: #af7ac5;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.android-app {
  min-height: 100dvh;
  --header-height: calc(52px + var(--safe-top));
  --footer-height: calc(72px + var(--safe-bottom));
  --content-padding: 0.5rem;
  --content-gap: 8px;
}

body.desktop-win,
body.desktop-mac {
  --content-padding: 2rem;
}

body.desktop-win .panel,
body.desktop-mac .panel {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

body.desktop-win,
body.desktop-mac {
  scrollbar-width: none;
  scrollbar-color: var(--accent) var(--workspace-bg);
}

body.desktop-win *,
body.desktop-mac * {
  scrollbar-width: none;
}

body.desktop-win *:hover,
body.desktop-mac *:hover,
body.desktop-win *:focus,
body.desktop-mac *:focus {
  scrollbar-width: thin;
}

body.desktop-win ::-webkit-scrollbar,
body.desktop-mac ::-webkit-scrollbar,
body.desktop-win *::-webkit-scrollbar,
body.desktop-mac *::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

body.desktop-win ::-webkit-scrollbar-track,
body.desktop-mac ::-webkit-scrollbar-track,
body.desktop-win *::-webkit-scrollbar-track,
body.desktop-mac *::-webkit-scrollbar-track {
  background: var(--workspace-bg);
}

body.desktop-win ::-webkit-scrollbar-thumb,
body.desktop-mac ::-webkit-scrollbar-thumb,
body.desktop-win *::-webkit-scrollbar-thumb,
body.desktop-mac *::-webkit-scrollbar-thumb {
  background-color: var(--accent);
  border-radius: 8px;
}

body.desktop-win ::-webkit-scrollbar-track,
body.desktop-mac ::-webkit-scrollbar-track,
body.desktop-win *::-webkit-scrollbar-track,
body.desktop-mac *::-webkit-scrollbar-track,
body.desktop-win ::-webkit-scrollbar-thumb,
body.desktop-mac ::-webkit-scrollbar-thumb,
body.desktop-win *::-webkit-scrollbar-thumb,
body.desktop-mac *::-webkit-scrollbar-thumb {
  opacity: 0;
  transition: opacity 0.2s;
}

body.desktop-win ::-webkit-scrollbar-track:hover,
body.desktop-mac ::-webkit-scrollbar-track:hover,
body.desktop-win *:hover::-webkit-scrollbar-track,
body.desktop-mac *:hover::-webkit-scrollbar-track,
body.desktop-win ::-webkit-scrollbar-thumb:hover,
body.desktop-mac ::-webkit-scrollbar-thumb:hover,
body.desktop-win *:hover::-webkit-scrollbar-thumb,
body.desktop-mac *:hover::-webkit-scrollbar-thumb,
body.desktop-win ::-webkit-scrollbar-track:active,
body.desktop-mac ::-webkit-scrollbar-track:active,
body.desktop-win *:active::-webkit-scrollbar-track,
body.desktop-mac *:active::-webkit-scrollbar-track,
body.desktop-win ::-webkit-scrollbar-thumb:active,
body.desktop-mac ::-webkit-scrollbar-thumb:active,
body.desktop-win *:active::-webkit-scrollbar-thumb,
body.desktop-mac *:active::-webkit-scrollbar-thumb {
  opacity: 1;
}

body.ios-app {
  min-height: 100dvh;
  --header-height: calc(68px + env(safe-area-inset-top));
  --footer-height: calc(48px + var(--safe-bottom));
}

.ios-only {
  display: none;
}
body.ios-app .ios-only {
  display: inline-block;
}

.android-only {
  display: none;
}
body.android-app .android-only {
  display: inline-block;
}

.page-content {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--content-padding);
  padding-bottom: calc(var(--content-padding) + var(--footer-height));
}

.app-toolbar {
  flex: 0 0 auto;
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0;
  background: var(--panel-bg);
  color: var(--text);
  gap: 8px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  z-index: 1200;
}

body.android-app .app-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding-top: var(--safe-top);
  height: var(--header-height);
}

body.android-app .app-toolbar .MuiToolbar-root {
  padding-left: 8px;
  padding-right: 8px;
}

body.ios-app .app-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding-top: env(safe-area-inset-top);
  height: var(--header-height);
}

.react-nav {
  display: flex;
  flex-direction: column;
  width: 240px;
  padding: 8px 0;
}

.react-nav .MuiListItemButton-root {
  border-radius: 0;
}

.nav-footer {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#nav-toggle {
  display: block;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
}

h1 {
  margin: 0 8px 0 auto;
  font-size: 1.6em;
  text-align: right;
  display: flex;
  align-items: center;
  gap: 8px;
}

#header-icon {
  height: 48px;
  width: 48px;
}

#history-buttons {
  display: flex;
  gap: 4px;
}

#history-buttons button {
  background: none;
  border: none;
  color: var(--text);
  font-size: 16px;
  padding: 4px;
  cursor: pointer;
}



.settings-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.settings-header h2 {
  margin: 0 auto 0 0;
  font-size: 16px;
}

.settings-header button {
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
}

.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-footer {
  padding: 8px;
  border-top: 1px solid var(--border);
  background: var(--panel-bg);
  display: flex;
  justify-content: flex-end;
}

.settings-section {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-bg);
}

.settings-section summary {
  list-style: none;
  background: none;
  border: none;
  color: var(--text);
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 4px;
  font: inherit;
  font-size: 14px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  transition: filter 0.2s ease, transform 0.1s ease;
}
.settings-section summary:hover {
  filter: brightness(110%);
}
.settings-section summary:active {
  transform: scale(0.97);
}

.settings-section summary::-webkit-details-marker {
  display: none;
}


.settings-section[open] > summary {
  background: var(--accent);
  color: #fff;
}

.settings-section .section-body {
  padding: 8px;
}

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

.react-inventory > .panel {
  margin-bottom: 16px;
}



.view {
  display: none;
  width: 100%;
  flex: 1;
  overflow: auto;
}

.view.active {
  display: flex;
  flex-direction: column;
}

#inputs-view {
  padding: 12px;
  overflow-y: auto;
  background: var(--panel-bg);
  flex: 1;
  display: flex;
  flex-direction: column;
}
#inputs-view ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
#inputs-view li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 4px;
}
#inputs-view li span {
  flex: 1;
}

#diagram-view {
  background: var(--workspace-bg);
}

#stage-view {
  background: var(--workspace-bg);
}

#diagram-view.active {
  align-items: stretch;
  justify-content: stretch;
}

#stage-view.active {
  align-items: stretch;
  justify-content: stretch;
}


#diagram-legend {
  font-size: 14px;
  display: flex;
  justify-content: space-around;
  margin-bottom: 4px;
}
#diagram-legend .entry {
  display: flex;
  align-items: center;
  gap: 4px;
}
#diagram-legend .color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
#diagram-legend .input { background: var(--inputs-color); }
#diagram-legend .snake { background: var(--snake-color); }
#diagram-legend .io { background: var(--io-color); }
#diagram-legend .drivers { background: var(--drivers-color); }

#diagram-wrapper {
  flex: 1;
  overflow: auto;
  position: relative;
}

#stage-plot {
  flex: 1;
  overflow: hidden;
  position: relative;
  touch-action: none;
}

#diagram {
  width: 100%;
}

#stage-svg {
  width: 100%;
  height: 100%;
}

#stage-view .grid {
  pointer-events: none;
}

#stage-view .grid line {
  stroke: var(--border);
  stroke-width: 0.5;
  stroke-dasharray: 2 2;
}

#stage-view .item rect {
  fill: var(--accent);
  cursor: move;
}

#stage-view .item text {
  pointer-events: none;
}

#stage-view .item .icon {
  font-size: 18px;
}

#stage-view .item .label {
  font-size: 12px;
}

#stage-view .item .input {
  font-size: 10px;
}


#table-view {
  padding: 10px;
  overflow-y: auto;
  overflow-x: auto;
  background: var(--panel-bg);
}


.table-scroll {
  width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.table-scroll-container {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  cursor: grab;
  touch-action: auto;
}

.table-scroll table,
.table-scroll-container table {
  width: 100%;
}

@media (max-width: 600px) {
  #routing-table {
    font-size: 12px;
  }
}

#inventory-view {
  padding: 12px;
  overflow-y: auto;
  background: var(--panel-bg);
}

#inventory-panels {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 0;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  cursor: grab;
  touch-action: auto;
}

.inventory-table thead th {
  position: sticky;
  top: 0;
  background: var(--panel-bg);
  z-index: 1;
}

#routing-table thead th {
  position: sticky;
  top: 0;
  background: var(--panel-bg);
  z-index: 1;
}

.inventory-table th.sortable {
  cursor: pointer;
}


.panel {
  margin-bottom: 16px;
  background: var(--panel-bg);
  padding: 8px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.6);
  flex: 0 0 auto;
  width: 100%;
}

#inventory-filters .chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 0;
  width: 100%;
}

#inventory-filters {
  margin-bottom: 16px;
  width: 100%;
  touch-action: pan-y;
}

.panel h3 {
  margin: 6px 0 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.panel h3 .collapse {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}
.panel.collapsed ul,
.panel.collapsed table { display:none; }

button {
  background: var(--accent);
  border: none;
  padding: 6px 14px;
  color: #fff;
  cursor: pointer;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  transition: filter 0.2s ease, transform 0.1s ease;
}

select, input {
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--input-border);
  padding: 8px;
  border-radius: 4px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

button:hover {
  filter: brightness(110%);
}
button:active {
  transform: scale(0.97);
}

body.desktop-win .resizable,
body.desktop-mac .resizable {
  resize: both;
  overflow: auto;
}

#routing-table,
.inventory-table {
  border-collapse: collapse;
  table-layout: auto;
}

#routing-table {
  width: 100%;
}

.inventory-table {
  width: 100%;
}

@media (max-width: 600px) {
  .inventory-table th,
  .inventory-table td { font-size: 12px; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .view-menu {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
}

#app-search {
  margin: 0;
}

#routing-table th,
#routing-table td,
.inventory-table th,
.inventory-table td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
}

#routing-table th,
.inventory-table th {
  white-space: normal;
}

.inventory-table tr:hover {
  background: rgba(88,101,242,0.1);
}

.status-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #fff;
}

.status-storage { background: #4f545c; }
.status-use { background: #5865f2; }
.status-gig { background: #faa61a; }
.warn { color: #faa61a; }

.arrow {
  cursor: pointer;
  display: inline-block;
  width: 14px;
}

.count-badge {
  background: #faa61a;
  color: #fff;
  border-radius: 8px;
  padding: 0 6px;
  font-size: 11px;
  margin-left: 4px;
}

.subrow td:nth-child(2) {
  padding-left: 24px;
}

.bulk-actions {
  padding: 8px;
  gap: 8px;
  display: flex;
  flex-wrap: wrap;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--border);
  transform-origin: bottom center;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 1;
  transform: scale(1);
}
.bulk-actions.hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

.bulk-actions #bulk-status {
  min-width: 120px;
}

#inventory-bulk {
  position: fixed;
  bottom: var(--footer-height);
  left: 0;
  right: 0;
  z-index: 910;
}

#routing-table .num-col {
  width: 1%;
  text-align: center;
}

#routing-table td:nth-child(3),
#routing-table td:nth-child(5),
#routing-table td:nth-child(7) {
  text-align: center;
}

/* keep the Input column visible when scrolling horizontally */
#routing-table th:first-child,
#routing-table td:first-child {
  position: sticky;
  left: 0;
  background: var(--panel-bg);
  z-index: 1;
}
#routing-table thead th:first-child {
  z-index: 2;
}

/* keep first column of inventory tables visible during horizontal scroll */
.inventory-table th:first-child,
.inventory-table td:first-child {
  position: sticky;
  left: 0;
  background: var(--panel-bg);
  z-index: 1;
}
.inventory-table th:nth-child(2),
.inventory-table td:nth-child(2) {
  position: sticky;
  left: 24px;
  background: var(--panel-bg);
  z-index: 1;
}
.inventory-table thead th:first-child,
.inventory-table thead th:nth-child(2) {
  z-index: 2;
}
/* compact checkbox and action columns */
.inventory-table th:first-child,
.inventory-table td:first-child,
.inventory-table th:last-child,
.inventory-table td:last-child {
  width: 1%;
  white-space: nowrap;
}
.inventory-table th:first-child,
.inventory-table td:first-child {
  padding: 0;
  text-align: center;
  width: 24px;
}
/* keep name column from wrapping and allow slight space */
.inventory-table th:nth-child(2),
.inventory-table td:nth-child(2) {
  white-space: nowrap;
  padding-left: 4px;
  width: 1%;
}

/* fit status column to content */
.inventory-table th:nth-child(4),
.inventory-table td:nth-child(4) {
  width: 1%;
  white-space: nowrap;
}

/* fit type and location columns to content */
.inventory-table th:nth-child(3),
.inventory-table td:nth-child(3),
.inventory-table th:nth-child(5),
.inventory-table td:nth-child(5) {
  width: 1%;
  white-space: nowrap;
}

/* make inventory table checkboxes smaller */
.inv-select.MuiCheckbox-root,
.inv-select-all.MuiCheckbox-root {
  padding: 2px;
}
.inv-select .MuiSvgIcon-root,
.inv-select-all .MuiSvgIcon-root {
  font-size: 18px;
}

.view-menu {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.view-menu button {
  font-size: 14px;
}
#layout-select {
  min-width: 200px;
}

.small {
  padding: 4px;
  font-size: 12px;
  min-width: 32px;
}

@media print {
  body {
    background: #fff;
    color: #000;
  }
  .view-menu button {
    display: none;
  }
  #table-view {
    border: none;
  }
}


.settings-section {
  margin-bottom: 16px;
}


.settings-section h3 {
  margin: 0 0 6px;
}

.settings-section table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 6px;
}

.settings-section th, .settings-section td {
  border: 1px solid var(--border);
  padding: 4px;
}

.settings-section input {
  width: 100%;
  box-sizing: border-box;
}

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  transition: background 0.2s;
}
.toggle-switch .slider:before {
  position: absolute;
  content: '';
  height: 14px;
  width: 14px;
  left: 2px;
  top: 2px;
  background: var(--text);
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .slider {
  background: var(--accent);
}
.toggle-switch input:checked + .slider:before {
  transform: translateX(20px);
}


.bottom-app-bar {
  flex: 0 0 auto;
  min-height: var(--footer-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--workspace-bg);
  color: var(--text);
  border-top: none;
  box-shadow: none;
  overflow-x: auto;
  z-index: 900;
}

.bottom-nav {
  width: 100%;
  display: flex;
  padding: 0;
  height: 100%;
  box-sizing: border-box;
  padding-bottom: var(--safe-bottom);
  background: var(--workspace-bg);
}
.bottom-nav-action {
  flex: 1;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.bottom-nav-action img {
  width: 24px;
  height: 24px;
}
.light .bottom-nav-action img {
  filter: invert(1);
}
.bottom-nav-action:not(:last-child) {
  border-right: none !important;
}

body.android-app .diagram-panel {
  padding-bottom: var(--content-gap);
}

.bottom-app-bar::-webkit-scrollbar {
  display: none;
}

.bottom-app-bar .view-menu {
  flex-wrap: nowrap;
  gap: 0;
  justify-content: center;
}

body.android-app .bottom-app-bar,
body.ios-app .bottom-app-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
}

body.ios-app .page-content {
  height: calc(100dvh - var(--header-height) - var(--footer-height));
  margin-top: var(--header-height);
  margin-bottom: var(--footer-height);
  overflow-y: auto;
  overflow-x: hidden;
}

body.android-app .page-content {
  height: calc(100dvh - var(--header-height) - var(--footer-height) - var(--content-gap));
  margin-top: calc(var(--header-height) + var(--content-gap));
  margin-bottom: var(--footer-height);
  padding-bottom: var(--content-padding);
  overflow-y: auto;
  overflow-x: hidden;
}

body.portrait .view-menu {
  flex-wrap: wrap;
}

body.portrait .bottom-app-bar .view-menu,
body.landscape .bottom-app-bar .view-menu {
  flex-wrap: nowrap;
}

body.landscape .view-menu {
  flex-wrap: nowrap;
  overflow-x: auto;
}

.return-section {
  list-style: none;
  padding-left: 0;
  margin: 0 0 1rem 0;
}

.return-packed-label {
  text-decoration: line-through;
}

.return-item-enter {
  opacity: 0;
  transform: translateX(-10px);
}

.return-item-enter-active {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 200ms ease, transform 200ms ease;
}

.return-item-exit {
  opacity: 1;
  transform: translateX(0);
}

.return-item-exit-active {
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 200ms ease, transform 200ms ease;
}

/* Landing page styles */
body.landing {
  font-family: 'Roboto', 'Open Sans', sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  text-align: center;
  background: var(--bg);
  position: relative;
  --bg: #0d1117;
  --panel-bg: #161b22;
  --border: #30363d;
  --accent: #0ea5e9;
  --text: #e6e6e6;
}

.bg-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  object-fit: cover;
  transform: translateZ(0) scale(1.25);
  transform-origin: center;
  z-index: -1;
  opacity: 0;

  pointer-events: none;
  transition: opacity 1s ease-in-out;
}
.bg-video.active {
  opacity: 0.8;
}

#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg);
  z-index: 2000;
  opacity: 1;
  transition: opacity 0.8s ease;
}
body.loaded #loading-overlay {
  opacity: 0;

  pointer-events: none;
  transition: opacity 1s ease-in-out;
}
.bg-video.active {
  opacity: 0.8;
}

#page-wrapper {
  opacity: 0;
  transition: opacity 0.8s ease;
}
body.loaded #page-wrapper {
  opacity: 1;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

body.landing h1,
body.landing h2,
body.landing h3 {
  font-family: 'Inter', sans-serif;
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--panel-bg);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  will-change: transform, opacity;
  z-index: 100;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-btn,
.nav-link {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: none;
  background: var(--panel-bg);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.nav-btn {
  background: var(--accent);
  color: #fff;
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-left.visible,
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.landing-hero {
  padding: 4rem 1rem;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.hero-logo {
  width: 200px;
  display: block;
  margin: 0 auto 1rem;
}

.landing-hero h1 {
  margin: 0 0 0.5rem;
  font-size: 2.5rem;
  text-align: center;
  display: block;
}

.landing-hero p {
  margin: 0 0 1.5rem;
  font-size: 1.2rem;
}

.cta-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin-top: 2rem;
}

.cta-btn {
  font-size: 1.1rem;
  padding: 0.9rem 1.6rem;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transition: filter 0.2s ease, transform 0.2s ease;
}

.cta-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.cta-btn.secondary {
  background: var(--panel-bg);
  color: var(--text);
  border: 1px solid var(--accent);
}

.intro {
  max-width: 720px;
  margin: 0 auto 3rem;
  font-size: 1.1rem;
  line-height: 1.6;
  padding: 0 1rem;
}

.features-section {
  max-width: 720px;
  margin: 2rem auto 3rem;
  text-align: left;
  font-size: 1.1rem;
  line-height: 1.6;
  padding: 0 1rem;
}

.features-section h2 {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1.75rem;
}

.features-section ul {
  list-style: none;
  padding: 0;
}

.features-section li {
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
  position: relative;
}

.features-section li::before {
  content: "\f058";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  color: var(--accent);
}

.download-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}

.downloads {
  padding: 4rem 1rem;
  background: var(--panel-bg);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  margin: 4rem auto;
  max-width: 900px;
}

.downloads h2 {
  margin-top: 0;
  font-size: 2rem;
}

.btn {
  padding: 0.75rem 1.25rem;
  border-radius: 4px;
  border: none;
  background: var(--panel-bg);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}


.screenshots {
  padding: 3rem 1rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  overflow-x: hidden;
}

.screenshot-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin: 4rem auto;
  max-width: 1100px;
}

.screenshot-row.reverse {
  flex-direction: column;
}

.screenshot-row img {
  width: 90%;
  max-width: 480px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transition: transform 0.3s ease;
}
.screenshot-row img.large-img {
  max-width: 540px;
}

.screenshot-row img:hover {
  transform: translateY(-4px);
}

.section-divider {
  width: 60%;
  max-width: 500px;
  height: 1px;
  background: var(--border);
  margin: 2rem auto;
}

.scroll-arrow {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1.75rem;
  cursor: pointer;
  margin: 0.5rem auto 2rem;
}

.mobile-only {
  display: inline-block;
}

@media (min-width: 768px) {
  .mobile-only {
    display: none;
  }
}

.screenshot-text {
  max-width: 400px;
  text-align: center;
}


.landing-footer {
  margin-top: auto;
  padding: 1rem;
  background: var(--panel-bg);
}

.privacy-link {
  color: var(--text);
  opacity: 0.6;
  text-decoration: none;
  margin-left: 0.5rem;
  font-size: 0.85rem;
}

@media (max-width: 767px) {
  .top-nav {
    transform: translateY(-100%);
    opacity: 0;
  }
  .top-nav.nav-visible {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (min-width: 768px) {
  .cta-buttons {
    flex-direction: row;
  }
  .download-links {
    flex-direction: row;
    justify-content: center;
    align-items: center;
  }
  .screenshot-row {
    flex-direction: row;
  }
  .screenshot-row.reverse {
    flex-direction: row-reverse;
  }
  .screenshot-row img {
    width: 45%;
    max-width: 420px;
  }
  .screenshot-row img.large-img {
    width: 50%;
    max-width: 460px;
  }
  .screenshot-text {
    text-align: left;
  }
  .nav-btn,
  .nav-link {
    font-size: 1rem;
  }
}

