/* Tomorrow Remembered Client */
:root {
  --navy: #022249;
  --navy-deep: #01152d;
  --teal: #49b1be;
  --teal-soft: rgba(73, 177, 190, 0.18);
  --cta: #dd6420;
  --gold: #c4a265;
  --cream: #eef3f7;
  --text: #1a2a3a;
  --muted: #5d6f82;
  --white: #fff;
  --radius: 18px;
  --font: "Quicksand", system-ui, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 68px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(73, 177, 190, 0.35), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(221, 100, 32, 0.18), transparent 50%),
    linear-gradient(165deg, #01152d 0%, #022249 42%, #0a3a4f 100%);
  background-attachment: fixed;
  line-height: 1.45;
}

button, input { font: inherit; }
a { color: var(--teal); text-decoration: none; }

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.app-top {
  padding: 1rem 1.15rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  animation: fadeDown 0.55s ease both;
}
.app-top img { height: 34px; width: auto; display: block; }
.app-top .pill {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--gold);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
}

.app-main {
  flex: 1;
  padding: 0.5rem 1.15rem calc(var(--nav-h) + var(--safe-bottom) + 1rem);
}

.panel {
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  box-shadow: 0 18px 40px rgba(1, 18, 40, 0.28);
  animation: riseIn 0.55s ease both;
}
.panel + .panel { margin-top: 0.9rem; animation-delay: 0.08s; }

.hero-brand {
  color: #fff;
  padding: 1.5rem 0.25rem 1.25rem;
  animation: fadeDown 0.7s ease both;
}
.hero-brand h1 {
  margin: 0.35rem 0 0.4rem;
  font-size: clamp(1.85rem, 7vw, 2.35rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.hero-brand p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.02rem;
  max-width: 28ch;
}

h2 {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
  color: var(--navy);
}
.muted { color: var(--muted); font-size: 0.92rem; }
.thought {
  border-left: 4px solid var(--gold);
  padding-left: 0.85rem;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--navy);
  line-height: 1.65;
}
.thought cite {
  display: block;
  margin-top: 0.7rem;
  font-style: normal;
  font-size: 0.82rem;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.btn:active { transform: scale(0.98); }
.btn-cta {
  background: var(--cta);
  color: #fff;
  box-shadow: 0 10px 24px rgba(221, 100, 32, 0.35);
}
.btn-cta:hover { background: #e47035; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.btn-ghost-dark {
  background: transparent;
  color: var(--navy);
  border: 1px solid #c9d5e3;
}
.account-prompt {
  border: 1px solid rgba(196, 162, 101, 0.45);
}
.btn-block { width: 100%; }
.btn-row { display: grid; gap: 0.65rem; margin-top: 1rem; }

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.3rem;
}
.field { margin-bottom: 0.85rem; }
.input {
  width: 100%;
  border: 1px solid #d5deea;
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  background: #f7fafc;
}
.input:focus {
  outline: 2px solid rgba(73, 177, 190, 0.45);
  border-color: var(--teal);
  background: #fff;
}

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid #e7eef5;
}
.list li:last-child { border-bottom: 0; }
.list strong { color: var(--navy); display: block; }
.list small { color: var(--muted); }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.75rem; }
.chip {
  background: var(--teal-soft);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
}
.category-chips {
  margin: 0 0 1rem;
  max-height: 7.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.chip-btn {
  background: #eef3f7;
  color: var(--navy);
  border: 1px solid #d5deea;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
}
.chip-btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.directory-results { margin-top: 1rem; }
.result-count { margin: 0 0 0.35rem; font-weight: 700; }
.dir-list .dir-item {
  display: block;
  padding: 0.65rem 0;
}
.dir-item-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: inherit;
}
.dir-thumb {
  flex: 0 0 88px;
  width: 88px;
  height: 66px;
  border-radius: 10px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(73, 177, 190, 0.28), rgba(2, 34, 73, 0.18));
}
.dir-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dir-item-copy {
  min-width: 0;
  flex: 1;
}
.dir-item-copy strong {
  display: block;
  color: var(--navy);
  line-height: 1.25;
}
.dir-item-copy small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
}
.linkish {
  background: none;
  border: 0;
  color: var(--teal);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.cat-list li { align-items: center; }

.app-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.15rem;
  padding: 0.45rem 0.4rem calc(0.45rem + var(--safe-bottom));
  background: rgba(1, 21, 45, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 20;
}
.app-nav button {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.62);
  padding: 0.45rem 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
}
.app-nav button span { display: block; font-size: 1.15rem; margin-bottom: 0.15rem; }
.app-nav button.active { color: var(--gold); }

.alert {
  background: #fde8e8;
  color: #9b2226;
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
}
.alert-ok { background: #d8f3dc; color: #2d6a4f; }
.hidden { display: none !important; }
.loading { color: rgba(255,255,255,0.8); text-align: center; padding: 3rem 1rem; }

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@media (min-width: 720px) {
  .app-shell { max-width: 520px; padding-top: 1rem; }
}
