/* Store Hub — Day 0 base styles (mobile-first, iOS-like) */

:root {
  color-scheme: light;

  --bg: #ffffff;
  --surface: #f6f7f9;
  --text: #111827;
  --muted: #6b7280;
  --border: rgba(17, 24, 39, 0.12);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);

  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;

  --pad: 16px;
  --tabbar-h: 76px;
  --header-h: 56px;

  --tap: rgba(17, 24, 39, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

/* Prevent iOS tap highlight on most elements; add our own on tappables */
:where(button, a, [role="button"]) {
  -webkit-tap-highlight-color: transparent;
}

/* App root */
#app {
  min-height: 100vh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    calc(var(--tabbar-h) + env(safe-area-inset-bottom)) env(safe-area-inset-left);
}

/* Generic layout blocks (wired up later by appTemplate.js) */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.app-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.icon-btn {
  border: 0;
  background: transparent;
  padding: 10px;
  margin: -10px;
  border-radius: 999px;
}

.icon-btn:active {
  background: var(--tap);
}

.screen {
  padding: var(--pad);
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card-inner {
  padding: 14px;
}

.h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

/* Bottom tabs (wired up later by appTemplate.js) */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
}

.tabbar-row {
  height: var(--tabbar-h);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  align-items: center;
}

.tab {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 16px;
  color: var(--muted);
}

.tab:active {
  background: var(--tap);
}

.tab[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
}

.tab svg {
  width: 22px;
  height: 22px;
}

.tab-label {
  font-size: 11px;
  line-height: 1;
}

/* Toast (wired up later by toast.js) */
.toast-host {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px);
  z-index: 50;
  display: grid;
  justify-items: center;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  max-width: min(520px, calc(100vw - 24px));
  background: rgba(17, 24, 39, 0.92);
  color: white;
  padding: 10px 12px;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  font-size: 13px;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

