:root{
  --bg:#f6f4f1; --panel:#ffffff; --ink:#1d1b19; --muted:#8a8178;
  --line:#e7e2db; --accent:#b8464f; --accent-ink:#fff;
  --ok:#2e7d52; --bad:#c0392b; --soft:#faf8f5;
  --radius:14px; --shadow:0 2px 10px rgba(40,30,20,.06);
  font-synthesis:none;
}
*{box-sizing:border-box}
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:"Segoe UI",system-ui,-apple-system,Roboto,Helvetica,Arial,sans-serif;
  line-height:1.45;
}
h1,h2,h3{margin:0}
.muted{color:var(--muted)}
.small{font-size:.85rem}
.hidden{display:none !important}

.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 24px; background:var(--panel); border-bottom:1px solid var(--line);
  position:sticky; top:0; z-index:5;
}
.brand{display:flex; align-items:center; gap:14px}
.logo{ height:52px; width:auto; display:block }
.brandsep{ padding-left:14px; border-left:1px solid var(--line) }
.brand h1{font-size:1.15rem; letter-spacing:.2px}
.tag{margin:0; font-size:.8rem; color:var(--muted)}

.layout{
  max-width:1180px; margin:22px auto; padding:0 20px;
  display:grid; grid-template-columns:1fr 1fr; gap:20px;
}
@media(max-width:880px){ .layout{grid-template-columns:1fr} }

.panel{
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius);
  padding:20px; box-shadow:var(--shadow);
}
.step{font-size:.82rem; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); margin:18px 0 10px}
.step:first-child{margin-top:0}

.tabs{display:flex; gap:8px; flex-wrap:wrap}
.tab{
  padding:9px 16px; border:1px solid var(--line); background:var(--soft);
  border-radius:999px; cursor:pointer; font-size:.92rem; color:var(--ink);
}
.tab.active{background:var(--accent); color:var(--accent-ink); border-color:var(--accent)}

