/* Google-style mesh home chrome (8-bit) — only used when #view-mesh is active */

#view-mesh {
  display: none;
  position: relative;
  z-index: 2;
  min-height: 100vh;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}
body.mode-mesh #view-mesh {
  display: flex;
}
body.mode-mesh #view-public {
  display: none !important;
}
body.mode-public #view-mesh {
  display: none !important;
}
body.mode-public #view-public {
  display: block;
}

/* Top bar */
.mesh-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  pointer-events: none;
}
.mesh-topbar > * {
  pointer-events: auto;
}

.mesh-icon-btn {
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  color: #c4c4d4;
  background: rgba(8, 10, 18, 0.75);
  border: 2px solid #2a3048;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  line-height: 1;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.mesh-icon-btn:hover,
.mesh-icon-btn[aria-expanded="true"] {
  border-color: #a78bfa;
  color: #e9d5ff;
  background: rgba(30, 24, 48, 0.9);
}

/* Center column */
.mesh-center {
  width: min(560px, 100%);
  text-align: center;
  margin-top: 2.5rem;
}

.mesh-logo {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 1.5rem;
  line-height: 1.35;
  text-shadow: 4px 4px 0 #1a1040;
}
.mesh-logo span {
  background: linear-gradient(180deg, #9ec5ff 0%, #c4b5fd 45%, #7dd3fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mesh-search {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 520px;
  margin: 0 auto 1rem;
  border: 3px solid #2a3048;
  background: rgba(8, 10, 18, 0.88);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4);
}
.mesh-search:focus-within {
  border-color: #6b7a9a;
}
.mesh-search input {
  flex: 1;
  border: 0;
  background: transparent;
  color: #e8eaf0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
  padding: 0.85rem 1rem;
  outline: none;
  min-width: 0;
}
.mesh-search input::placeholder {
  color: #5a6578;
}
.mesh-search button {
  border: 0;
  border-left: 2px solid #2a3048;
  background: rgba(20, 24, 40, 0.9);
  color: #a78bfa;
  font-family: "Press Start 2P", monospace;
  font-size: 0.42rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 1rem;
  cursor: pointer;
  white-space: nowrap;
}
.mesh-search button:hover {
  background: rgba(167, 139, 250, 0.12);
  color: #e9d5ff;
}

.mesh-hint {
  font-family: "Press Start 2P", monospace;
  font-size: 0.36rem;
  letter-spacing: 0.08em;
  color: #5a6578;
  text-transform: uppercase;
  margin-top: 0.75rem;
}
.mesh-hint .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #34d399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.7);
  margin-right: 0.4rem;
  vertical-align: middle;
}
body.mesh-hide-pill .mesh-hint {
  display: none;
}

/* Apps drawer (Google waffle panel) */
.apps-drawer {
  display: none;
  position: fixed;
  top: 3.25rem;
  right: 1rem;
  z-index: 30;
  width: min(320px, calc(100vw - 2rem));
  background: rgba(10, 12, 22, 0.96);
  border: 3px solid #2a3048;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.45);
  padding: 0.85rem;
}
.apps-drawer.open {
  display: block;
}
.apps-drawer h2 {
  font-family: "Press Start 2P", monospace;
  font-size: 0.42rem;
  letter-spacing: 0.08em;
  color: #6b7a94;
  text-transform: uppercase;
  margin: 0 0 0.85rem;
  text-align: center;
}
.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.apps-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-decoration: none;
  color: #c4c4d4;
  font-family: "Press Start 2P", monospace;
  font-size: 0.34rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.75rem 0.35rem;
  border: 2px solid transparent;
  min-height: 4.5rem;
  text-align: center;
  line-height: 1.4;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.apps-grid a:hover {
  border-color: #3b4261;
  background: rgba(167, 139, 250, 0.08);
  color: #e9d5ff;
}
.apps-grid .app-icon {
  font-size: 1.35rem;
  line-height: 1;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.4));
}

/* Settings panel */
.settings-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(4, 6, 12, 0.72);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.settings-panel.open {
  display: flex;
}
.settings-card {
  width: min(420px, 100%);
  background: rgba(10, 12, 22, 0.97);
  border: 3px solid #2a3048;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.45);
  padding: 1.25rem;
  max-height: min(90vh, 640px);
  overflow-y: auto;
}
.settings-card h2 {
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  color: #e0e0e8;
  text-transform: uppercase;
  margin: 0 0 1rem;
  text-align: center;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #1e2438;
}
.settings-row:last-of-type {
  border-bottom: 0;
}
.settings-row label {
  font-family: "Press Start 2P", monospace;
  font-size: 0.36rem;
  letter-spacing: 0.06em;
  color: #8b9bb4;
  text-transform: uppercase;
  line-height: 1.5;
  flex: 1;
}
.settings-row input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #a78bfa;
  cursor: pointer;
}
.settings-about {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid #1e2438;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  color: #6b7a94;
  line-height: 1.55;
}
.settings-actions {
  margin-top: 1.1rem;
  display: flex;
  justify-content: center;
}
.settings-actions button {
  font-family: "Press Start 2P", monospace;
  font-size: 0.4rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c4c4d4;
  background: transparent;
  border: 2px solid #3b4261;
  padding: 0.55rem 1rem;
  cursor: pointer;
}
.settings-actions button:hover {
  border-color: #a78bfa;
  color: #e9d5ff;
}

.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 25;
  background: transparent;
}
.drawer-backdrop.open {
  display: block;
}
