/* ===== Design tokens ===== */
:root{
  --ink:#221A22;
  --card:#2C222D;
  --card-border: rgba(243,236,226,0.07);
  --amber:#D4A24C;
  --rose:#C6566B;
  --rose-deep:#9C4257;
  --sage:#8FA382;
  --parch:#F3ECE2;
  --parch-dim:#C9BFB4;
  --radius-lg: 20px;
  --radius-md: 14px;
  --max-width: 480px;
}

*{ box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body{ margin:0; padding:0; height:100%; background:var(--ink); }
body{
  color: var(--parch);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .font-display{ font-family:'Bricolage Grotesque', sans-serif; margin:0; }
p{ margin:0; }
button{ font-family:inherit; cursor:pointer; border:none; }
a{ color: var(--amber); }
::selection{ background: var(--rose); color: white; }
::-webkit-scrollbar{ width:0; height:0; }

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

.view{
  flex:1;
  overflow-y: auto;
  padding: 32px 24px 96px;
  animation: fadeIn .35s ease-out;
}
@keyframes fadeIn{ from{ opacity:0; transform: translateY(6px);} to{ opacity:1; transform: translateY(0);} }

/* ===== Typography helpers ===== */
.eyebrow{ font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:var(--amber); margin-bottom:6px; }
.dim{ color: var(--parch-dim); }
.text-sm{ font-size:14px; }
.text-xs{ font-size:12px; }

/* ===== Cards ===== */
.card{
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

/* ===== Inputs ===== */
input[type=text], input[type=email], input[type=password], textarea{
  width:100%;
  background: rgba(243,236,226,0.05);
  border: 1px solid rgba(243,236,226,0.15);
  color: var(--parch);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
}
input:focus, textarea:focus{ outline:none; border-color: var(--amber); }
::placeholder{ color: rgba(243,236,226,0.35); }
label.field-label{ display:block; font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--parch-dim); margin-bottom:8px; }

/* ===== Buttons ===== */
.btn{
  display:flex; align-items:center; justify-content:center;
  width:100%; padding: 14px; border-radius: var(--radius-md);
  font-size:15px; font-weight:600; transition: transform .1s ease;
}
.btn:active{ transform: scale(0.98); }
.btn-primary{ background: var(--amber); color:#221A22; }
.btn-ghost{ background: transparent; border:1px solid rgba(243,236,226,0.2); color: var(--parch); }
.btn-rose{ background: var(--rose); color: white; }
.btn:disabled{ opacity:.4; pointer-events:none; }
.btn-small{ width:auto; padding: 8px 14px; font-size:13px; }
.link-btn{ background:none; color: var(--amber); font-size:13px; text-decoration: underline; padding:0; }

/* ===== Nav bar ===== */
.navbar{
  position: fixed; bottom:0; left:0; right:0;
  max-width: var(--max-width); margin:0 auto;
  background: var(--card); border-top: 1px solid var(--card-border);
  display:flex; justify-content: space-around;
  padding: 10px 4px calc(10px + env(safe-area-inset-bottom));
  backdrop-filter: blur(6px);
}
.tab-btn{ background:none; display:flex; flex-direction:column; align-items:center; gap:4px; padding:4px 10px; color: var(--parch-dim); }
.tab-btn.active{ color: var(--amber); }
.tab-btn .icon{ font-size:18px; line-height:1; }
.tab-btn .label{ font-size:10px; font-weight:600; }

/* ===== Seal ===== */
.seal{
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #D9748A, var(--rose) 60%);
  box-shadow: 0 4px 18px rgba(198,86,107,0.35), inset 0 -3px 6px rgba(0,0,0,0.25), inset 0 2px 3px rgba(255,255,255,0.25);
}
.seal-locked{ animation: rock 3.5s ease-in-out infinite; }
@keyframes rock{ 0%,100%{ transform: rotate(-2deg); } 50%{ transform: rotate(2deg); } }

/* ===== Calendar ===== */
.cal-grid{ display:grid; grid-template-columns: repeat(7, 1fr); gap:4px; }
.cal-dow{ text-align:center; font-size:10px; color: var(--parch-dim); }
.cal-day{
  aspect-ratio: 1/1; display:flex; align-items:center; justify-content:center;
  border-radius:50%; font-size:14px; color: var(--parch-dim);
}
.cal-day.friday{ border:1px solid var(--rose); color: var(--rose); }
.cal-day.friday.unlocked{ background: var(--rose); color:white; font-weight:600; border-color:transparent; }
.cal-day.today{ box-shadow: 0 0 0 2px var(--amber); }

/* ===== Question card (gradient) ===== */
.question-card{
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  color: white;
}
.question-card textarea{
  background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.25); color: white;
}
.question-card ::placeholder{ color: rgba(255,255,255,0.5); }

/* ===== Quadrant grid (date planner) ===== */
.quad-grid{ display:grid; grid-template-columns: 1fr 1fr; gap:8px; margin-bottom:12px; }
.quad-btn{
  background: var(--card); border:1px solid var(--card-border); border-radius: var(--radius-md);
  padding: 12px; font-size:13px; font-weight:600; color: var(--parch); text-align:center;
}
.quad-btn.selected{ outline:2px solid var(--amber); outline-offset:2px; }

/* ===== Toggle switch (push notifications) ===== */
.switch{ position:relative; width:44px; height:26px; flex-shrink:0; }
.switch input{ opacity:0; width:0; height:0; }
.switch .track{
  position:absolute; inset:0; background: rgba(243,236,226,0.15); border-radius:999px; transition: background .2s;
}
.switch .thumb{
  position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%;
  background: var(--parch); transition: transform .2s;
}
.switch input:checked + .track{ background: var(--amber); }
.switch input:checked + .track .thumb{ transform: translateX(18px); }

/* ===== Memory / gallery grid ===== */
.mem-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap:6px; }
.mem-thumb{ aspect-ratio:1/1; border-radius:10px; overflow:hidden; background: var(--card); position:relative; }
.mem-thumb img, .mem-thumb video{ width:100%; height:100%; object-fit:cover; }
.mem-thumb .kind-tag{ position:absolute; top:4px; right:4px; font-size:10px; background: rgba(0,0,0,0.5); padding:1px 5px; border-radius:6px; }

#map{ width:100%; height: 260px; border-radius: var(--radius-lg); margin-bottom:16px; }

/* ===== Filter chips ===== */
.chip-row{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.chip{
  padding: 6px 12px; border-radius:999px; font-size:12px; font-weight:600;
  background: var(--card); border:1px solid var(--card-border); color: var(--parch-dim);
}
.chip.active{ background: var(--amber); color:#221A22; border-color: transparent; }

/* ===== Toast / status messages ===== */
.status-msg{ font-size:13px; padding:10px 14px; border-radius: var(--radius-md); margin-bottom:12px; }
.status-error{ background: rgba(198,86,107,0.15); color:#F2A9B5; }
.status-ok{ background: rgba(143,163,130,0.15); color:#B7CBAB; }

/* ===== Responsive tweaks ===== */
@media (min-width: 540px){
  .app-shell{ border-left:1px solid var(--card-border); border-right:1px solid var(--card-border); }
}
@media (max-width: 340px){
  .view{ padding: 24px 16px 90px; }
}