:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f8fafc;
  --card: #ffffff;
  --danger: #dc2626;
  --success: #059669;
  --warning: #b45309;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); line-height: 1.7;
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.4; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.inline { display: inline; }
.h2 { font-size: 1.4rem; } .h3 { font-size: 1.1rem; }

/* header */
.demo-bar { background: #fef3c7; color: #92400e; text-align: center; font-size: .8rem; padding: 4px 8px; }
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { font-weight: 800; font-size: 1.1rem; color: var(--text); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-mark { background: var(--primary); color: #fff; border-radius: 8px; padding: 2px 7px; font-size: .85rem; }
.header-search { flex: 1; display: flex; max-width: 420px; }
.header-search input { flex: 1; border: 1px solid var(--border); border-radius: 999px 0 0 999px; padding: 8px 14px; font-size: .9rem; min-width: 0; }
.header-search button { border: 0; background: var(--primary); color: #fff; padding: 0 14px; border-radius: 0 999px 999px 0; cursor: pointer; }
.nav-check { position: absolute; opacity: 0; pointer-events: none; }
.nav-burger { display: none; margin-left: auto; cursor: pointer; font-size: 1.4rem; padding: 4px 10px; border-radius: 8px; user-select: none; }
.nav-check:focus-visible + .nav-burger { outline: 2px solid var(--primary); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: .92rem; white-space: nowrap; }
.nav a { color: var(--text); }
.nav-mypage { position: relative; }
.badge-count { background: var(--danger); color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 6px; margin-left: 4px; vertical-align: top; }
.link-button { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
.link-button:hover { color: var(--primary); text-decoration: underline; }

/* buttons */
.btn { display: inline-block; background: var(--primary); color: #fff; border: 1px solid var(--primary); border-radius: 10px; padding: 9px 18px; font-size: .95rem; font-weight: 600; cursor: pointer; text-align: center; font-family: inherit; }
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn-small { padding: 4px 12px; font-size: .82rem; border-radius: 8px; }
.btn-large { padding: 13px 26px; font-size: 1.05rem; }
.btn-block { display: block; width: 100%; margin: 8px 0; }
.btn-outline { background: #fff; color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-light { background: #fff; color: var(--primary); border-color: #fff; }
.btn-light:hover { background: var(--primary-soft); }

/* flash */
.flash { border-radius: 10px; padding: 12px 16px; margin: 0 0 16px; border: 1px solid; white-space: pre-line; }
.flash-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.flash-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.flash-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.flash-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
a.card { color: var(--text); display: block; transition: transform .12s, box-shadow .12s; }
a.card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15, 23, 42, .1); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card-grid .card { margin: 0; }
.service-card { display: flex !important; flex-direction: column; gap: 6px; }
.service-card-top { display: flex; justify-content: space-between; align-items: center; }
.service-title { font-size: 1rem; margin: 4px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.service-summary { color: var(--muted); font-size: .85rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.service-meta { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; }
.seller { display: flex; align-items: center; gap: 6px; }
.service-price { font-weight: 800; font-size: 1.15rem; }
.service-price .muted { font-weight: 400; font-size: .78rem; margin-left: 4px; }
.chip { display: inline-block; background: var(--primary-soft); color: var(--primary-dark); border-radius: 999px; font-size: .75rem; padding: 2px 10px; font-weight: 600; }
.chip-outline { background: #fff; border: 1px solid var(--border); color: var(--muted); }
.chip-active { background: var(--primary); color: #fff; }
.chip-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip-nav a:hover { text-decoration: none; }
.pro-badge { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; border-radius: 6px; font-size: .68rem; font-weight: 800; padding: 1px 6px; letter-spacing: .05em; vertical-align: middle; }
.tag { display: inline-block; border: 1px solid var(--border); border-radius: 6px; padding: 0 8px; font-size: .75rem; margin: 2px 4px 2px 0; color: var(--muted); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; color: #fff; font-weight: 700; flex-shrink: 0; }
.avatar-sm { width: 24px; height: 24px; font-size: .72rem; }
.avatar-lg { width: 88px; height: 88px; font-size: 2rem; }
.stars { color: #f59e0b; letter-spacing: 1px; }

/* home */
.hero { text-align: center; padding: 48px 16px 40px; background: linear-gradient(160deg, #eef2ff, #f0fdfa); border-radius: 20px; margin-bottom: 32px; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 12px; }
.hero-lead { color: #374151; margin: 0 auto 24px; max-width: 680px; }
.hero-compact { padding: 32px 16px; }
.hero-search { display: flex; gap: 8px; max-width: 640px; margin: 0 auto; }
.hero-search input { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; font-size: 1rem; }
.hero-points { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; font-size: .88rem; color: #374151; }
.section { margin: 36px 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-title { font-size: 1.3rem; margin: 0 0 14px; }
.page-title { font-size: 1.6rem; margin: 0 0 16px; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.category-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: .92rem; }
.category-card:hover { border-color: var(--primary); text-decoration: none; }
.category-icon { font-size: 1.5rem; }
.category-icon.big { font-size: 3rem; }
.category-hero { display: flex; gap: 20px; align-items: center; background: var(--primary-soft); border-radius: 16px; padding: 24px; }
.category-hero h1 { margin: 0 0 6px; font-size: 1.6rem; }
.category-hero p { margin: 0; }
.expert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.expert-card { display: flex !important; gap: 14px; align-items: flex-start; margin: 0; }
.expert-card p { margin: 0 0 2px; }
.expert-name { font-weight: 700; }
.article-list { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.article-row { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); flex-wrap: wrap; }
.article-row:last-child { border-bottom: 0; }
.article-row-title { flex: 1; font-weight: 600; min-width: 200px; }
.article-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.article-card { margin: 0; }
.article-card-title { font-size: 1.05rem; margin: 8px 0; }
.cta-band { background: var(--primary); color: #fff; border-radius: 20px; padding: 32px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.cta-band h2 { margin: 0 0 8px; }
.cta-band p { margin: 0; opacity: .9; }
.empty { background: #fff; border: 1px dashed var(--border); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); }

/* detail */
.breadcrumb { font-size: .82rem; color: var(--muted); margin-bottom: 14px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.detail-title { font-size: 1.6rem; margin: 10px 0; }
.detail-summary { font-size: 1.05rem; color: #374151; }
.detail-side { position: sticky; top: 84px; }
.buy-box .price { font-size: 1.8rem; font-weight: 800; margin: 0; }
.trust-list { list-style: none; padding: 0; margin: 12px 0 0; color: #374151; }
.trust-list li { margin: 4px 0; }
.seller-head { display: flex; gap: 12px; align-items: center; color: var(--text); margin: 8px 0; }
.inquiry summary { list-style: none; }
.sales-closed { background: #f5f3ff; border: 1px solid #ddd6fe; color: #5b21b6; border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.inquiry summary::-webkit-details-marker { display: none; }
.inquiry textarea, .report textarea { width: 100%; margin-top: 8px; }
.prose { overflow-wrap: anywhere; }
.prose h2 { font-size: 1.25rem; border-left: 4px solid var(--primary); padding-left: 10px; margin-top: 28px; }
.prose pre { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 10px; overflow-x: auto; }
.prose code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { border-left: 4px solid var(--border); margin: 0; padding-left: 14px; color: var(--muted); }
.prose table { border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--border); padding: 6px 10px; }
.review-list { list-style: none; padding: 0; }
.review { border-bottom: 1px solid var(--border); padding: 12px 0; }
.review p { margin: 6px 0 0; }
.profile-head { display: flex; gap: 20px; align-items: center; }
.profile-head h1 { margin: 0; font-size: 1.5rem; }
.profile-head p { margin: 4px 0; }
.side-services { padding-left: 18px; margin: 0; }
.side-services li { margin: 8px 0; }
.report { margin-top: 20px; }
.report summary { cursor: pointer; }
.pr-box { border: 1px solid var(--border); background: #fafafa; border-radius: var(--radius); padding: 14px; margin: 28px 0; }
.pr-label { font-weight: 700; margin: 0 0 8px; font-size: .9rem; }
.pr-tag { background: #6b7280; color: #fff; font-size: .7rem; border-radius: 4px; padding: 1px 6px; margin-right: 6px; }
.pr-item { margin: 8px 0; overflow-wrap: anywhere; }

/* forms */
.form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 14px; }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=number], .form select, .form textarea,
textarea, .filter-bar input, .filter-bar select {
  display: block; width: 100%; margin-top: 6px; border: 1px solid #d1d5db; border-radius: 10px; padding: 10px 12px; font: inherit; font-weight: 400; background: #fff;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }
.form .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.form .check input { margin-top: 6px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; }
.narrow { max-width: 520px; margin: 0 auto; }
.divider { text-align: center; color: var(--muted); font-size: .85rem; margin: 12px 0; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.filter-bar input, .filter-bar select { width: auto; flex: 1; min-width: 160px; margin: 0; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; font-size: 1.8rem; }
.star-input input { position: absolute; opacity: 0; }
.star-input label { color: #d1d5db; cursor: pointer; margin: 0; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #f59e0b; }
.star-input input:focus-visible + label { outline: 2px solid var(--primary); }

/* dashboard */
.dash-nav { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.dash-nav a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; font-size: .92rem; }
.dash-nav a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.dash-nav a:hover { text-decoration: none; color: var(--primary); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.stat-grid .card { margin: 0; }
.stat p { margin: 0; }
.stat-value { font-size: 1.5rem; font-weight: 800; }
.small-value { font-size: 1.05rem; }
.tip { background: var(--primary-soft); border-color: #c7d2fe; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; }
.steps li { margin-bottom: 8px; }
.notice-list { list-style: none; padding: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.notice-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.notice-list li:last-child { border-bottom: 0; }
.notice-list li.unread a { font-weight: 700; }
.notice-list li.unread::before { content: "●"; color: var(--primary); font-size: .6rem; margin-right: -6px; align-self: center; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { background: #f9fafb; font-weight: 600; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.fee-table .total th, .fee-table .total td { font-weight: 800; font-size: 1.05rem; }
.row-banned td, .row-muted td { opacity: .5; }
.actions { display: flex; gap: 6px; }
.status { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #f3f4f6; color: #374151; white-space: nowrap; }
.status-lg { font-size: .9rem; padding: 4px 14px; }
.status-paid, .status-published { background: #dbeafe; color: #1e40af; }
.status-delivered { background: #fef3c7; color: #92400e; }
.status-completed { background: #d1fae5; color: #065f46; }
.status-cancelled, .status-expired, .status-hidden { background: #f3f4f6; color: #6b7280; }
.status-disputed { background: #fee2e2; color: #991b1b; }
.status-pending_payment, .status-draft { background: #f5f3ff; color: #5b21b6; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; }
.order-terms { margin: 14px 0 6px; text-align: left; }
.order-terms dd { text-align: left; }
.admin-box { border-color: #fca5a5; }

/* messages */
.messages { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; max-height: 65vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 8px; max-width: 85%; }
.msg-mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-mine .msg-body { background: var(--primary); color: #fff; }
.msg-mine .msg-name { display: none; }
.msg-mine .msg-time { text-align: right; }
.msg-body { background: #f3f4f6; border-radius: 14px; padding: 10px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-name { font-size: .78rem; color: var(--muted); margin-bottom: 2px; }
.msg-time { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.msg-system { align-self: center; max-width: 100%; width: 100%; display: block; }
.msg-system .msg-body { background: #fffbeb; border: 1px solid #fde68a; font-size: .88rem; }
.message-form { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.message-form textarea { margin: 0; flex: 1; }
.thread-list { list-style: none; padding: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.thread-list li a { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
.thread-list li:last-child a { border-bottom: 0; }
.thread-body { flex: 1; min-width: 0; }

/* premium */
.price-big { font-size: 2rem; font-weight: 800; margin: 8px 0; }
.plan-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; max-width: 820px; margin: 0 auto 16px; }
.plan ul { padding-left: 18px; }
.plan-featured { border: 2px solid var(--primary); }
.demo-checkout { text-align: center; }

/* misc */
.pagination { display: flex; justify-content: center; gap: 16px; align-items: center; margin: 24px 0; }
.error-page { text-align: center; padding: 60px 0; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--primary); margin: 0; }
.multiline { white-space: pre-line; }
.legal { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 28px; max-width: 860px; margin: 0 auto; }
.site-footer { background: #111827; color: #d1d5db; padding: 40px 0 16px; margin-top: 40px; }
.site-footer a { color: #d1d5db; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.footer-logo { font-weight: 800; color: #fff; margin: 0 0 6px; }
.footer-heading { font-weight: 700; color: #fff; margin: 0 0 8px; }
.footer-links { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.footer-links li { margin: 4px 0; }
.copyright { font-size: .8rem; color: #9ca3af; margin-top: 24px; }

@media (max-width: 860px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-side { position: static; }
  .pc-only { display: none; }
}
/* メニュー項目が多いので、タブレット幅以下はハンバーガーメニューにする */
@media (max-width: 1000px) {
  .nav-burger { display: block; }
  .nav { display: none; }
  .nav-check:checked ~ .nav { display: flex; flex-direction: column; align-items: flex-start; position: absolute; right: 16px; top: calc(100% - 4px); background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; box-shadow: 0 10px 30px rgba(0,0,0,.12); gap: 12px; z-index: 20; }
  .header-search { max-width: none; }
}
@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .header-search { order: 3; flex-basis: 100%; }
  .hero { padding: 32px 16px; }
  .hero-search { flex-direction: column; }
  .cta-band { padding: 24px; }
  .category-hero { flex-direction: column; text-align: center; }
  .msg { max-width: 95%; }
  .message-form { flex-direction: column; align-items: stretch; }
}
