:root{
    --bg:#ffffff;
    --card:#ffffff;
    --border:#e9e9e9;
    --muted:#666;
    --text:#111;
    --btn:#111;
    --btnText:#fff;
  }
  
  *{ box-sizing:border-box; }
  
  body{
    margin:0;
    background:var(--bg);
    color:var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  }
  
  img{ max-width:100%; height:auto; display:block; }
  
  a{ color:inherit; }
  
  /* ===== Layout ===== */
  .wrap{
    max-width: 820px;
    margin: 0 auto;
    padding: 18px;
  }
  
  .topbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:14px 18px;
    border-bottom:1px solid var(--border);
    background:#fff;
    position:sticky;
    top:0;
    z-index:10;
  }
  
  .brand{
    display:inline-flex;
    align-items:center;
    gap:10px;
    font-weight:900;
  }
  
  .logo{ height:32px; width:auto; }
  
  .menu{
    font-size:12px;
    letter-spacing:3px;
    color:var(--muted);
  }
  
  h1{ font-size:40px; margin: 10px 0 18px; }
  h2{ margin: 0 0 10px; }
  
  .card{
    background:var(--card);
    border:1px solid var(--border);
    border-radius:14px;
    padding:16px;
    margin: 12px 0;
    overflow:hidden; /* keeps scroller clipped inside rounded card */
  }
  
  .muted{ color:var(--muted); }
  .small{ font-size:12px; }
  
  .sep{
    border:0;
    border-top:1px solid var(--border);
    margin:18px 0;
  }
  
  /* ===== Form controls ===== */
  .field{ display:block; margin: 10px 0; }
  .label{ font-weight:700; margin-bottom:6px; }
  
  input, textarea{
    width:100%;
    border:1px solid var(--border);
    border-radius:12px;
    padding:12px 12px;
    font-size:16px;
  }
  input[type="checkbox"], input[type="radio"]{
    width:auto;
    padding:0;
  }
  
  textarea{ resize: vertical; }
  
  input:focus,
  textarea:focus{
    border-color:#cfcfcf;
  }
  
  .two{
    display:grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  @media (min-width: 680px){
    .two{ grid-template-columns: 1fr 1fr; }
  }
  
  /* Make checkbox/radio not inherit the full-width input styling */
  input[type="checkbox"],
  input[type="radio"]{
    width:auto;
    padding:0;
  }
  
  /* Checkbox row */
  .nomessage{ margin: 10px 0 18px; }
  .nomessage label{
    display:flex;
    align-items:center;
    gap:10px;
    font-size:14px;
    color:#333;
  }
  .nomessage input[type="checkbox"]{
    width:22px;
    height:22px;
  }
  
  /* Buttons */
  .btn{
    background:var(--btn);
    color:var(--btnText);
    border:none;
    border-radius:12px;
    padding:12px 14px;
    font-size:16px;
    font-weight:800;
    cursor:pointer;
  }
  
  .btn:hover{ opacity:0.92; }
  
  .btn.small{
    padding:8px 10px;
    font-size:14px;
    border-radius:10px;
  }
  
  .btn.ghost{
    background:#fff;
    border:1px solid #ddd;
    color:#111;
  }
  
  /* Notices */
  .notice{
    border:1px solid var(--border);
    background:#fafafa;
    border-radius:12px;
    padding:12px;
    margin: 10px 0 14px;
  }
  .notice.ok{
    border-color:#cfe9d6;
    background:#f3fbf6;
  }
  
  /* ===== Giftbox horizontal picker ===== */
  .boxscroller{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    scroll-snap-type:x mandatory;
    padding: 8px 0 14px;
  }
  
  .boxscroller::-webkit-scrollbar{ height:8px; }
  .boxscroller::-webkit-scrollbar-thumb{
    border-radius:999px;
    background: rgba(0,0,0,.15);
  }
  
  .boxlist{
    display:flex;
    gap:14px;
    padding: 0 10px; /* keeps first/last card from sticking to edge */
    scroll-padding-left: 10px;
  }
  
  /* Responsive card width: near-full on mobile, capped on desktop */
  .boxitem{
    flex: 0 0 calc(100% - 20px); /* avoids the “320px skinny column” */
    max-width: 420px;
    scroll-snap-align:start;
  
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:10px;
  
    padding:14px;
    border:1px solid var(--border);
    border-radius:16px;
    cursor:pointer;
    background:#fff;
    position:relative;
  }
  
  @media (min-width: 680px){
    .boxitem{
      flex: 0 0 360px;
      max-width:none;
    }
  }
  
  .boxitem:hover{ border-color:#dcdcdc; }
  
  /* Hide radio (we show selection by outlining the image) */
  .boxitem .radio{
    position:absolute;
    opacity:0;
    pointer-events:none;
  }
  
  /* Image */
  .boximg{
    width:100%;
    height:180px;
    border-radius:14px;
    overflow:hidden;
    background:#f4f4f4;
  }
  
  .boximg img{
    width:100%;
    height:100%;
    object-fit:cover;
  }
  
  /* Meta */
  .boxmeta{ min-width:0; }
  .boxtitle{
    font-size:20px;
    font-weight:900;
    line-height:1.15;
  }
  .boxprice{
    font-weight:800;
    margin-top:4px;
  }
  .boxdesc{
    margin-top:6px;
    font-size:14px;
    line-height:1.3;
    color:var(--muted);
  
    display:-webkit-box;
    -webkit-line-clamp:3;
    -webkit-box-orient:vertical;
    overflow:hidden;
  }
  
  /* Selected state */
  .boxitem input:checked ~ .boximg{
    outline:2px solid #111;
    outline-offset:2px;
  }
  
  /* ===== Admin table bits (kept for your admin pages) ===== */
  .adminbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap: 12px;
    flex-wrap:wrap;
  }
  .adminlinks{
    display:flex;
    align-items:center;
    gap: 10px;
  }
  .adminlinks a{
    color: #111;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
  }
  .adminlinks a:hover{ border-bottom-color:#111; }
  
  .table{
    width:100%;
    border-collapse:collapse;
  }
  .table th, .table td{
    text-align:left;
    padding:10px;
    border-bottom:1px solid var(--border);
    vertical-align:top;
  }
  .table th{
    background:#fafafa;
    position:sticky;
    top:0;
  }
  
  .badge{
    display:inline-block;
    padding:4px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
  }
  .badge.new{ background:#fff3cd; }
  .badge.paid{ background:#d1e7dd; }
  
  .thumbs{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
  }
  .thumbs img{
    width:56px;
    height:56px;
    object-fit:cover;
    border-radius:10px;
    border:1px solid var(--border);
  }
  
  /* ===== Sample toggle ===== */
  .sample-link{
    color:#111;
    font-weight:700;
    text-decoration:underline;
    cursor:pointer;
    margin-left:6px;
  }
  
  .sample-box{
    display:none;
    margin:12px 0 16px;
    border:1px solid var(--border);
    border-radius:12px;
    overflow:hidden;
  }
  .sample-box img{
    width:100%;
    display:block;
  }
  .cookiegrid{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
  }
  
  .cookiecard{
    border:1px solid var(--border);
    border-radius:14px;
    overflow:hidden;
    background:#fff;
  }
  
  .cookiecard img{
    width:100%;
    aspect-ratio: 1 / 1;
    object-fit:cover;
  }
  
  .cookietitle{
    padding:10px 12px;
    font-weight:800;
    font-size:14px;
  }

  .notice.error{
    border-color:#f5c2c7;
    background:#fff5f5;
  }

  .submit-error{
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #f3b4b4;
    background: #fff5f5;
    color: #8a1f1f;
    font-weight: 600;
    font-size: 14px;
  }

  .img-modal{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    display:none;
    align-items:center;
    justify-content:center;
    z-index:2000;
    padding: 18px;
  }
  .img-modal img{
    max-width: 96%;
    max-height: 92%;
    border-radius: 12px;
  }
  
  .boximg{ position: relative; } /* important */
  
  .zoom-btn{
    position:absolute;
    bottom:10px;
    right:10px;
    background:rgba(0,0,0,.7);
    color:#fff;
    font-size:14px;
    padding:6px 9px;
    border-radius:999px;
    cursor:pointer;
    line-height:1;
    user-select:none;
  }

.cookiecard.selectable { cursor:pointer; }
.cookiecard.selectable.selected { outline: 3px solid #000; border-radius: 16px; }

.order-summary {
  margin-left: auto;
  font-weight: 600;
  font-size: 15px;
  background: #111;
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
}
.chips { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0 14px; }
.chip {
  border:1px solid #ddd;
  background:#fff;
  padding:8px 10px;
  border-radius:999px;
  font-size:14px;
  cursor:pointer;
}
.chip.active { border-color:#111; }
.chip.clear { opacity:0.7; }

.recoBadge{
  display:inline-block;
  margin-top:6px;
  padding:4px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  background:#eaf5ef;
}
.boxitem.recommended { outline:2px solid rgba(0,0,0,0.06); }

#messageChips .chip{
  font-size:13px;
  padding:8px 10px;
}
#messageChips .chip.active{
  border-color:#111;
}

#qty {
  width: 100%;
}

.field .muted.small {
  margin-top: 6px;
}