:root{
  --brand-orange:#f6a94b;
  --brand-card:#fbf2e6;
  --brand-border:#eadfce;
  --brand-ink:#1e1830;
  --brand-ink-d:#4a425e;
  --brand-purple:#1b1533;
  --ok:#0b7a65;
  --err:#9b1c1c;
}
*{box-sizing:border-box;}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial,sans-serif;
  color:var(--brand-ink);
  background:transparent;
}
.wrap{
  max-width:720px;
  margin:40px auto 60px;
  padding:0 16px 40px;
}
h1{
  margin:0 0 6px;
  font-size:32px;
}
h2{
  margin:0 0 6px;
  font-size:22px;
}
h3{
  margin:0 0 6px;
  font-size:18px;
}
.lead{
  margin:0 0 18px;
  font-size:15px;
  color:var(--brand-ink-d);
}
label{
  display:block;
  font-weight:700;
  margin:12px 0 6px;
  font-size:14px;
}
input,select,textarea,button{
  width:100%;
  padding:11px 14px;
  border-radius:12px;
  border:1px solid #d9cbb7;
  background:#fff;
  color:var(--brand-ink);
  font:inherit;
}
input::placeholder,textarea::placeholder{color:#9b8f87}
textarea{min-height:110px;resize:vertical;}
.row{display:flex;gap:10px;flex-wrap:wrap;}
.row>*{flex:1;}
.muted{color:var(--brand-ink-d);font-size:13px;}
.tiny{font-size:12px;}

.card{
  background:var(--brand-card);
  border:1px solid var(--brand-border);
  border-radius:18px;
  padding:18px 16px 22px;
  box-shadow:0 8px 22px rgba(0,0,0,.06);
  margin-bottom:16px;
}

button.primary{
  background:var(--brand-purple);
  color:#fff;
  border:0;
  cursor:pointer;
  font-weight:800;
  margin-top:8px;
}
button.primary:hover{filter:brightness(1.05);}
button.secondary{
  background:#fff;
  color:var(--brand-ink);
  border:1px solid var(--brand-border);
  margin-top:8px;
}

.notice{
  display:none;
  margin-top:12px;
  border-radius:12px;
  padding:10px 14px;
  font-weight:600;
  border:1px solid transparent;
  font-size:14px;
}
.notice.ok{display:block;background:#e7f5f1;border-color:#bde6db;color:var(--ok);}
.notice.err{display:block;background:#fdecec;border-color:#f6c4c4;color:var(--err);}

.hidden{display:none !important;}

/* Inloggningsbadge */
.user-badge{
  display:flex;
  align-items:center;
  gap:8px;
  align-self:flex-end;
  margin-bottom:12px;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(27,21,51,.06);
  border:1px solid rgba(27,21,51,.08);
  font-size:12px;
}
.user-avatar{
  width:26px;
  height:26px;
  border-radius:50%;
  background:var(--brand-purple);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:700;
  overflow:hidden;
  background-size:cover;
  background-position:center;
}
.user-label{color:var(--brand-ink-d);}
.user-name{font-weight:700;}

.profile-list{
  margin:0;
  padding:0;
  list-style:none;
  font-size:14px;
}
.profile-list li{
  display:flex;
  justify-content:space-between;
  padding:6px 0;
  border-bottom:1px solid rgba(0,0,0,.04);
}
.profile-label{font-weight:600;color:var(--brand-ink-d);}
.profile-value{font-weight:500;}

.score-line{
  margin:8px 0 6px;
  font-size:14px;
}
.score-bar{
  width:100%;
  height:10px;
  background:#f1e4d5;
  border-radius:999px;
  overflow:hidden;
}
.score-bar-fill{
  height:100%;
  width:0;
  background:var(--brand-purple);
  transition:width .3s ease-out;
}

/* Enkelt stapeldiagram (framtida användning) */
.ratings-graph{
  margin-top:12px;
  font-size:12px;
}
.ratings-graph-row{
  display:flex;
  align-items:center;
  gap:6px;
  margin-bottom:6px;
}
.ratings-graph-label{
  min-width:90px;
  max-width:120px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--brand-ink-d);
}
.ratings-graph-bar{
  flex:1;
  height:8px;
  border-radius:999px;
  background:#f1e4d5;
  overflow:hidden;
}
.ratings-graph-bar-fill{
  height:100%;
  width:0;
  background:var(--brand-purple);
  transition:width .3s ease-out;
}
.ratings-graph-value{
  min-width:38px;
  text-align:right;
  font-variant-numeric:tabular-nums;
}

/* Lista med individuella betyg */
.ratings-list{
  margin-top:14px;
  font-size:13px;
}
.rating-row{
  display:flex;
  align-items:flex-start;
  gap:8px;
  padding:8px 0;
  border-bottom:1px solid rgba(0,0,0,.04);
}
.rating-main{
  flex:1;
}
.rating-stars{
  font-size:14px;
  font-weight:700;
  color:var(--brand-purple);
}
.rating-meta{
  font-size:12px;
  color:var(--brand-ink-d);
  margin-top:2px;
}
.rating-comment-inline{
  font-size:12px;
  font-style:italic;
  color:var(--brand-ink-d);
  margin-left:8px;
  flex:1;
}

/* Profilbild-block */
.profile-avatar-block{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:10px;
}
.profile-avatar-preview{
  width:60px;
  height:60px;
  border-radius:50%;
  background:var(--brand-purple);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  font-size:18px;
  overflow:hidden;
  background-size:cover;
  background-position:center;
}
.profile-avatar-text{
  font-size:12px;
  color:var(--brand-ink-d);
}
.profile-avatar-upload-label{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--brand-border);
  background:#fff;
  cursor:pointer;
  font-size:12px;
  font-weight:600;
}
.profile-avatar-upload-label input{
  display:none;
}

/* Nya illustrationer under "Mitt omdöme" */
.ratings-visuals{
  display:flex;
  gap:16px;
  margin-top:8px;
  flex-wrap:wrap;
}
.ratings-visual-box{
  flex:1;
  min-width:0;
}
.ratings-visual-box h3{
  margin:0 0 4px;
  font-size:13px;
  font-weight:700;
  color:var(--brand-ink-d);
}

.rating-pie{
  width:110px;
  height:110px;
  border-radius:50%;
  margin:4px auto 6px;
  background:#f1e4d5;
  position:relative;
  box-shadow:0 4px 10px rgba(0,0,0,.06);
}
.rating-pie-center-label{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:700;
  color:var(--brand-ink-d);
  text-align:center;
  padding:0 6px;
}
.rating-legend{
  margin-top:4px;
}
.rating-legend-item{
  display:flex;
  align-items:center;
  gap:6px;
  margin-bottom:2px;
}
.rating-legend-color{
  width:10px;
  height:10px;
  border-radius:3px;
}
.rating-legend-label{
  flex:1;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.rating-legend-value{
  font-variant-numeric:tabular-nums;
}

.rating-p-row{
  display:flex;
  gap:6px;
  margin-top:8px;
}
.rating-p{
  font-weight:900;
  font-size:28px;
  color:#d9cbb7;
  line-height:1;
}
.rating-p.full{
  color:var(--brand-purple);
}
.rating-p.half{
  background:linear-gradient(to right, var(--brand-purple) 0 50%, #d9cbb7 50% 100%);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}

/* Tradera-block (lista) */
.tradera-orders{
  margin-top:10px;
  font-size:13px;
}
.tradera-order-row{
  padding:6px 0;
  border-bottom:1px solid rgba(0,0,0,.05);
}
.tradera-order-title{
  font-weight:600;
  color:var(--brand-ink);
  margin-bottom:2px;
}
.tradera-order-meta{
  font-size:12px;
  color:var(--brand-ink-d);
}
.tradera-tag{
  display:inline-block;
  padding:2px 6px;
  border-radius:999px;
  background:#fff;
  border:1px solid var(--brand-border);
  font-size:11px;
  margin-right:4px;
}

@media (max-width:600px){
  .wrap{margin:20px auto 40px;padding:0 12px 32px;}
  h1{font-size:26px;}
  .ratings-visuals{flex-direction:column;}
}
