:root{
  --paper: #f6f1e7;
  --paper-deep: #efe3d4;
  --ink: #2c2a26;
  --muted: #6a6157;
  --accent: #b86c2f;
  --accent-soft: #f0d7bf;
  --line: rgba(56,46,36,0.14);
  --shadow: 0 18px 40px rgba(56,46,36,.18);
  --radius: 18px;
  --max: 1100px;
  --safe-area-inset-bottom: env(safe-area-inset-bottom);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: "Noto Sans JP", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, var(--paper), var(--paper-deep)),
    repeating-linear-gradient(0deg, rgba(56,46,36,.03) 0 1px, transparent 1px 20px);
  overflow-x:hidden;
}

a{color: inherit}
.mag{
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 18px 140px;
}

.cover-block{
  background:#fffaf3;
  border:1px solid var(--line);
  border-radius: calc(var(--radius) + 8px);
  box-shadow: var(--shadow);
  padding: 22px;
}
.cover-grid{
  display:grid;
  grid-template-columns: 1.15fr .85fr;
  gap:20px;
  align-items:stretch;
}
.brand-row{
  display:flex;
  align-items:center;
  gap:12px;
}
.brand-avatar{
  width:44px;
  height:44px;
  border-radius:12px;
  border:1px solid var(--line);
  object-fit:cover;
}
.brand-title{margin:0; font-weight:800;}
.brand-sub{margin:2px 0 0; font-size:12px; color: var(--muted);}
.cover-label{
  margin:10px 0 0;
  font-size:12px;
  letter-spacing:.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.cover-lead{
  margin:0 0 16px;
  color: var(--muted);
  font-size:14.5px;
  line-height:1.7;
}
.cover-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.tagline{
  margin-top: 14px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.tagline span{
  background: var(--accent-soft);
  color: var(--accent);
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
}

.cover-right{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.profile-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding:16px;
  box-shadow: var(--shadow);
}
.profile-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.profile-label{margin:0; font-size:12px; color: var(--muted);}
.profile-name{margin:4px 0 0; font-weight:700;}
.profile-photo{
  width:54px;
  height:54px;
  border-radius:14px;
  border:1px solid var(--line);
  object-fit:cover;
}
.profile-card ul{
  margin:8px 0 0;
  padding-left:18px;
  color: var(--muted);
  font-size:12.5px;
  line-height:1.6;
}
.profile-note{margin:8px 0 0; font-size:12px; color: var(--muted);}
.note-card{
  background:#fffdf7;
  border:1px dashed var(--line);
  border-radius:14px;
  padding:14px;
  color: var(--muted);
}

.stripe{
  margin-top:20px;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:12px;
}
.stripe div{
  background:#fffdf7;
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px 14px;
}
.stripe-title{margin:0 0 4px; font-size:12px; color: var(--accent);}
.stripe-text{margin:0; color: var(--muted); font-size:12.5px;}

.split-panel{
  margin-top:22px;
  display:grid;
  grid-template-columns: 1.05fr .95fr;
  gap:20px;
  background:#fffdf7;
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding:18px;
}
.panel-left h2{margin:0 0 6px; font-size:20px;}
.panel-left p{margin:0; color: var(--muted); font-size:13.5px; line-height:1.6;}
.route-list{margin:12px 0 0; padding-left:18px; color: var(--muted); font-size:13px; line-height:1.7;}
.route-list strong{color: var(--ink);}
.route-steps{display:grid; gap:10px;}
.route-steps div{
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
  text-align:center;
  font-weight:700;
}
.route-caption{margin-top:10px; font-size:12.5px; color: var(--muted);}

.grid-panel{
  margin-top:22px;
  background:#fffdf7;
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding:18px;
}
.panel-head h2{margin:0 0 6px; font-size:20px;}
.panel-head p{margin:0; color: var(--muted); font-size:13.5px; line-height:1.6;}
.card-grid{
  margin-top:14px;
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:14px;
}
.media-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
}
.media-card img{width:100%; height:200px; object-fit:cover; border-bottom:1px solid var(--line);}
.media-card div{padding:14px;}
.media-card h3{margin:0 0 6px; font-size:16px;}
.media-card p{margin:0; color: var(--muted); font-size:13px; line-height:1.6;}

.log-grid{
  margin-top:12px;
  display:grid;
  gap:10px;
}
.log-grid div{
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
}
.log-grid span{display:block; font-weight:700; margin-bottom:4px;}
.log-grid p{margin:0; color: var(--muted); font-size:12.5px;}
.log-paper{
  background:#fffef9;
  border:1px dashed var(--line);
  border-radius:14px;
  padding:16px;
}
.log-title{margin:0 0 8px; font-weight:700;}
.log-paper ul{margin:0; padding-left:18px; color: var(--muted); font-size:12.5px; line-height:1.6;}

.glossary-grid{
  margin-top:12px;
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:10px;
}
.glossary-grid div{
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:12.5px;
  color: var(--muted);
}
.glossary-grid strong{color: var(--ink); font-size:13px;}

.faq-list{
  margin-top:12px;
  display:grid;
  gap:10px;
}
.faq-list details{
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 12px;
}
.faq-list summary{cursor:pointer; font-weight:700;}
.faq-list p{margin:8px 0 0; color: var(--muted); font-size:12.5px;}

.diagnose-grid{
  margin-top:12px;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:12px;
}
.diagnose-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px;
  padding:14px;
}
.diagnose-card h3{margin:0 0 6px; font-size:15px;}
.diagnose-card ul,
.diagnose-card ol{
  margin:8px 0 0;
  padding-left:18px;
  color: var(--muted);
  font-size:12.5px;
  line-height:1.6;
}
.diagnose-card p{margin:8px 0 0; color: var(--muted); font-size:12.5px; line-height:1.6;}
.diagnose-note{font-size:12px;}

