@font-face { font-family: "Noto Sans Thai"; src: url(fonts/NotoSansThai-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Noto Sans Thai"; src: url(fonts/NotoSansThai-Bold.ttf) format("truetype"); font-weight: 600 700; font-display: swap; }

/* Colours from the approved mockup (24 Oct): cream, coral pink, mint for the "smile" line. */
:root {
  --bg: #FFF8F3; --card: #FFFFFF; --ink: #3D2A24; --muted: #8A7268; --line: #F0E2DA;
  --accent: #E46F76; --accent-d: #A8353D; --accent-soft: #FDE6E3; --mint: #DCEFE5; --mint-d: #2F6B52;
  --warn: #FFF3D6; --warn-d: #8A6512; --fig: #FDF1EC;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { font-family: "Noto Sans Thai", -apple-system, system-ui, sans-serif; background: var(--bg); color: var(--ink);
  font-size: 16px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }

.app { max-width: 560px; margin: 0 auto; min-height: 100%; }
.view { padding: calc(var(--safe-t) + 18px) 16px calc(96px + var(--safe-b)); display: flex; flex-direction: column; gap: 18px; }
h1 { font-size: 25px; line-height: 1.3; }
h2 { font-size: 15px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
h3 { font-size: 18px; line-height: 1.35; }
.sub { font-size: 14.5px; color: var(--muted); margin-top: 2px; }
.note { font-size: 13px; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px; border-radius: 16px;
  background: var(--accent); color: #fff; font-size: 18px; font-weight: 700; padding: 0 16px; }
.btn:disabled { background: #D9B7B3; cursor: default; }
.btn.ghost { background: var(--card); color: var(--accent-d); border: 1.5px solid var(--line); font-size: 16px; min-height: 48px; }
.link { color: var(--accent-d); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; font-size: 15px; }
.sticky { position: sticky; bottom: calc(80px + var(--safe-b)); z-index: 5; padding-top: 10px;
  background: linear-gradient(transparent, var(--bg) 35%); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px;
  font-size: 15px; min-height: 40px; }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-d); font-weight: 700; }
.seg { display: flex; gap: 8px; }
.seg .chip { flex: 1; border-radius: 12px; }
.seg .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.field { width: 100%; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); padding: 11px 14px; font-size: 16px; }
.field:focus { outline: 2px solid var(--accent); border-color: transparent; }

/* photo picker */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--fig); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .x { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.55);
  color: #fff; font-size: 18px; line-height: 30px; text-align: center; }
.photo .n { position: absolute; left: 6px; bottom: 6px; background: rgba(255,255,255,.92); border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 700; }
.add { aspect-ratio: 1; border-radius: 14px; border: 2px dashed #E7C9C1; background: var(--card); color: var(--accent-d);
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; gap: 2px; }
.add.big { aspect-ratio: auto; min-height: 150px; grid-column: 1 / -1; font-size: 17px; }
.add svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 1.8; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.info { display: grid; gap: 10px; }
.info .item { display: flex; gap: 10px; font-size: 15px; }
.info .item b { flex: none; width: 74px; color: var(--muted); font-weight: 600; font-size: 13.5px; padding-top: 1px; }
.warn { background: var(--warn); border-radius: 12px; padding: 8px 12px; font-size: 14.5px; color: #5c4510; }

.spot { display: flex; flex-direction: column; gap: 10px; }
.spot .head { display: flex; gap: 10px; align-items: flex-start; }
.spot .no { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700;
  display: grid; place-items: center; margin-top: 1px; }
.spot .shot { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; }
.spot p { font-size: 15px; }
.spot p b { color: var(--muted); font-weight: 600; }
.strip { display: flex; gap: 8px; overflow-x: auto; margin: 0 -14px; padding: 0 14px 2px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.mini { flex: none; width: 92px; text-align: left; }
.mini img { width: 92px; height: 115px; object-fit: cover; border-radius: 10px; background: var(--fig); }
.mini span { display: block; font-size: 12.5px; line-height: 1.3; margin-top: 4px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { position: relative; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 6px; }
.tile img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; background: var(--fig); }
.tile b { display: block; font-size: 14.5px; line-height: 1.3; margin: 6px 4px 0; }
.tile span { display: block; font-size: 12px; color: var(--muted); margin: 0 4px 2px; }
.tile .heart { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.9);
  display: grid; place-items: center; color: var(--accent); font-size: 16px; }

.plan-item { display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; }
.plan-item .ico { flex: none; width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-d);
  display: grid; place-items: center; font-size: 20px; }
.plan-item b { display: block; font-size: 16px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; display: flex; flex-direction: column; gap: 14px; align-items: center; }

.loading { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 50px 10px; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--accent-soft); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; border-top-color: var(--accent); } }