.field{display:flex; flex-direction:column; gap:6px; margin-bottom:12px}
.field label{font-size:.85rem; color:var(--ink)}
input[type=text],input[type=password],select{
  padding:10px 12px; border:1px solid var(--line); border-radius:10px;
  background:#fff; color:var(--ink); font-size:.95rem; width:100%;
}
input:focus,select:focus{outline:2px solid #e9c7ca; border-color:var(--accent)}

.slots{display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:12px}
.slot{
  border:1.5px dashed var(--line); border-radius:12px; background:var(--soft);
  aspect-ratio:3/4; display:flex; flex-direction:column; align-items:center; justify-content:center;
  cursor:pointer; text-align:center; padding:10px; position:relative; overflow:hidden;
  transition:border-color .15s,background .15s;
}
.slot:hover{border-color:var(--accent)}
.slot.filled{border-style:solid}
.slot.dragover{border-color:var(--accent); background:#fbeff0}
.slot img{position:absolute; inset:0; width:100%; height:100%; object-fit:cover}
.slot .cap{position:absolute; left:0; right:0; bottom:0; padding:6px 8px; font-size:.78rem;
  background:rgba(255,255,255,.9); color:var(--ink); border-top:1px solid var(--line)}
.slot .ph{font-size:.82rem; color:var(--muted)}
.slot .plus{font-size:1.6rem; color:var(--accent); line-height:1}
.slot .req{color:var(--accent)}
.slot .rm{position:absolute; top:6px; right:6px; background:rgba(0,0,0,.55); color:#fff;
  border:none; border-radius:50%; width:22px; height:22px; cursor:pointer; font-size:.8rem; z-index:2}

.reco{margin-top:7px; display:flex; flex-wrap:wrap; align-items:center; gap:6px}
.recolbl{font-size:.76rem; color:var(--muted)}
.chip{
  font-size:.76rem; padding:4px 10px; border-radius:999px; cursor:pointer;
  border:1px solid var(--line); background:var(--soft); color:var(--ink);
}
.chip:hover{border-color:var(--accent); color:var(--accent)}
.chip.on{background:var(--accent); color:#fff; border-color:var(--accent)}

.options{display:flex; flex-direction:column; gap:4px}
.check{display:flex; align-items:center; gap:8px; font-size:.92rem; margin:2px 0}
.check input{width:auto}

button{font-family:inherit}
.primary{
  background:var(--accent); color:#fff; border:none; border-radius:10px;
  padding:11px 18px; font-size:.95rem; cursor:pointer; font-weight:600;
}
.primary:hover{background:#a23a43}
.primary:disabled{opacity:.5; cursor:not-allowed}
.primary.big{width:100%; margin-top:16px; padding:14px; font-size:1.02rem}
.ghost{
  background:#fff; color:var(--ink); border:1px solid var(--line); border-radius:10px;
  padding:10px 16px; cursor:pointer; font-size:.92rem;
}
.ghost:hover{border-color:var(--accent); color:var(--accent)}
.note{font-size:.78rem; color:var(--muted); text-align:center; margin:10px 0 0}

.status{padding:14px; border-radius:10px; background:var(--soft); color:var(--muted); font-size:.9rem; text-align:center}
.status.idle{border:1px dashed var(--line)}
.status.err{background:#fdeceb; color:var(--bad); border:1px solid #f3c6c2}
.status.ok{background:#eaf5ef; color:var(--ok); border:1px solid #c3e4d2}

.gallery{display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:12px; margin-top:14px}
.shot{border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#fff}
.shot img{width:100%; aspect-ratio:3/4; object-fit:cover; display:block; cursor:zoom-in}
.shot .lbl{display:flex; justify-content:space-between; align-items:center; padding:7px 10px; font-size:.8rem}
.shot .lbl a{color:var(--accent); text-decoration:none}

.pushcard{margin-top:20px; border-top:1px solid var(--line); padding-top:16px}
.pushcard h3{font-size:1rem; margin-bottom:12px}
.grid2{display:grid; grid-template-columns:1fr 1fr; gap:12px}
@media(max-width:520px){ .grid2{grid-template-columns:1fr} }
.pushrow{display:flex; gap:10px; margin-top:6px}
.pushstatus{margin-top:12px; font-size:.88rem}
.pushstatus a{color:var(--accent)}

.dot{display:inline-block; width:9px; height:9px; border-radius:50%; background:var(--muted); margin-left:4px}
.dot.on{background:var(--ok)} .dot.off{background:var(--bad)}

.topright{display:flex; align-items:center; gap:12px}
.userchip{font-size:.85rem; color:var(--ink); background:var(--soft); border:1px solid var(--line); padding:7px 12px; border-radius:999px}
.userchip.low{border-color:#e4b200; background:#fff8e1}
.userchip.empty{border-color:var(--bad); background:#fdeceb; color:var(--bad)}

.authgate{position:fixed; inset:0; background:linear-gradient(135deg,#f6f4f1,#efe7e7); display:grid; place-items:center; z-index:50; padding:20px}
.authbox{background:#fff; border:1px solid var(--line); border-radius:18px; padding:30px; width:min(420px,100%); box-shadow:0 20px 60px rgba(0,0,0,.15); text-align:center}
.authlogo{height:60px; width:auto; margin-bottom:10px}
.authbox h2{font-size:1.2rem; margin-bottom:4px}
.authtabs{display:flex; gap:8px; margin:18px 0 14px}
.authtab{flex:1; padding:9px; border:1px solid var(--line); background:var(--soft); border-radius:10px; cursor:pointer; font-size:.9rem}
.authtab.active{background:var(--accent); color:#fff; border-color:var(--accent)}
.authpane{text-align:left}
.authpane .field label{font-weight:500}

.modal{position:fixed; inset:0; background:rgba(25,20,16,.5); display:grid; place-items:center; z-index:20; padding:20px}
.modalbox{background:#fff; border-radius:16px; padding:22px; width:min(560px,100%); max-height:90vh; overflow:auto; box-shadow:0 20px 60px rgba(0,0,0,.25)}
.modalhead{display:flex; justify-content:space-between; align-items:center; margin-bottom:6px}
.iconbtn{background:none; border:none; font-size:1.1rem; cursor:pointer; color:var(--muted)}

.overlay{position:fixed; inset:0; background:rgba(246,244,241,.82); display:grid; place-items:center; z-index:30; gap:14px}
.overlay p{font-size:.95rem; color:var(--ink)}
.spinner{width:46px; height:46px; border:4px solid #e7d7d8; border-top-color:var(--accent); border-radius:50%; animation:spin .9s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

.lightbox{position:fixed; inset:0; background:rgba(0,0,0,.85); display:grid; place-items:center; z-index:40; cursor:zoom-out}
.lightbox img{max-width:92vw; max-height:92vh; border-radius:8px}

/* brand footer */
.brandfoot{
  max-width:1180px; margin:10px auto 40px; padding:18px 22px;
  display:flex; align-items:center; gap:16px; flex-wrap:wrap;
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow);
}
.footlogo{height:46px; width:auto}
.foottext{display:flex; flex-direction:column; line-height:1.4}
.foottext strong{font-size:.92rem}
.foottext span{font-size:.85rem; color:var(--muted)}
.foottext a{color:var(--accent); text-decoration:none}
.foottext a:hover{text-decoration:underline}
.footnote{margin-left:auto; font-size:.76rem; color:var(--muted); max-width:300px; text-align:right}
@media(max-width:620px){ .footnote{margin-left:0; text-align:left; max-width:none} }
