* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #1a2332;
  --muted: #6b7688;
  --primary: #1f4fd8;
  --primary-dark: #163aa8;
  --accent: #e8a33d;
  --danger: #d33c3c;
  --ok: #2e9e5b;
  --border: #dfe4ee;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(20, 30, 60, 0.08), 0 4px 16px rgba(20, 30, 60, 0.06);
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---- header ---- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.4px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #6a4fd8);
  color: #fff;
  font-size: 13px;
}

.site-nav {
  display: flex;
  gap: 18px;
  font-weight: 600;
  color: var(--muted);
}

.site-nav a {
  color: var(--muted);
}

.site-nav a:hover {
  color: var(--primary);
  text-decoration: none;
}

.site-account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 600;
}

.balance-chip {
  background: #fff7e6;
  color: #a06b00;
  border: 1px solid #f3ddb0;
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 13px;
  font-weight: 700;
}

/* ---- main ---- */
.site-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 16px 64px;
  min-height: 70vh;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 20px;
}

/* ---- shared ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.page-title {
  font-size: 24px;
  margin: 0 0 6px;
}

.page-sub {
  color: var(--muted);
  margin: 0 0 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  transition: background 0.15s;
}

.btn:hover {
  background: var(--primary-dark);
  text-decoration: none;
}

.btn-block {
  width: 100%;
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-ghost {
  background: #eef1f8;
  color: var(--ink);
}

.btn-ghost:hover {
  background: #dfe5f3;
}

.btn-ok {
  background: var(--ok);
}

.btn-ok:hover {
  background: #23804c;
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: #b02f2f;
}

.inline-form {
  display: inline;
  margin: 0;
}

.flash {
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-weight: 600;
}

.flash-error {
  background: #fdeaea;
  color: var(--danger);
  border: 1px solid #f6c6c6;
}

.flash-success {
  background: #e7f6ec;
  color: var(--ok);
  border: 1px solid #bfe6cd;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #5b7ee0, #8a5fe0);
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}

.avatar-img {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
}

.avatar-edit {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.avatar-edit input[type='file'] {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin-top: 8px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
}

.badge {
  display: inline-block;
  border-radius: 6px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 700;
}

.badge-ad {
  background: var(--accent);
  color: #fff;
}

.badge-pro {
  background: var(--primary);
  color: #fff;
}

.badge-free {
  background: #e7eef8;
  color: var(--primary);
}

/* ---- tags ---- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 700;
  background: #eef1f8;
  color: var(--ink);
  white-space: nowrap;
}

.tag-primary {
  background: #e6edfb;
  color: var(--primary);
}

.badge-me {
  background: var(--accent);
  color: #fff;
  margin-left: 8px;
  vertical-align: middle;
}

.btn-hero {
  background: #fff;
  color: var(--primary);
}

.btn-hero:hover {
  background: #eef1f8;
}

.btn-hero-ghost {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.btn-hero-ghost:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* ---- profile hero ---- */
.profile-hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, #2346b8, #5b2fd0 55%, #8a2fc0);
  color: #fff;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.profile-hero-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 200px at 85% -10%, rgba(255, 255, 255, 0.28), transparent 60%),
    radial-gradient(400px 220px at -10% 110%, rgba(255, 255, 255, 0.12), transparent 55%);
  pointer-events: none;
}

.profile-hero-inner {
  position: relative;
  padding: 32px 32px 36px;
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}

.profile-hero-avatar .avatar {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.35), 0 10px 30px rgba(0, 0, 0, 0.25);
}

.profile-hero-avatar .avatar-img {
  border: 4px solid #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.profile-hero-main {
  flex: 1;
  min-width: 240px;
}

.profile-hero-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.profile-hero-tags .tag {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.profile-hero-tags .tag-primary {
  background: #fff;
  color: var(--primary);
}

.profile-hero-name {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.profile-hero-org {
  margin: 6px 0 0;
  font-size: 15px;
  opacity: 0.92;
}

.profile-hero-title {
  opacity: 0.85;
}

.profile-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- profile body ---- */
.profile-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}

.profile-main-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-section {
  padding: 24px;
}

.profile-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.profile-section-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.profile-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.9;
  white-space: pre-wrap;
  color: var(--ink);
}

.profile-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.info-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  background: #f7f9fd;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.info-icon {
  font-size: 20px;
  line-height: 1.3;
}

.info-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 2px;
}

.info-value {
  font-size: 14px;
  font-weight: 700;
}

/* ---- profile side ---- */
.profile-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 80px;
}

