/* PepperScale Tools PWA — app shell.
   Scopes only the shell chrome (header, home grid, nav); each tool keeps its
   own scoped styles. Mobile-first, big tap targets, safe-area aware. */
:root {
  --app-paper: #faf6f0;
  --app-card: #ffffff;
  --app-ink: #2a2320;
  --app-ink-soft: #6b615a;
  --app-line: #e7ddd2;
  --app-chili: #b3261e;
  --app-chili-deep: #8a1c16;
  --app-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --app-sans: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--app-sans);
  background: var(--app-paper);
  color: var(--app-ink);
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--app-chili);
  color: #fff;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.app-back {
  appearance: none;
  border: 0;
  background: rgba(255,255,255,.16);
  color: #fff;
  font-family: var(--app-sans);
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  display: none;
  line-height: 1;
}
.app-back.is-visible { display: inline-block; }
.app-title {
  font-family: var(--app-serif);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.app-mark {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.app-logo { width: 30px; height: 30px; object-fit: contain; display: block; }
.app-title small { display: block; font-family: var(--app-sans); font-weight: 500; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; opacity: .8; }

/* Views */
.app-main { padding: 16px 16px calc(env(safe-area-inset-bottom) + 32px); max-width: 820px; margin: 0 auto; }
.app-view { display: none; }
.app-view.is-active { display: block; }

/* Home grid */
.app-intro { color: var(--app-ink-soft); font-size: 15px; margin: 6px 2px 18px; }
.app-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .app-grid { grid-template-columns: 1fr 1fr; } }
.app-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--app-card);
  border: 1px solid var(--app-line);
  border-radius: 16px;
  padding: 18px;
  cursor: pointer;
  font-family: var(--app-sans);
  color: var(--app-ink);
  transition: border-color .12s ease, transform .05s ease;
  min-height: 84px;
}
.app-tile:active { transform: scale(.99); }
.app-tile:hover { border-color: var(--app-chili); }
.app-tile-emoji { font-size: 30px; line-height: 1; flex: none; }
.app-tile-text { display: flex; flex-direction: column; gap: 3px; }
.app-tile-name { font-family: var(--app-serif); font-weight: 600; font-size: 18px; }
.app-tile-desc { font-size: 13px; color: var(--app-ink-soft); line-height: 1.4; }

.app-foot { margin-top: 22px; font-size: 12px; color: var(--app-ink-soft); text-align: center; line-height: 1.5; }
.app-foot a { color: var(--app-chili-deep); }

/* Offline toast */
.app-offline {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 14px);
  transform: translateX(-50%);
  background: var(--app-ink);
  color: #fff;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 50;
}
.app-offline.is-visible { opacity: .95; }
