/* Dinner Plug web app — mobile-first, brand red #C8102E */
:root{
  --red:#C8102E; --red-dark:#9E0C24; --red-tint:#FDECEF;
  --ink:#2D2D30; --gray:#5A5A5E; --line:#EFE7DF; --cream:#FFF8F2;
  --header-h:64px; --tabbar-h:64px;
}
*{margin:0;padding:0;box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  color:var(--ink); background:#fff; line-height:1.5;
  padding-bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
img{max-width:100%}
.hidden{display:none !important}
.muted{color:var(--gray)}
.pad{padding:18px}
button{font-family:inherit;cursor:pointer}
input,select,textarea{font-family:inherit;font-size:16px}
a{color:var(--red)}

/* ── Header ─────────────────────────────────────────────── */
.app-header{
  position:sticky; top:0; z-index:40; height:var(--header-h);
  display:flex; align-items:center; gap:10px; padding:8px 16px;
  background:#fff; border-bottom:1px solid var(--line);
}
.header-logo{height:42px; width:auto}
.header-tag{font-size:12px; color:var(--gray); font-weight:600; letter-spacing:.2px}

/* ── Views ──────────────────────────────────────────────── */
.view{display:none; max-width:1060px; margin:0 auto; padding:0 0 24px}
.view.active{display:block}

/* ── Buttons / forms ────────────────────────────────────── */
.btn{
  display:inline-block; padding:13px 24px; border-radius:999px; border:none;
  font-weight:700; font-size:16px; text-decoration:none; text-align:center; transition:.15s;
}
.btn-red{background:var(--red); color:#fff}
.btn-red:hover{background:var(--red-dark)}
.btn-red:disabled{background:#D9A0AA; cursor:not-allowed}
.btn-ghost{border:2px solid var(--red); color:var(--red); background:#fff}
.btn-soft{background:var(--red-tint); color:var(--red)}
.btn-block{display:block; width:100%}
.btn-sm{padding:9px 16px; font-size:14px}
.form label{display:block; font-weight:600; font-size:14px; margin:16px 0 6px}
.form label:first-child{margin-top:0}
.form input,.form select,.form textarea{
  width:100%; padding:12px 14px; border:1.5px solid #DDD; border-radius:10px; background:#fff;
}
.form input:focus,.form select:focus,.form textarea:focus{outline:none; border-color:var(--red)}
.check-row{display:flex; gap:10px; align-items:flex-start; font-size:14.5px; font-weight:500; margin:16px 0}
.check-row input{width:20px; height:20px; margin-top:1px; accent-color:var(--red); flex:none}
.panel{
  background:#fff; border:1px solid var(--line); border-radius:16px;
  padding:22px 20px; margin:18px 16px 0;
}
.panel h2,.panel h3{margin-bottom:8px}
.free-banner{
  background:var(--red-tint); border:1.5px dashed var(--red); border-radius:14px;
  padding:16px 18px; margin:18px 16px 0; text-align:center;
}
.free-banner strong{color:var(--red); font-size:18px; display:block; margin-bottom:4px}

/* ── Feed ───────────────────────────────────────────────── */
.feed-tools{padding:14px 16px 4px; position:sticky; top:var(--header-h); background:#fff; z-index:30}
.feed-tools input{
  width:100%; padding:13px 16px; border:1.5px solid #DDD; border-radius:999px; background:var(--cream);
}
.feed-tools input:focus{outline:none; border-color:var(--red); background:#fff}
.chip-row{display:flex; gap:8px; overflow-x:auto; padding:10px 2px 6px; scrollbar-width:none}
.chip-row::-webkit-scrollbar{display:none}
.chip{
  flex:none; padding:8px 15px; border-radius:999px; border:1.5px solid var(--line);
  background:#fff; font-weight:600; font-size:14px; color:var(--gray);
}
.chip.active{background:var(--red); border-color:var(--red); color:#fff}
.feed-grid{
  display:grid; grid-template-columns:1fr; gap:18px; padding:12px 16px 8px;
}
@media (min-width:620px){ .feed-grid{grid-template-columns:1fr 1fr} }
@media (min-width:960px){ .feed-grid{grid-template-columns:1fr 1fr 1fr} }
.card{
  border:1px solid var(--line); border-radius:18px; overflow:hidden; background:#fff;
  box-shadow:0 4px 18px rgba(45,45,48,.05); cursor:pointer;
}
.card-photo{position:relative; aspect-ratio:4/3; background:#EEE; overflow:hidden}
.card-photo img{width:100%; height:100%; object-fit:cover; display:block}
.card-photo .fallback{
  width:100%; height:100%; display:flex; align-items:center; justify-content:center;
  font-size:56px; color:rgba(255,255,255,.85);
}
.avail-badge{
  position:absolute; left:10px; top:10px; background:rgba(255,255,255,.94); color:var(--ink);
  font-size:12px; font-weight:700; padding:5px 10px; border-radius:999px;
}
.avail-badge.sold{color:var(--red)}
.heart{
  position:absolute; right:10px; top:10px; width:38px; height:38px; border-radius:50%;
  border:none; background:rgba(255,255,255,.94); font-size:19px; line-height:1; color:#B9B9BE;
  display:flex; align-items:center; justify-content:center;
}
.heart.on{color:var(--red)}
.card-body{padding:14px 16px 16px}
.card-top{display:flex; justify-content:space-between; gap:10px; align-items:baseline}
.card-dish{font-size:17.5px; font-weight:800; line-height:1.25}
.card-price{font-size:17.5px; font-weight:800; color:var(--red); white-space:nowrap}
.card-vendor{color:var(--gray); font-size:14px; margin-top:3px}
.card-rating{font-size:14px; margin-top:5px; font-weight:600}
.card-rating .star{color:#E8A33D}
.card-rating .muted{font-weight:500}

/* ── Map ────────────────────────────────────────────────── */
.map-el{height:calc(100vh - var(--header-h) - var(--tabbar-h) - 42px); min-height:340px; z-index:1}
.map-hint{padding:10px 16px; font-size:13.5px}
.price-bubble{
  background:var(--red); color:#fff; font-weight:800; font-size:13.5px;
  padding:6px 11px; border-radius:999px; border:2px solid #fff;
  box-shadow:0 3px 10px rgba(0,0,0,.3); white-space:nowrap; text-align:center;
}
.price-bubble::after{
  content:""; display:block; width:9px; height:9px; background:var(--red);
  transform:rotate(45deg); margin:-5px auto 0; border-right:2px solid #fff; border-bottom:2px solid #fff;
}
.map-pop h4{font-size:15.5px; margin-bottom:2px}
.map-pop p{margin:2px 0; font-size:13.5px}
.map-pop button{
  margin-top:7px; background:var(--red); color:#fff; border:none; border-radius:999px;
  padding:8px 14px; font-weight:700; font-size:13.5px;
}

/* ── Modals ─────────────────────────────────────────────── */
.modal{
  position:fixed; inset:0; z-index:80; background:rgba(30,10,14,.5);
  display:flex; align-items:flex-end; justify-content:center;
}
@media (min-width:640px){ .modal{align-items:center; padding:20px} }
.modal-sheet{
  background:#fff; width:100%; max-width:620px; max-height:92vh; overflow-y:auto;
  border-radius:22px 22px 0 0; padding:20px 20px 30px; position:relative;
}
@media (min-width:640px){ .modal-sheet{border-radius:22px} }
.modal-sheet.small{max-width:480px}
.modal-close{
  position:absolute; right:14px; top:12px; width:36px; height:36px; border-radius:50%;
  border:none; background:rgba(255,255,255,.92); font-size:22px; line-height:1; z-index:2;
  box-shadow:0 2px 8px rgba(0,0,0,.15);
}
.detail-photo{border-radius:16px; overflow:hidden; aspect-ratio:4/3; background:#EEE; margin:-4px -4px 14px}
.detail-photo img{width:100%; height:100%; object-fit:cover; display:block}
.detail-photo .fallback{width:100%; height:100%; display:flex; align-items:center; justify-content:center; font-size:72px; color:rgba(255,255,255,.85)}
.detail-head{display:flex; justify-content:space-between; gap:12px; align-items:baseline}
.detail-head h2{font-size:23px; line-height:1.2}
.detail-price{font-size:22px; font-weight:800; color:var(--red); white-space:nowrap}
.detail-actions{display:flex; gap:10px; margin:18px 0 6px; flex-wrap:wrap}
.detail-actions .btn{flex:1; min-width:130px}
.link-btn{background:none; border:none; color:var(--gray); font-size:14px; font-weight:600; text-decoration:underline; padding:6px 0}
.vendor-card{
  border:1px solid var(--line); border-radius:14px; padding:14px 16px; margin-top:16px; background:var(--cream);
}
.vendor-card h4{font-size:16.5px}
.vendor-card p{font-size:14px; color:var(--gray); margin-top:4px}
.rate-row{display:flex; gap:6px; font-size:30px; margin:8px 0 2px}
.rate-row button{background:none; border:none; font-size:30px; color:#D8D8DC; padding:0 2px; line-height:1}
.rate-row button.on{color:#E8A33D}

/* ── Messages ───────────────────────────────────────────── */
.convo-list{padding:8px 0}
.convo-item{
  display:flex; gap:12px; width:100%; text-align:left; background:#fff; border:none;
  border-bottom:1px solid var(--line); padding:15px 16px; align-items:center;
}
.convo-avatar{
  flex:none; width:48px; height:48px; border-radius:50%; color:#fff; font-weight:800;
  display:flex; align-items:center; justify-content:center; font-size:19px;
}
.convo-main{flex:1; min-width:0}
.convo-name{font-weight:700; font-size:16px}
.convo-sub{color:var(--gray); font-size:13.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.convo-time{color:var(--gray); font-size:12px; flex:none}
.thread-head{
  display:flex; align-items:center; gap:10px; padding:12px 16px; border-bottom:1px solid var(--line);
  position:sticky; top:var(--header-h); background:#fff; z-index:20;
}
.thread-head .back{background:none; border:none; font-size:22px; color:var(--red); padding:2px 8px 2px 0}
.thread-msgs{padding:16px; display:flex; flex-direction:column; gap:9px; min-height:300px}
.bubble{
  max-width:78%; padding:10px 14px; border-radius:18px; font-size:15.5px; line-height:1.4;
  word-wrap:break-word;
}
.bubble.mine{align-self:flex-end; background:var(--red); color:#fff; border-bottom-right-radius:6px}
.bubble.theirs{align-self:flex-start; background:#F1EEE9; border-bottom-left-radius:6px}
.bubble .b-time{display:block; font-size:11px; opacity:.75; margin-top:4px}
.composer{
  display:flex; gap:9px; padding:11px 14px; border-top:1px solid var(--line);
  position:sticky; bottom:var(--tabbar-h); background:#fff;
}
.composer input{flex:1; padding:12px 15px; border:1.5px solid #DDD; border-radius:999px}
.composer input:focus{outline:none; border-color:var(--red)}
.composer button{
  background:var(--red); color:#fff; border:none; border-radius:999px; padding:0 20px; font-weight:700;
}
.section-label{padding:18px 16px 4px; font-size:13px; font-weight:800; letter-spacing:1.2px; text-transform:uppercase; color:var(--gray)}

/* ── Account / lists ────────────────────────────────────── */
.my-listing{
  display:flex; gap:12px; align-items:center; border:1px solid var(--line); border-radius:14px;
  padding:12px 14px; margin:10px 16px 0; background:#fff;
}
.my-listing .thumb{width:56px; height:56px; border-radius:10px; object-fit:cover; flex:none; background:#EEE}
.my-listing .thumb-fallback{width:56px; height:56px; border-radius:10px; flex:none; display:flex; align-items:center; justify-content:center; font-size:24px; color:rgba(255,255,255,.9)}
.my-listing select{padding:8px; border:1.5px solid #DDD; border-radius:8px; font-size:14px}
.auth-switch{margin-top:16px; text-align:center; font-size:14.5px}

/* ── Legal gate ─────────────────────────────────────────── */
.gate{
  position:fixed; inset:0; z-index:100; background:#fff; overflow-y:auto;
  display:flex; align-items:flex-start; justify-content:center; padding:28px 18px 40px;
}
.gate-card{max-width:520px; width:100%}
.gate-logo{width:min(420px,90vw); display:block; margin:0 auto 8px}
.role-row{display:flex; gap:12px; margin:20px 0 4px}
.role-btn{flex:1; font-size:20px; font-weight:700; padding:16px 0; border-radius:14px}
.role-browse{margin-top:16px; font-size:13px}
.role-browse a{color:#8a8a8f; text-decoration:underline}
.gate-card h2{text-align:center; font-size:24px}
.gate-slogan{text-align:center; color:var(--red); font-weight:700; margin-bottom:18px}
.gate-terms{
  background:var(--cream); border:1px solid var(--line); border-radius:14px; padding:16px 18px; font-size:14.5px;
}
.gate-terms ul{margin:8px 0 0 18px}
.gate-terms li{margin:6px 0}

/* ── Tab bar ────────────────────────────────────────────── */
.tabbar{
  position:fixed; left:0; right:0; bottom:0; z-index:50; height:calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom:env(safe-area-inset-bottom);
  background:#fff; border-top:1px solid var(--line);
  display:flex; justify-content:space-around;
}
.tab{
  flex:1; background:none; border:none; display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:2px; color:#9A9AA0; font-size:11.5px; font-weight:600; padding-top:6px;
}
.tab svg{width:25px; height:25px; fill:currentColor}
.tab.active{color:var(--red)}

/* ── Toast ──────────────────────────────────────────────── */
.toast{
  position:fixed; left:50%; transform:translateX(-50%); bottom:calc(var(--tabbar-h) + 18px); z-index:120;
  background:var(--ink); color:#fff; padding:12px 20px; border-radius:999px; font-size:14.5px; font-weight:600;
  max-width:88vw; text-align:center; box-shadow:0 8px 24px rgba(0,0,0,.25);
}
