:root{
  --bg:#0b1020;
  --card:#111a33;
  --muted:#94a3b8;
  --text:#e5e7eb;
  --primary:#3b82f6;
  --danger:#ef4444;
  --ok:#22c55e;
  --border:rgba(148,163,184,0.18);
  --shadow: 0 10px 25px rgba(0,0,0,.25);
  --radius: 16px;
  --maxw: 980px;
  --tap: 48px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, PingFang SC, Noto Sans CJK SC, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; font-family:var(--font); background:linear-gradient(180deg, #060915, #0b1020); color:var(--text); }
a{ color:inherit; text-decoration:none; }
img{ max-width:100%; }
button, input, textarea, select{ font-family:var(--font); }

.container{ max-width:var(--maxw); margin:0 auto; padding:16px; }
.header{
  position:sticky; top:0; z-index:20;
  backdrop-filter: blur(10px);
  background: rgba(6,9,21,0.65);
  border-bottom: 1px solid var(--border);
}
.header-inner{ max-width:var(--maxw); margin:0 auto; padding:12px 16px; display:flex; gap:10px; align-items:center; justify-content:space-between; }
.brand{ display:flex; align-items:center; gap:10px; }
.brand-dot{ width:12px; height:12px; border-radius:999px; background:var(--primary); box-shadow:0 0 0 6px rgba(59,130,246,0.18); }
.brand-title{ font-weight:800; letter-spacing:.2px; }
.nav{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.pill{ padding:8px 12px; border:1px solid var(--border); border-radius:999px; color:var(--muted); }
.pill:hover{ border-color: rgba(59,130,246,0.45); color: var(--text); }
.pill.primary{ background: rgba(59,130,246,0.18); border-color: rgba(59,130,246,0.45); color: var(--text); }

.hero{ padding:18px 0 6px; }
.h1{ font-size:22px; margin: 6px 0 8px; font-weight:900; }
.h2{ font-size:16px; margin: 0 0 10px; color: var(--muted); line-height:1.5; }

.grid{ display:grid; grid-template-columns:1fr; gap:12px; }
@media(min-width:860px){
  .grid.cols-2{ grid-template-columns:1fr 1fr; }
  .grid.cols-3{ grid-template-columns:repeat(3,1fr); }
}

.card{
  background: rgba(17,26,51,0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.card.soft{ background: rgba(17,26,51,0.45); box-shadow:none; }

.row{ display:flex; gap:12px; align-items:center; }
.row.wrap{ flex-wrap:wrap; }
.row.space{ justify-content:space-between; }
.row.top{ align-items:flex-start; }

.badge{
  font-size:12px;
  color: var(--text);
  background: rgba(34,197,94,0.16);
  border: 1px solid rgba(34,197,94,0.35);
  padding: 4px 10px;
  border-radius: 999px;
}
.badge.muted{
  color: var(--muted);
  background: rgba(148,163,184,0.12);
  border: 1px solid rgba(148,163,184,0.28);
}
.badge.danger{
  background: rgba(239,68,68,0.16);
  border-color: rgba(239,68,68,0.35);
}

.kv{ display:flex; flex-direction:column; gap:4px; }
.kv .k{ font-size:12px; color:var(--muted); }
.kv .v{ font-size:14px; }

.sep{ height:1px; background: var(--border); margin:12px 0; }

.input, .textarea, .select{
  width:100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(6,9,21,0.35);
  color: var(--text);
  font-size: 16px;
  outline: none;
}
.textarea{ min-height: 110px; resize: vertical; }
.label{ font-size:13px; color: var(--muted); margin: 0 0 6px; }
.help{ font-size:12px; color: var(--muted); margin-top: 6px; line-height:1.5; }
.help strong{ color: var(--text); }

.btn{
  height: var(--tap);
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(59,130,246,0.45);
  background: rgba(59,130,246,0.18);
  color: var(--text);
  font-weight: 800;
  cursor:pointer;
}
.btn:hover{ filter: brightness(1.05); }
.btn:disabled{ opacity:.55; cursor:not-allowed; }
.btn.secondary{
  border-color: var(--border);
  background: rgba(148,163,184,0.10);
  color: var(--text);
}
.btn.danger{
  border-color: rgba(239,68,68,0.5);
  background: rgba(239,68,68,0.16);
}
.btn.ghost{
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.btn.w100{ width:100%; }

.footer{ padding: 20px 0 60px; color: var(--muted); font-size:12px; text-align:center; }

.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(17,26,51,0.92);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 9999;
  max-width: min(92vw, 520px);
  display:none;
}
.toast.show{ display:block; }

/* Help widget (floating button + modal) */
.ks-fab{
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 2000;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  border: 1px solid rgba(59,130,246,0.55);
  background: rgba(59,130,246,0.22);
  color: var(--text);
  font-weight: 900;
  font-size: 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.ks-fab:hover{ filter: brightness(1.06); }

.ks-modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 3000;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding: 16px;
}
.ks-modal{
  width: min(96vw, 720px);
  max-height: 84vh;
  overflow:auto;
  padding: 14px;
  border-radius: 18px;
  background: rgba(17,26,51,0.92);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.ks-modal ol, .ks-modal ul{ margin: 8px 0 0 18px; }
.ks-modal li{ margin: 6px 0; line-height: 1.5; }
.small-muted{ font-size:12px; color: var(--muted); line-height:1.5; }

.small{ font-size:12px; color:var(--muted); }
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

.table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow:hidden;
  border-radius: 12px;
  border:1px solid var(--border);
}
.table th, .table td{
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 14px;
}
.table th{
  font-size: 12px;
  color: var(--muted);
  text-align:left;
  background: rgba(6,9,21,0.22);
}
.table tr:last-child td{ border-bottom:none; }

.notice{
  border: 1px dashed rgba(59,130,246,0.55);
  background: rgba(59,130,246,0.10);
  border-radius: 14px;
  padding: 12px;
  color: var(--text);
  line-height:1.5;
}

/* Role selection cards (home page) */
.role-card{
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.role-icon{ font-size: 28px; line-height: 1; }
.role-title{ font-size: 15px; font-weight: 900; }

/* Brand */
.brand-logo{
  width:28px;
  height:28px;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 18px rgba(0,0,0,.25);
  background: rgba(6,9,21,0.30);
}
.brand-dot{ display:none; }

/* Upload */
.upload{
  border: 1px dashed rgba(148,163,184,0.35);
  background: rgba(6,9,21,0.18);
  border-radius: 14px;
  padding: 12px;
}
.upload .upload-actions{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.upload .upload-hint{ color: var(--muted); font-size:12px; margin-top:6px; line-height:1.5; }

.filelist{ margin-top:10px; display:flex; flex-direction:column; gap:8px; }
.fileitem{ display:flex; gap:10px; align-items:center; justify-content:space-between; padding:10px 10px; border:1px solid var(--border); border-radius: 12px; background: rgba(17,26,51,0.35); }
.fileitem .meta{ min-width:0; }
.fileitem .name{ font-size:14px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width: 56vw; }
.fileitem .sub{ font-size:12px; color: var(--muted); margin-top:2px; }

.thumb{ width:44px; height:44px; border-radius:12px; border:1px solid var(--border); object-fit:cover; background: rgba(6,9,21,0.35); }

/* Mobile: bigger tappable */
@media(max-width:520px){
  .header-inner{ padding:12px 12px; }
  .nav{ gap:8px; }
  .pill{ padding:8px 10px; }
  .fileitem .name{ max-width: 48vw; }
}


/* ===== GlomCon badges + ratings (MVP) ===== */
.gc-badge{ display:inline-flex; align-items:center; gap:6px; font-size:12px; padding:6px 10px; border-radius:999px; border:1px solid var(--border); background:rgba(59,130,246,0.14); color:var(--text); white-space:nowrap; }
.gc-badge.expert{ background:rgba(245,158,11,0.18); border-color:rgba(245,158,11,0.35); }
.gc-badge.cert{ background:rgba(59,130,246,0.14); border-color:rgba(59,130,246,0.35); }
.gc-sublabel{ font-size:12px; color:rgba(229,231,235,0.75); white-space:nowrap; }
.rating-line{ display:inline-flex; align-items:center; gap:8px; font-size:13px; color:rgba(229,231,235,0.85); }
.stars{ letter-spacing:1px; font-size:14px; }
.small-muted{ color: var(--muted); font-size:12px; }
.kv{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.kv .item{ font-size:12px; color:rgba(229,231,235,0.78); border:1px solid var(--border); padding:6px 10px; border-radius:999px; background:rgba(17,26,51,0.6); }

/* =============================
   v4.3 Calendar booking
   ============================= */

.cal-week{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap:6px;
  color: var(--muted);
  font-size: 12px;
  padding: 4px 0;
}

.cal-week > div{ text-align:center; }

.cal-grid{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap:6px;
}

.cal-cell{
  appearance:none;
  border:1px solid var(--border);
  border-radius: 12px;
  background: rgba(17,26,51,0.35);
  color: var(--text);
  padding: 10px 0;
  font-weight: 800;
  cursor:pointer;
}

.cal-cell.muted{ opacity:0.55; }

.cal-cell.disabled{ opacity:0.35; cursor:not-allowed; }

.cal-cell.has{ box-shadow: 0 0 0 1px rgba(34,197,94,0.25) inset; }

.cal-cell.selected{
  border-color: rgba(59,130,246,0.65);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.25) inset;
}

/* ── 3-step flow guide ─────────────────────────────────────── */
.steps{
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-top: 10px;
}
.step{
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}
.step:not(:last-child)::after{
  content: '';
  position: absolute;
  top: 17px;
  left: 58%;
  width: 84%;
  height: 1px;
  background: var(--border);
}
.step-num{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(59,130,246,0.18);
  border: 1px solid rgba(59,130,246,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.step-label{
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.45;
  padding: 0 4px;
}
.step-label strong{
  color: var(--text);
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}

/* ── Example summary panel ──────────────────────────────────── */
.example-summary{
  background: rgba(6,9,21,0.35);
  border: 1px dashed rgba(148,163,184,0.28);
  border-radius: 12px;
  padding: 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-wrap;
  font-family: var(--font);
  margin-top: 10px;
  max-height: 260px;
  overflow-y: auto;
}
.example-summary strong{ color: var(--text); }

/* ─── Mobile / Touch Enhancements ─────────────────────────── */

/* Header nav: horizontal scroll on small screens, never wraps */
@media(max-width:859px){
  .nav{
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .nav::-webkit-scrollbar{ display: none; }
  .nav .pill{ white-space: nowrap; flex-shrink: 0; }
}

/* Scrolling tab bar for dashboard panels */
.tab-bar{
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.tab-bar::-webkit-scrollbar{ display: none; }
.tab-bar > .btn{ white-space: nowrap; flex-shrink: 0; }

/* Dynamic list containers: allow table horizontal scroll */
#skuList, #scheduleList, #followRelList,
#orderList, #bountyList, #inviteList{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
