/* auto: global responsive */
@import url("responsive.css");

:root {
  --bg: #f5f5f6;
  --card: #fff;
  --text: #111;
  --sub: #666;
  --border: #e4e4e7;
  --accent: #111;
  --green: #16a34a;
  --red: #dc2626;
  --blue: #2563eb;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

.app {
  --app-max: 430px;
  max-width: var(--app-max);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--card);
  position: relative;
  box-shadow: 0 0 24px rgba(0,0,0,.06);
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 20;
}
.header h1 { font-size: 17px; font-weight: 700; }
.icon-btn {
  min-width: 40px; min-height: 40px;
  border: none; background: transparent;
  font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* Auth */
.auth-wrap {
  padding: 40px 24px 32px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.auth-logo { text-align: center; margin-bottom: 36px; }
.auth-logo h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.auth-logo p { font-size: 13px; color: var(--sub); line-height: 1.6; }

.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #fafafa;
}
.field textarea {
  height: 100px; padding: 12px 14px; resize: vertical;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: #999; background: #fff;
}
.field .req { color: var(--red); }

.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 48px; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary {
  background: #fff; color: var(--text); border: 1px solid var(--border);
}
.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-row .btn { flex: 1; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.hint { font-size: 12px; color: var(--sub); margin-top: 8px; }
.error {
  background: #fef2f2; color: var(--red); border-radius: 8px;
  padding: 10px 12px; font-size: 13px; margin-bottom: 12px;
  display: none;
}
.error.show { display: block; }
.success {
  background: #f0fdf4; color: var(--green); border-radius: 8px;
  padding: 10px 12px; font-size: 13px; margin-bottom: 12px;
  display: none;
}
.success.show { display: block; }

.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--sub); font-size: 12px;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

.auth-footer {
  margin-top: auto; text-align: center; font-size: 13px;
  color: var(--sub); padding-top: 24px;
}
.auth-footer a { color: var(--text); font-weight: 600; text-decoration: underline; }

.role-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.role-item {
  display: flex; align-items: center; gap: 8px;
  padding: 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 13px; cursor: pointer;
}
.role-item input { width: 18px; height: 18px; }

/* Bottom nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  width: 100%;
  max-width: none;
  transform: none;
  display: flex;
  background: #fafafa;
  border-top: 1px solid #e4e4e7;
  box-shadow: 0 -4px 20px rgba(0,0,0,.04);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 30;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 2px; font-size: 10px; color: #a1a1aa; padding: 6px 0;
}
.nav-item.active { color: #111; font-weight: 700; }
.nav-item .ico { font-size: 20px; line-height: 1; }

/* Content */
.pad { padding: 16px 16px 100px; }
.section-label {
  font-size: 12px; color: var(--sub); font-weight: 600;
  margin: 20px 0 8px; text-transform: none;
}

/* Profile */
.profile-head {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 20px 16px 12px;
}
.avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, #ddd, #bbb);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: #fff;
  overflow: hidden;
  position: relative;
}
.avatar img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}
.avatar.sm { width: 48px; height: 48px; font-size: 18px; }
.avatar.lg { width: 96px; height: 96px; font-size: 36px; }
.avatar-edit {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin-bottom: 20px;
}
.avatar-edit .avatar { cursor: pointer; }
.avatar-edit input[type=file] { display: none; }
.avatar-edit .hint { font-size: 12px; color: var(--sub); text-align: center; }
.profile-meta h2 { font-size: 18px; margin-bottom: 4px; }
.profile-meta .role { font-size: 13px; color: var(--sub); }
.profile-meta .loc { font-size: 12px; color: var(--sub); margin-top: 4px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12px; padding: 4px 10px; background: var(--bg);
  border-radius: 6px; color: var(--sub);
}
.tag.accent { background: #fef3c7; color: #92400e; }

.card-block {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; margin-bottom: 12px;
}
.card-block h3 {
  font-size: 13px; color: var(--sub); font-weight: 600; margin-bottom: 8px;
}
.card-block p { font-size: 14px; line-height: 1.6; white-space: pre-wrap; }

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 12px;
}
.stat {
  text-align: center; padding: 12px 8px;
  background: var(--bg); border-radius: 10px;
}
.stat .n { font-size: 20px; font-weight: 700; }
.stat .l { font-size: 11px; color: var(--sub); margin-top: 2px; }