.topbar { display: flex; align-items: center; gap: 8px; margin-bottom: -6px; }
.back { width: 40px; height: 40px; margin-left: -8px; display: grid; place-items: center; font-size: 22px; color: var(--accent-d); }
.more { margin-left: auto; font-size: 14px; color: var(--muted); padding: 8px; }

/* tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--line); padding: 6px 0 calc(6px + var(--safe-b)); }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 12.5px; color: var(--muted); min-width: 90px; padding: 4px 0; }
.tabs svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; }
.tabs button[aria-current="page"] { color: var(--accent-d); font-weight: 700; }

/* shoot mode: one pose, readable at a glance, controls under the thumb */
.shoot { position: fixed; inset: 0; z-index: 20; background: var(--bg); display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
.shoot .bar { display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-t) + 8px) 12px 6px; }
.shoot .bar .t { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shoot .bar .c { font-size: 14px; color: var(--muted); flex: none; }
.shoot .close { width: 40px; height: 40px; font-size: 24px; flex: none; }
.shoot .prog { height: 5px; background: var(--line); margin: 0 14px; border-radius: 3px; overflow: hidden; }
.shoot .prog i { display: block; height: 100%; background: var(--accent); }
.shoot .body { flex: 1; overflow-y: auto; padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 12px; }
.shoot .pic { width: 100%; height: 42vh; min-height: 240px; object-fit: cover; object-position: center 20%; border-radius: 18px; background: var(--fig); }
.shoot h1 { font-size: 23px; }
.shoot .spotnote { background: var(--accent-soft); color: #6d2a2f; border-radius: 12px; padding: 8px 12px; font-size: 15.5px; font-weight: 600; }
.say h2 { margin-bottom: 6px; }
.say ol { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.say li { display: flex; gap: 10px; font-size: 19px; line-height: 1.4; font-weight: 600; }
.say li i { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-d);
  font-style: normal; font-size: 14px; display: grid; place-items: center; margin-top: 2px; }
.smile { background: var(--mint); border-radius: 16px; padding: 10px 14px; }
.smile b { font-size: 13px; color: var(--mint-d); }
.smile p { font-size: 17px; font-weight: 600; }
.meta { display: flex; gap: 8px; font-size: 13.5px; }
.meta div { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 9px; }
.meta b { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.ctrl { display: flex; gap: 10px; padding: 10px 14px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--bg); }
.ctrl button { height: 64px; border-radius: 18px; font-weight: 700; font-size: 18px; }
.ctrl .prev { width: 70px; background: var(--card); border: 1.5px solid var(--line); }
.ctrl .fav { width: 70px; background: var(--accent-soft); color: var(--accent-d); font-size: 24px; }
.ctrl .next { flex: 1; background: var(--accent); color: #fff; }
.ctrl button:disabled { opacity: .4; }

.login { min-height: 80vh; justify-content: center; }
.logo { width: 72px; height: 72px; border-radius: 20px; }
.err { color: var(--accent-d); font-size: 14.5px; }
.shoot:not([hidden]) ~ .toast { bottom: auto; top: calc(var(--safe-t) + 60px); }
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 12px; font-size: 14.5px; z-index: 30; max-width: 90vw; }

@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .shoot { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .shoot .pic { height: 46vh; object-fit: contain; }
}