.profile-cta {
  padding: 24px;
  text-align: center;
  background: linear-gradient(180deg, #fff, #f6f8ff);
}

.cta-badge {
  display: inline-block;
  background: #e6edfb;
  color: var(--primary);
  font-weight: 800;
  font-size: 12px;
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 14px;
}

.profile-cta h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.profile-cta .btn {
  margin-top: 14px;
}

.profile-share {
  padding: 20px;
}

.profile-share h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.profile-share .btn {
  margin-top: 12px;
}

@media (max-width: 860px) {
  .profile-body {
    grid-template-columns: 1fr;
  }
  .profile-side {
    position: static;
  }
  .profile-info-grid {
    grid-template-columns: 1fr;
  }
  .profile-hero-inner {
    flex-direction: column;
    text-align: center;
  }
  .profile-hero-actions {
    justify-content: center;
  }
}

/* ---- profile list ---- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.filters input,
.filters select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}

.profile-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--ink);
  transition: box-shadow 0.15s, transform 0.15s;
}

.profile-card:hover {
  box-shadow: 0 8px 28px rgba(20, 30, 60, 0.14);
  transform: translateY(-3px);
  text-decoration: none;
}

.profile-card-ad {
  display: flex;
  justify-content: flex-end;
  margin-bottom: -4px;
}

.profile-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-card-name {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.4;
}

.profile-card-meta {
  color: var(--muted);
  font-size: 13px;
}

.profile-card-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-card-desc {
  color: var(--ink);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.profile-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.profile-card-view {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.profile-card-arrow {
  color: var(--primary);
  font-weight: 800;
  transition: transform 0.15s;
}

.profile-card:hover .profile-card-arrow {
  transform: translateX(4px);
}

.ad-card {
  border: 2px solid var(--accent);
  position: relative;
}

.ad-card .badge-ad {
  position: static;
}

/* ---- profile detail ---- */
.profile-detail {
  padding: 28px;
}

.detail-head {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.detail-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
}

.detail-meta {
  color: var(--muted);
  font-size: 14px;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
}

.detail-table th,
.detail-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}

.detail-table th {
  color: var(--muted);
  width: 120px;
  white-space: nowrap;
}

/* ---- forms ---- */
.form-card {
  max-width: 480px;
  margin: 0 auto;
  padding: 28px;
}

.form-row {
  margin-bottom: 16px;
}

.form-row label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

.form-row textarea {
  min-height: 100px;
  resize: vertical;
}

.form-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ---- points ---- */
.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.package {
  padding: 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.package-points {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}

.package-price {
  color: var(--muted);
  font-weight: 600;
}

.package-save {
  color: var(--ok);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

.package.featured {
  border: 2px solid var(--primary);
}

/* ---- chat ---- */
.chat-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  align-items: start;
}

.chat-list {
  padding: 10px;
}

.chat-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  color: var(--ink);
}

.chat-list-item:hover {
  background: #eef1f8;
  text-decoration: none;
}

.chat-list-item.active {
  background: #e6edfb;
}

.chat-window {
  display: flex;
  flex-direction: column;
  min-height: 480px;
}

.chat-window-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 420px;
}

.chat-msg {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg-mine {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg-theirs {
  align-self: flex-start;
  background: #eef1f8;
  border-bottom-left-radius: 4px;
}

.chat-msg-time {
  display: block;
  font-size: 11px;
  opacity: 0.7;
  margin-top: 4px;
}

.chat-input {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.chat-input input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.chat-empty {
  color: var(--muted);
  text-align: center;
  padding: 40px 20px;
}

/* ---- misc ---- */
.row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.grow {
  flex: 1;
}

.muted {
  color: var(--muted);
}

.center {
  text-align: center;
}

.mt-8 {
  margin-top: 8px;
}

.mb-16 {
  margin-bottom: 16px;
}

.breadcrumb {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.industry-select {
  min-width: 200px;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.data th,
table.data td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
}

.amount-plus {
  color: var(--ok);
  font-weight: 700;
}

.amount-minus {
  color: var(--danger);
  font-weight: 700;
}

/* ---- QR code ---- */
.qr-card {
  max-width: 460px;
  margin: 0 auto;
  padding: 28px;
  text-align: center;
}

.qr-card-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 16px;
  text-align: left;
}

.qr-card-row {
  display: flex;
  align-items: center;
  gap: 24px;
  text-align: left;
}

.qr-code-wrap {
  display: inline-flex;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.qr-code-wrap-sm {
  flex-shrink: 0;
}

.qr-code {
  width: 200px;
  height: 200px;
  display: block;
}

.qr-code-wrap-sm .qr-code {
  width: 160px;
  height: 160px;
}

.qr-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.qr-profile-link {
  margin-top: 12px;
  font-size: 12px;
  word-break: break-all;
}

/* ---- scanner ---- */
.scan-box {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px;
  text-align: center;
}

.scan-status {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--muted);
}

.scanner-video {
  width: 100%;
  max-width: 480px;
  border-radius: 12px;
  background: #000;
  display: none;
  margin: 0 auto 14px;
}

.scan-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 14px;
}

.scan-controls input[type='file'] {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  max-width: 240px;
}

.scan-result {
  margin-top: 14px;
}

.scan-result code {
  word-break: break-all;
}

.pay-banner {
  background: linear-gradient(135deg, #1f4fd8, #6a4fd8);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.pay-banner h2 {
  margin: 0;
  font-size: 20px;
}

.pay-banner p {
  margin: 4px 0 0;
  opacity: 0.9;
  font-size: 14px;
}

@media (max-width: 760px) {
  .site-header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 12px;
    gap: 10px;
  }
  .chat-layout {
    grid-template-columns: 1fr;
  }
}
