/* SkipGuide App — base */
*, *::before, *::after { box-sizing: border-box; }

/* Modals use display:flex in CSS — must beat that when hidden */
[hidden],
.sg-confirm[hidden],
.sg-audio[hidden],
.sg-settings[hidden],
.sg-overlay[hidden],
.sg-panel[hidden],
.sg-mini-popup[hidden],
.sg-gps-banner[hidden],
.sg-search-results[hidden],
.sg-dropdown[hidden] {
  display: none !important;
}
html, body { margin: 0; height: 100%; overflow: hidden; }
.sg-app {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: #0f172a;
  -webkit-font-smoothing: antialiased;
}
.sg-skip {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.sg-skip:focus {
  left: 12px;
  top: 12px;
  width: auto;
  height: auto;
  padding: 8px 12px;
  background: #fff;
  z-index: 10000;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.sg-link-btn {
  background: none;
  border: 0;
  color: #2563eb;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
}
.sg-link-btn:hover { text-decoration: underline; }
.sg-btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
.sg-btn--primary { background: #112d3a; color: #fff; }
.sg-btn--primary:hover { background: #1a3d4d; }
.sg-btn--ghost { background: #f1f5f9; color: #334155; }
.sg-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.sg-field span { font-size: 13px; font-weight: 600; color: #475569; }
.sg-field select,
.sg-field input {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}
.sg-field--optional { opacity: .85; }

.sg-field--checkbox {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.sg-field--checkbox input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.sg-field--checkbox span {
  font-size: 14px;
  font-weight: 500;
  color: #334155;
}
mark.sg-hl { background: #fde047; color: inherit; padding: 0 1px; border-radius: 2px; }

/* Toast notifications */
.sg-toast-host {
  position: fixed;
  top: max(68px, calc(env(safe-area-inset-top) + 56px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: min(400px, calc(100vw - 24px));
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sg-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.16), 0 0 0 1px rgba(15, 23, 42, 0.06);
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.sg-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.sg-toast--error {
  border-left: 4px solid #dc2626;
}

.sg-toast--info {
  border-left: 4px solid #2563eb;
}

.sg-toast__icon {
  flex-shrink: 0;
  width: 22px;
  font-size: 20px;
  line-height: 1;
  margin-top: 1px;
}

.sg-toast--error .sg-toast__icon { color: #dc2626; }
.sg-toast--info .sg-toast__icon { color: #2563eb; }

.sg-toast__text {
  flex: 1;
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #0f172a;
  padding-right: 4px;
}

.sg-toast__retry {
  flex-shrink: 0;
  align-self: center;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: #112d3a;
  color: #fff;
  white-space: nowrap;
}

.sg-toast__retry:hover {
  background: #1a3d4d;
}

.sg-toast__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sg-toast__close:hover {
  background: #e2e8f0;
  color: #0f172a;
}