.notice{
  margin-top:22px;
  padding:16px;
  border-radius:14px;
  background:#fff1e4;
  border:1px solid #eac7a5;
  color:#7a4b1c;
}
.notice h3{margin:0 0 6px; font-size:15px;}
.notice p{margin:0; font-size:12.5px; line-height:1.7;}

.entry{
  margin-top:22px;
  background:#fffdf7;
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding:18px;
}
.entry-list{margin-top:12px; display:grid; gap:10px;}
.entry-item{
  display:flex;
  align-items:flex-start;
  gap:10px;
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
  background:#fff;
}
.entry-item input{width:18px; height:18px; margin-top:4px; accent-color: var(--accent);}
.entry-item strong{display:block; font-size:14px;}
.entry-item small{display:block; color: var(--muted); margin-top:4px; font-size:12px;}
.entry-cta{margin-top:14px; display:flex; flex-direction:column; gap:8px;}
.entry-note{margin:0; color: var(--muted); font-size:12px;}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:12px 16px;
  border-radius:14px;
  text-decoration:none;
  font-weight:700;
  font-size:14px;
  border:1px solid var(--line);
  cursor:pointer;
}
.btn.accent{
  background: linear-gradient(135deg, var(--accent), #e2a162);
  color:#fff;
  border:none;
  box-shadow: var(--shadow);
}
.btn.outline{
  color: var(--accent);
  background: transparent;
}
.btn-icon{
  width:20px;
  height:20px;
  border-radius:6px;
  background: rgba(255,255,255,.4);
  padding:2px;
}

.footer{
  margin-top:22px;
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:10px;
  color: var(--muted);
  font-size:12.5px;
}
.footer-links{display:flex; gap:12px; flex-wrap:wrap;}
.footer-links a{text-decoration:none; color: var(--muted);}
.footer-links a:hover{color: var(--accent);}

.floating-cta{
  position: fixed;
  right:18px;
  bottom: calc(18px + var(--safe-area-inset-bottom));
  z-index: 60;
}

#notification-toast{
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  background:#fffdf6;
  border:1px solid var(--line);
  color: var(--ink);
  padding:10px 14px;
  border-radius:999px;
  font-size:12px;
  opacity:0;
  pointer-events:none;
  transition: opacity .2s ease;
  z-index:60;
  max-width:92vw;
  white-space:nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}
#notification-toast.show{opacity:1}

.legal-document-modal-overlay{
  display:none;
  position: fixed;
  inset:0;
  background: rgba(30,25,18,.65);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.legal-document-modal-overlay.active{display:flex;}
.legal-document-modal-container{
  background:#fffdf7;
  border-radius: var(--radius);
  border:1px solid var(--line);
  width:100%;
  max-width:720px;
  max-height:85vh;
  overflow-y:auto;
  box-shadow: var(--shadow);
  padding:22px;
}
.legal-document-modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
  padding-bottom:12px;
  margin-bottom:12px;
}
.legal-document-modal-title{
  margin:0;
  font-size:18px;
  font-weight:800;
  color: var(--accent);
}
.legal-document-modal-close-button{
  background: rgba(0,0,0,.05);
  border:1px solid var(--line);
  border-radius:10px;
  width:32px;
  height:32px;
  cursor:pointer;
  color: var(--muted);
  font-size:18px;
}
.legal-document-modal-close-button:hover{color: var(--ink);}
.legal-document-modal-content{
  color: var(--muted);
  font-size:14px;
  line-height:1.7;
}
.legal-document-modal-content h2,
.legal-document-modal-content h3{color: var(--ink);}
.legal-document-modal-content ul{padding-left: 20px;}

@media (max-width: 980px){
  .cover-grid{grid-template-columns: 1fr;}
  .stripe{grid-template-columns: 1fr;}
  .split-panel{grid-template-columns: 1fr;}
  .card-grid{grid-template-columns: 1fr;}
  .glossary-grid{grid-template-columns: 1fr;}
  .diagnose-grid{grid-template-columns: 1fr;}
}

@media (max-width: 600px){
  .mag{padding: 16px 14px 140px;}
  .floating-cta{left:14px; right:14px;}
  .floating-cta .btn{width:100%;}
}
