:root {
  --bg: #fdecef;
  --bg2: #fff6f8;
  --card: #fff8fa;
  --line: #f3d0da;
  --text: #5a3340;
  --muted: #b07a8a;
  --pink: #e7a0b4;
  --pink2: #d4789c;
  --like: #c45c7a;
  --white: #fff;
  --shadow: 0 10px 28px rgba(196, 92, 122, 0.12);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Anuphan, "Segoe UI", Tahoma, sans-serif;
}
body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#app {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  position: relative;
}
.screen { min-height: 100dvh; padding: 20px 18px 28px; }
.hidden { display: none !important; }
h1 {
  font-size: 34px;
  margin: 0 0 8px;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--pink2);
}
.lead {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  margin: 0 0 28px;
}
.center-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80dvh;
}
.btn {
  appearance: none;
  border: 0;
  background: var(--pink);
  color: #fff;
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  padding: 14px 22px;
  cursor: pointer;
}
.btn.big { font-size: 18px; padding: 16px 28px; box-shadow: var(--shadow); }
.btn.ghost { background: #fff; color: var(--pink2); border: 1px solid var(--line); }
.err { color: var(--like); min-height: 1.3em; text-align: center; margin-top: 14px; font-size: 14px; }
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fdecefee;
  backdrop-filter: blur(10px);
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); color: var(--pink2);
  font-size: 20px; cursor: pointer;
}
.search {
  flex: 1;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 14px;
  font: inherit;
  color: var(--text);
  width: 100%;
}
.tabs { display: flex; gap: 6px; margin-top: 8px; }
.tabs button {
  flex: 1;
  border: 0;
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.tabs button.on { background: var(--pink); color: #fff; }
.feed { padding: 12px 12px 96px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 14px 14px 10px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.meta { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.meta b { color: var(--text); font-size: 16px; }
.card p { margin: 0 0 8px; font-size: 15px; line-height: 1.5; }
.photo {
  width: 100%;
  max-height: calc(100vw * 20 / 9);
  max-height: min(720px, calc((min(430px, 100vw) - 24px) * 20 / 9));
  object-fit: cover;
  border-radius: 16px;
  display: block;
  margin: 6px 0 8px;
  background: #f8dbe4;
}
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.links a {
  font-size: 12px;
  color: var(--pink2);
  text-decoration: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 8px;
}
.heart {
  border: 0;
  background: transparent;
  color: var(--like);
  font-size: 26px;
  cursor: pointer;
  padding: 4px 0 0;
}
.heart.off { color: #e3b7c4; }
.fab {
  position: fixed;
  right: max(16px, calc((100vw - 430px) / 2 + 16px));
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: 58px; height: 58px;
  border-radius: 50%;
  border: 0;
  background: var(--pink2);
  color: #fff;
  font-size: 30px;
  box-shadow: var(--shadow);
  cursor: pointer;
  z-index: 30;
}
.sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(110%);
  bottom: 0;
  width: 100%;
  max-width: 430px;
  background: #fff8fa;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 40px rgba(90, 51, 64, 0.16);
  z-index: 40;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  transition: transform 0.28s ease;
  max-height: 92dvh;
  overflow: auto;
}
.sheet.open { transform: translateX(-50%) translateY(0); }
.sheet h2 { margin: 0 0 10px; font-size: 18px; color: var(--pink2); }
label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0 4px; }
input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}
textarea { min-height: 90px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quota { font-size: 13px; color: var(--muted); margin: 8px 0; }
.overlay {
  position: fixed; inset: 0; background: rgba(90, 51, 64, 0.28); z-index: 35;
}
.menu {
  position: fixed;
  top: 0; bottom: 0;
  left: 50%;
  margin-left: -215px;
  width: min(78vw, 300px);
  max-width: 300px;
  background: #fff8fa;
  z-index: 50;
  padding: calc(18px + env(safe-area-inset-top)) 16px;
  transform: translateX(-110%);
  transition: transform 0.25s ease;
  box-shadow: var(--shadow);
}
.menu.open { transform: translateX(0); }
.menu h3 { margin: 0 0 12px; color: var(--pink2); }
.menu p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.pin { text-align: center; }
.pin input { text-align: center; letter-spacing: 0.3em; font-size: 22px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
