:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --line: #cbd5e1;
  --accent: #10b981;
  --accent-2: #34d399;
  --danger: #fb7185;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top right, #ffffff, var(--bg));
  color: var(--ink);
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

.app {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 16px;
}

#view {
  width: 100%;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

h1 {
  margin: 8px 0;
  letter-spacing: 0.4px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}

button {
  cursor: pointer;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  margin: 6px 0 10px;
  background: #ffffff;
  color: var(--ink);
}

/* Keep dropdown text readable on mobile devices. */
select,
option {
  font-size: 16px !important;
  line-height: 1.4;
}

label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}

.primary {
  background: var(--accent);
  color: #f7fff7;
  border: none;
  border-radius: 9px;
  padding: 10px 12px;
  font-weight: 700;
}

.secondary {
  background: #f8fafc;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
}

.secondary-compact {
  background: #f8fafc;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px 9px;
  font-size: 12px;
  line-height: 1.2;
}

.danger {
  background: #ffeaea;
  color: var(--danger);
  border: 1px solid #ffc5c5;
  border-radius: 9px;
  padding: 8px 10px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.post {
  margin-bottom: 12px;
}

.hero {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f1f5f9;
}

.title {
  font-size: 18px;
  margin: 10px 0 4px;
}

.meta,
.small {
  font-size: 13px;
  color: var(--muted);
}

.pill {
  background: #ecfdf5;
  color: #065f46;
  border-radius: 100px;
  padding: 2px 10px;
  font-size: 12px;
  display: inline-block;
  margin-right: 6px;
}

.comment {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 8px;
}

.hidden {
  display: none;
}

.app-nav-mobile {
  display: none;
}

@media (max-width: 900px) {
  body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }

  .app-header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .app-nav-desktop {
    display: none !important;
  }

  .app-nav-mobile {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 45 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid #d9f2df;
    background: rgba(232, 245, 233, 0.96);
    box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(12px);
  }

  .app-nav-mobile .tab {
    width: 100%;
    min-height: 44px;
    padding: 10px 8px;
    font-size: 13px;
  }

  .app-shell-main {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .site-footer {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .site-footer > div {
    justify-content: center;
  }

  .site-footer > div > div {
    flex-wrap: wrap;
    justify-content: center;
  }

  .row {
    grid-template-columns: 1fr;
  }
}
