/* ===== Base Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #121212;
  color: #f5f5f5;
  overflow-x: hidden;
}

/* ===== Header ===== */
.app-header {
  background: #1f1f1f;
  padding: 12px 16px;
  text-align: center;
  border-bottom: 1px solid #333;
}
.app-header h1 {
  font-size: 1.4rem;
  color: #fff;
}

/* ===== Tool Grid ===== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  padding: 12px;
}
.tool-grid button {
  background: #1e1e1e;
  color: #fff;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 10px;
  font-size: 0.9rem;
  text-align: center;
  cursor: grab;
  transition: background 0.2s;
}
.tool-grid button:active {
  cursor: grabbing;
}
.tool-grid button:hover {
  background: #272727;
}

/* ===== Tool Sections ===== */
.tool-section {
  padding: 16px;
  border-bottom: 1px solid #333;
}
.tool-section.hidden {
  display: none;
}
.tool-section h2 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: #ffcc00;
}

/* ===== Compass ===== */
.compass {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 20px auto;
  border: 4px solid #ffcc00;
  border-radius: 50%;
  background: #1a1a1a;
}
.dial {
  width: 100%;
  height: 100%;
  background: url('images/compass-dial.png') no-repeat center;
  background-size: contain;
  transform: rotate(0deg);
  transition: transform 0.2s ease-out;
}
.heading {
  text-align: center;
  font-size: 1.5rem;
  margin-top: 10px;
}

/* ===== Knot Gallery ===== */
.knot-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.knot-gallery img {
  max-width: 100%;
  border: 2px solid #333;
  border-radius: 8px;
  background: #1e1e1e;
}

/* ===== Map ===== */
#mapContainer {
  height: 300px;
  width: 100%;
  border: 2px solid #333;
  border-radius: 8px;
  margin-top: 10px;
}

/* ===== Buttons ===== */
button {
  background: #ffcc00;
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  margin: 4px 0;
  cursor: pointer;
  font-weight: bold;
}
button:hover {
  background: #ffdb4d;
}

/* ===== Bottom Nav ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #1f1f1f;
  display: flex;
  border-top: 1px solid #333;
}
.bottom-nav button {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  color: #fff;
  font-size: 0.9rem;
}
.bottom-nav button:hover {
  background: #272727;
}

/* ===== Forms & Inputs ===== */
input, select, textarea {
  width: 100%;
  padding: 8px;
  margin: 6px 0;
  border-radius: 6px;
  border: 1px solid #444;
  background: #1e1e1e;
  color: #fff;
}
textarea {
  resize: vertical;
}

/* ===== Misc ===== */
#weatherResult, #sunTimes, #convertResult, #purifyResult, #sosStatus, #morseOutput {
  margin-top: 8px;
  font-size: 0.9rem;
  background: #1e1e1e;
  padding: 8px;
  border-radius: 6px;
   
}



.grid-actions {
  display: flex;
  gap: 8px;
  padding: 12px;
}

#toolsGrid.reorder .tool-card {
  outline: 2px dashed #ffcc00;
  cursor: grab;
}

.tool-card.dragging {
  opacity: 0.85;
  transform: scale(0.98);
}


/* Header / brand */
.app-header{
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: #0b0b0b;          /* dark bar */
  border-bottom: 1px solid #1a1a1a;
}

.brand{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.brand-logo{
  width: 180px;
  height: 180px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(248, 244, 223, 0.12)); /* subtle warm glow */
}

.brand-text{
  display: grid;
  line-height: 1;
}

.brand-title{
  font-weight: 800;
  letter-spacing: 2px;
  color: #F7F3E1;                /* matches the logo’s warm off-white */
  font-size: 18px;
}

.brand-sub{
  margin-top: 4px;
  font-size: 12px;
  color: #9aa0a6;                /* muted subtitle */
}

/* Larger screens */
@media (min-width: 600px){
  .brand-logo{ width: 46px; height: 46px; }
  .brand-title{ font-size: 20px; }
}

/* Shelter tabs */
.tabs{ display:flex; gap:8px; margin:6px 0 10px; }
.tab{ padding:8px 10px; border-radius:10px; background:#151515; color:#ddd; border:1px solid #262626; }
.tab.active{ background:#222; border-color:#444; color:#fff; }

.tab-panel.hidden{ display:none; }

.gear{ border:1px solid #242424; border-radius:10px; padding:10px; margin:10px 0; }
.chk{ display:inline-flex; align-items:center; gap:8px; margin-right:14px; }
.checklist .check-row{ padding:8px 0; border-bottom:1px dashed #2a2a2a; }