/* QR Exchange */
.qr-box {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 16px;
}
#qrcode {
  padding: 16px; background: #fff; border-radius: 12px;
  border: 1px solid var(--border);
}
#qrcode canvas, #qrcode img { display: block; }
.qr-id {
  margin-top: 12px; font-size: 13px; color: var(--sub);
  word-break: break-all; text-align: center;
}
.scanner-area {
  width: 100%; max-width: 320px; margin: 0 auto 16px;
  border-radius: 12px; overflow: hidden; background: #000;
}
.scanner-area video { width: 100%; display: block; }
.tabs-2 {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.tabs-2 button {
  flex: 1; padding: 12px; border: none; background: transparent;
  font-size: 14px; color: var(--sub); border-bottom: 2px solid transparent;
  cursor: pointer;
}
.tabs-2 button.active {
  color: var(--text); font-weight: 600; border-bottom-color: var(--text);
}
.exchange-list { list-style: none; }
.exchange-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.exchange-list .info { flex: 1; min-width: 0; }
.exchange-list .name { font-weight: 600; font-size: 14px; }
.exchange-list .meta { font-size: 12px; color: var(--sub); }

.empty {
  text-align: center; padding: 40px 16px; color: var(--sub); font-size: 14px;
}

/* List home */
.person {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.person .info { flex: 1; min-width: 0; }
.person .name { font-weight: 600; }
.person .sub { font-size: 12px; color: var(--sub); }

@media (min-width: 500px) {
  body { background: #e4e4e7; padding: 16px 0 24px; }
  .app { border-radius: 16px; min-height: calc(100vh - 40px); }
}

/* Events */
.event-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--card);
}
.event-card .date {
  font-size: 12px;
  color: var(--blue);
  font-weight: 600;
  margin-bottom: 4px;
}
.event-card .title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.event-card .place {
  font-size: 13px;
  color: var(--sub);
  margin-bottom: 8px;
}
.event-card .joined-badge {
  font-size: 11px;
  background: #dcfce7;
  color: var(--green);
  padding: 2px 8px;
  border-radius: 4px;
}

.event-map {
  position: relative;
  height: 200px;
  background: #e8ebe8;
  border-radius: 12px;
  overflow: hidden;
  margin: 12px 0;
  border: 1px solid var(--border);
}
.event-map .pin {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: 700;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 4px 6px;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.event-map .pin.user {
  border-color: var(--green);
  background: #f0fdf4;
}

.radar-status-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.radar-status-btns button {
  flex: 1 1 40%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  padding: 8px;
}
.radar-status-btns button.active-ok { border-color: var(--green); background: #f0fdf4; }
.radar-status-btns button.active-ng { border-color: var(--red); background: #fef2f2; }
.radar-status-btns button.active-rest { border-color: #ea580c; background: #fff7ed; }
.radar-status-btns button.active-shop { border-color: var(--blue); background: #eff6ff; }
.radar-status-btns button.active-mute { border-color: #999; background: #f4f4f5; }
.radar-status-btns button.active-afternoon { border-color: #7c3aed; background: #f5f3ff; }

.status-pill {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.status-pill.ok { background: #dcfce7; color: var(--green); }
.status-pill.ng { background: #fee2e2; color: var(--red); }
.status-pill.rest { background: #ffedd5; color: #c2410c; }
.status-pill.shop { background: #dbeafe; color: var(--blue); }
.status-pill.mute { background: #f4f4f5; color: #666; }
.status-pill.afternoon { background: #ede9fe; color: #6d28d9; }

/* ===== Profile enrichment & charts ===== */
.score-bars { display: flex; flex-direction: column; gap: 10px; }
.score-row { display: grid; grid-template-columns: 72px 1fr 36px; align-items: center; gap: 8px; }
.score-row .label { font-size: 12px; color: var(--sub); }
.score-row .bar-track {
  height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden;
}
.score-row .bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #333, #111);
  transition: width .4s ease;
}
.score-row .bar-fill.trust { background: linear-gradient(90deg, #2563eb, #1d4ed8); }
.score-row .bar-fill.activity { background: linear-gradient(90deg, #16a34a, #15803d); }
.score-row .val { font-size: 13px; font-weight: 700; text-align: right; }

.growth-block { margin-top: 4px; }
.growth-block .g-label { font-size: 12px; margin-bottom: 4px; color: var(--sub); }
.growth-bar {
  height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; margin-bottom: 10px;
}
.growth-bar > div {
  height: 100%; background: #a1a1aa; border-radius: 999px;
}

.radar-wrap {
  display: flex; justify-content: center; padding: 8px 0 4px;
}
.radar-wrap svg { max-width: 200px; width: 100%; height: auto; }

.profile-section { margin-bottom: 16px; }
.profile-section h3 {
  font-size: 13px; color: var(--sub); font-weight: 600; margin-bottom: 8px;
}
.kv-list { font-size: 14px; }
.kv-list .kv { display: flex; gap: 8px; margin-bottom: 6px; }
.kv-list .k { color: var(--sub); min-width: 88px; flex-shrink: 0; font-size: 13px; }
.kv-list .v { flex: 1; word-break: break-word; }

.sns-links { display: flex; flex-wrap: wrap; gap: 8px; }
.sns-links a {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; background: #fafafa;
}
.sns-links a:hover { background: var(--bg); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: var(--bg); color: var(--sub);
}
.chip.accent { background: #fef3c7; color: #92400e; }
.chip.role { background: #e0e7ff; color: #3730a3; }

/* Edit form helpers */
.range-row { display: grid; grid-template-columns: 1fr 48px; gap: 8px; align-items: center; margin-bottom: 10px; }
.range-row input[type=range] { width: 100%; }
.range-row .rv { font-weight: 700; text-align: right; }
.sub-fieldset {
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px;
}
.sub-fieldset legend {
  font-size: 13px; font-weight: 600; padding: 0 6px; color: var(--sub);
}
.role-panel { display: none; }
.role-panel.show { display: block; }

/* ===== Responsive / PC ===== */
@media (min-width: 500px) {
  body {
    background: #e4e4e7;
    background-image:
      radial-gradient(ellipse 80% 50% at 50% -20%, #d4d4d8 0%, transparent 60%);
  }
}

@media (min-width: 640px) {
  .app {
    --app-max: 560px;
    max-width: var(--app-max);
    box-shadow: 0 8px 40px rgba(0,0,0,.08);
  }
  .bottom-nav { max-width: var(--app-max); }
  .profile-head { padding: 24px 20px 16px; }
  .avatar { width: 88px; height: 88px; font-size: 32px; }
  .stats { gap: 12px; }
  .pad { padding-left: 20px; padding-right: 20px; }
  .header h1 { font-size: 18px; }
  .nav-item { font-size: 11px; }
  .nav-item .ico { font-size: 22px; }
}

@media (min-width: 900px) {
  body {
    background: #e4e4e7;
    padding: 28px 16px 40px;
  }
  .app {
    --app-max: 920px;
    max-width: var(--app-max);
    margin: 0 auto 28px;
    min-height: calc(100vh - 56px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0,0,0,.1);
  }
  .bottom-nav {
    max-width: var(--app-max);
    border-radius: 0 0 20px 20px;
    padding-top: 8px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
  .header {
    border-radius: 20px 20px 0 0;
    padding: 14px 24px;
  }
  .header h1 { font-size: 19px; }
  .pad {
    padding: 20px 28px 110px;
  }

  /* 2カラム系 */
  .profile-grid,
  .form-grid,
  .pc-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
  }
  .profile-grid .span-2,
  .form-grid .span-2,
  .pc-grid-2 .span-2 { grid-column: 1 / -1; }

  /* イベント・投稿カードを横並び */
  #list:has(.event-card),
  #postFeed:has(.post-card) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  #list .event-card,
  #postFeed .post-card {
    margin-bottom: 0;
    height: 100%;
  }

  /* ホームのボタン群 */
  .pad > div[style*="flex-wrap"] {
    gap: 10px !important;
  }

  /* プロフィール詳細は .profile-dash 側で制御 */

  /* フォーム */
  .field input,
  .field textarea,
  .field select {
    height: 46px;
  }
  .field textarea { height: 110px; }
  .btn {
    transition: transform .08s ease, opacity .15s;
  }
  .btn:hover { opacity: .92; }
  .btn:active { transform: scale(0.98); }

  /* 名刺・一覧 */
  .exchange-list li {
    padding: 12px 4px;
  }

  /* レーダーマップ少し大きく */
  .grid-map,
  .event-map {
    max-height: none;
  }

  /* 認証画面 */
  .auth-wrap {
    max-width: 420px;
    margin: 0 auto;
    padding-top: 48px;
  }
}

@media (min-width: 1200px) {
  .app {
    --app-max: 1080px;
    max-width: var(--app-max);
  }
  .bottom-nav { max-width: var(--app-max); }
  .pad { padding-left: 32px; padding-right: 32px; }

  #list:has(.event-card) {
    grid-template-columns: 1fr 1fr 1fr;
  }
  #postFeed:has(.post-card) {
    grid-template-columns: 1fr 1fr 1fr;
  }

  /* 3カラム補助 */
  .pc-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
  }
}

/* マウス環境でのフォーカス */
@media (hover: hover) and (pointer: fine) {
  .event-card:hover,
  .post-card:hover {
    border-color: #c4c4c8;
    box-shadow: 0 4px 16px rgba(0,0,0,.06);
  }
  .nav-item:hover { color: var(--text); }
  a.btn:hover,
  button.btn:hover {
    filter: brightness(1.03);
  }
}

/* Posts */
.post-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  background: #fff;
}
.post-card .thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #eee;
  overflow: hidden;
}
.post-card .thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.post-card .meta {
  padding: 10px 12px 12px;
}
.post-card .meta .title {
  font-weight: 700; font-size: 15px; margin-bottom: 4px;
}
.post-card .meta .sub {
  font-size: 12px; color: var(--sub);
}

.nsfw-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #111;
}
.nsfw-wrap img {
  width: 100%; display: block;
  transition: filter .2s;
}
.nsfw-wrap.blurred img {
  filter: blur(28px);
  transform: scale(1.08);
}
.nsfw-btn {
  position: absolute;
  right: 10px; bottom: 10px;
  z-index: 2;
  border: none;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.nsfw-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: #fee2e2;
  color: #b91c1c;
  margin-right: 6px;
}
.status-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #fef3c7;
  color: #92400e;
}
.img-pick-row {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
}
.img-pick-row .prev {
  width: 72px; height: 72px; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--border);
}
.subject-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.subject-chips .chip {
  background: #e0e7ff; color: #3730a3; padding: 4px 10px; border-radius: 999px; font-size: 12px;
}
.subject-chips .chip button {
  border: none; background: transparent; margin-left: 4px; cursor: pointer; color: #3730a3;
}


/* ===== Stylish profile + PC dashboard ===== */
.profile-hero {
  position: relative;
  margin-bottom: 8px;
}
.profile-cover {
  height: 180px;
  background:
    radial-gradient(ellipse 80% 120% at 20% 0%, rgba(99,102,241,.45), transparent 55%),
    radial-gradient(ellipse 70% 100% at 90% 20%, rgba(16,185,129,.3), transparent 50%),
    linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #0f766e 100%);
  overflow: hidden;
  position: relative;
}
.profile-cover img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.profile-cover::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(15,23,42,.55) 0%, transparent 50%);
}
.profile-hero-body {
  padding: 0 16px;
  margin-top: -52px;
  position: relative;
  z-index: 2;
  display: flex;
  gap: 14px;
  align-items: flex-end;
}
.profile-hero .avatar {
  width: 100px; height: 100px; font-size: 38px;
  border: 3px solid #fff;
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
  background: #e4e4e7;
  flex-shrink: 0;
}
.profile-hero-meta {
  flex: 1; min-width: 0; padding-bottom: 6px;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,.35);
}
.profile-hero-meta h2 {
  font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
  line-height: 1.2; margin: 0 0 4px; color: #fff;
}
.profile-hero-meta .role {
  font-size: 13px; color: rgba(255,255,255,.88); font-weight: 500;
}
.profile-hero-meta .loc,
.profile-hero-meta .hint {
  font-size: 12px; color: rgba(255,255,255,.75); margin-top: 2px;
}
.profile-badges {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.profile-badge {
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  background: #111; color: #fff;
  text-shadow: none;
}
.profile-badge.soft {
  background: rgba(255,255,255,.92); color: #1e293b;
}
.profile-badge.live {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
}
.profile-gallery {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 12px 16px 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.profile-gallery::-webkit-scrollbar { height: 0; }
.profile-gallery .g-item {
  flex: 0 0 40%;
  aspect-ratio: 3/4;
  border-radius: 16px;
  overflow: hidden;
  background: #eee;
  scroll-snap-align: start;
  box-shadow: 0 8px 20px rgba(0,0,0,.1);
  border: 1px solid rgba(0,0,0,.04);
}
.profile-gallery .g-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.profile-gallery.empty-hint { display: none; }

.stats.modern {
  margin: 8px 16px 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  box-shadow: 0 4px 16px rgba(0,0,0,.04);
}
.stats.modern .stat {
  flex: 1;
  border: none;
  padding: 14px 8px;
  text-align: center;
}
.stats.modern .stat + .stat {
  border-left: 1px solid var(--border);
}
.stats.modern .n { font-size: 22px; font-weight: 800; }
.stats.modern .l { font-size: 11px; color: var(--sub); margin-top: 2px; }

.profile-section {
  margin: 12px 16px;
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,.03);
}
.profile-section h3 {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sub);
  margin-bottom: 10px;
  font-weight: 700;
}
.profile-actions {
  display: flex; flex-direction: column; gap: 8px;
  margin: 12px 16px 0;
}
.profile-actions .btn { margin: 0; }

.gallery-edit-row {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
}
.gallery-edit-row .g-thumb {
  width: 72px; height: 72px; border-radius: 10px; overflow: hidden;
  position: relative; background: #eee;
}
.gallery-edit-row .g-thumb img { width:100%; height:100%; object-fit:cover; }
.gallery-edit-row .g-thumb button {
  position: absolute; top: 2px; right: 2px;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.65); color: #fff;
  font-size: 12px; cursor: pointer;
}

/* Dashboard shell (mobile = single column) */
.profile-dash {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 8px;
}
.profile-dash-main,
.profile-dash-side,
.profile-dash-wide {
  min-width: 0;
}
.profile-dash .pad {
  padding-top: 4px;
}

@media (min-width: 900px) {
  .profile-hero { margin-bottom: 0; }
  .profile-cover { height: 220px; }
  .profile-hero-body {
    padding: 0 28px;
    margin-top: -60px;
  }
  .profile-hero .avatar {
    width: 120px; height: 120px; font-size: 44px;
    border-width: 4px;
  }
  .profile-hero-meta h2 { font-size: 28px; }
  .profile-hero-meta .role { font-size: 14px; }

  .profile-dash {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    grid-template-areas:
      "hero hero"
      "main side"
      "wide wide";
    gap: 16px 20px;
    padding: 0 8px 24px;
    align-items: start;
  }
  .profile-dash-hero { grid-area: hero; }
  .profile-dash-main { grid-area: main; }
  .profile-dash-side { grid-area: side; padding-top: 4px; }
  .profile-dash-wide { grid-area: wide; }

  .profile-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow: visible;
    padding: 12px 16px;
    gap: 12px;
  }
  .profile-gallery .g-item {
    flex: none;
    width: 100%;
  }

  .stats.modern {
    margin: 0 0 12px;
  }
  .profile-actions {
    flex-direction: row;
    flex-wrap: wrap;
    margin: 0 0 12px;
  }
  .profile-actions .btn {
    flex: 1 1 calc(50% - 6px);
    width: auto;
  }
  .profile-section {
    margin: 0 0 12px;
  }
  .profile-dash-side .profile-section:last-child {
    margin-bottom: 0;
  }

  .profile-dash-wide .section-label {
    margin-top: 4px;
  }
  .profile-dash-wide #userPosts,
  .profile-dash-wide #joinedEvents {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .profile-dash-wide #userPosts .post-card,
  .profile-dash-wide #joinedEvents .event-card {
    margin-bottom: 0;
  }

  /* score + radar side by side on PC side column is stacked; put radar larger */
  #radarWrap svg { max-width: 100%; }
}

@media (min-width: 1200px) {
  .profile-dash {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 20px 24px;
    padding: 0 12px 28px;
  }
  .profile-cover { height: 240px; }
  .profile-gallery {
    grid-template-columns: repeat(4, 1fr);
  }
  .profile-dash-wide #userPosts,
  .profile-dash-wide #joinedEvents {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .profile-actions .btn {
    flex: 1 1 calc(33.33% - 8px);
  }
}



/* Shell pages: bottom tab bar retired in favor of drawer */
.app.sc-shell .bottom-nav { display: none !important; }
