/* =========================================================
 *  BOT HUB - 共通スタイル
 *  紙 × インク のシンプルなデザイン
 * ========================================================= */
:root {
  --paper: #f3efe6;
  --paper-2: #ebe5d8;
  --white: #fffdf8;
  --ink: #1d1b18;
  --ink-2: #4a463f;
  --muted: #7b7468;
  --line: #1d1b18;
  --soft-line: #d6cfc1;
  --blurple: #5865f2;
  --yellow: #ffd84d;
  --red: #d9483b;
  --green: #2f8f5b;
  --font: "Zen Kaku Gothic New", "Hiragino Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Menlo", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: anywhere;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
code { font-family: var(--mono); font-size: .85em; background: var(--paper-2); padding: .1em .4em; border-radius: 4px; }

.container { width: min(1040px, calc(100% - 40px)); margin: 0 auto; }
.marker { background: linear-gradient(transparent 60%, var(--yellow) 60%); padding: 0 .1em; }

/* ===== buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .7em 1.3em; font: 700 .95rem var(--font); text-decoration: none;
  color: var(--ink); background: var(--white);
  border: 2px solid var(--line); border-radius: 8px; cursor: pointer;
  box-shadow: 3px 3px 0 var(--line);
  transition: transform .12s, box-shadow .12s;
}
@media (hover: hover) {
  .btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line); }
}
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--line); }
.btn-primary { background: var(--blurple); color: #fff; }
.btn-yellow { background: var(--yellow); }
.btn-sm { padding: .45em .9em; font-size: .85rem; box-shadow: 2px 2px 0 var(--line); }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* ===== header ===== */
.header { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 2px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 2rem; height: 64px; }
.logo { display: flex; align-items: center; gap: .55rem; font: 900 1.15rem var(--font); text-decoration: none; letter-spacing: .02em; }
.logo-mark { width: 28px; height: 28px; border: 2px solid var(--line); border-radius: 6px; background: var(--blurple); display: grid; place-items: center; }
.logo-mark svg { width: 16px; height: 16px; fill: #fff; }
.nav { display: flex; gap: 1.6rem; margin-left: auto; font-size: .92rem; font-weight: 500; }
.nav a { text-decoration: none; padding: .2em 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.current { border-bottom-color: var(--ink); }
.menu-toggle { display: none; margin-left: auto; min-width: 64px; min-height: 40px; background: var(--white); color: var(--ink); border: 2px solid var(--line); border-radius: 6px; padding: .3rem .7rem; font: 700 .8rem var(--font); cursor: pointer; }
.menu-toggle[aria-expanded="true"] { background: var(--ink); color: var(--white); }

/* ===== section ===== */
.section { padding: 4.5rem 0 0; }
.section-title { display: flex; align-items: baseline; gap: .8rem; margin-bottom: 1.6rem; padding-bottom: .6rem; border-bottom: 2px solid var(--line); }
.section-title h2 { font-size: 1.5rem; font-weight: 900; }
.section-title span { font: 500 .8rem var(--mono); color: var(--muted); }

/* ===== hero ===== */
.hero { padding: 4rem 0 0; display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: start; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); font-weight: 900; line-height: 1.35; letter-spacing: -.01em; }
.hero p { margin-top: 1.2rem; color: var(--ink-2); max-width: 32em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }

.news { background: var(--white); border: 2px solid var(--line); border-radius: 10px; box-shadow: 5px 5px 0 var(--line); }
.news h2 { font-size: .95rem; padding: .7rem 1rem; border-bottom: 2px solid var(--line); display: flex; justify-content: space-between; }
.news h2 small { font: 500 .75rem var(--mono); color: var(--muted); }
.news ul { list-style: none; }
.news li { padding: .8rem 1rem; border-bottom: 1px dashed var(--soft-line); font-size: .9rem; }
.news li:last-child { border-bottom: none; }
.news time { display: block; font: 500 .75rem var(--mono); color: var(--muted); }

/* ===== bot list ===== */
.bot-list { display: grid; gap: 1.4rem; }
.bot {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 1.4rem; align-items: start;
  padding: 1.4rem; background: var(--white); border: 2px solid var(--line); border-radius: 12px;
  box-shadow: 5px 5px 0 var(--line);
}
.bot-icon { width: 96px; height: 96px; border: 2px solid var(--line); border-radius: 12px; object-fit: cover; background: var(--paper-2); display: grid; place-items: center; font: 900 2rem var(--font); color: var(--muted); }
.bot-head { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.bot-head h3 { font-size: 1.3rem; font-weight: 900; }
.status { font-size: .75rem; font-weight: 700; padding: .05rem .55rem; border: 1.5px solid currentColor; border-radius: 4px; }
.status.live { color: var(--green); }
.status.dev { color: var(--muted); }
.bot-desc { margin-top: .4rem; color: var(--ink-2); font-size: .95rem; }
.bot-cmds { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.bot-cmds code { background: var(--paper); border: 1px solid var(--soft-line); }
.bot-actions { display: flex; flex-direction: column; gap: .6rem; min-width: 150px; }
.bot.dev { background: transparent; border-style: dashed; box-shadow: none; }

/* ===== faq ===== */
.faq { display: grid; gap: .8rem; }
.faq details { background: var(--white); border: 2px solid var(--line); border-radius: 10px; }
.faq summary { cursor: pointer; padding: .9rem 1.1rem; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 700 1.1rem var(--mono); }
.faq details[open] summary::after { content: "−"; }
.faq details[open] summary { border-bottom: 1px dashed var(--soft-line); }
.faq .answer { padding: .9rem 1.1rem 1.1rem; color: var(--ink-2); font-size: .93rem; }

/* ===== contact band ===== */
.contact-band { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; padding: 1.6rem 1.8rem; background: var(--yellow); border: 2px solid var(--line); border-radius: 12px; box-shadow: 5px 5px 0 var(--line); }
.contact-band h2 { font-size: 1.25rem; font-weight: 900; }
.contact-band p { font-size: .92rem; color: var(--ink-2); }

/* ===== footer ===== */
.footer { margin-top: 5rem; border-top: 2px solid var(--line); padding: 1.8rem 0 2.4rem; font-size: .88rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer nav { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.footer nav a { text-decoration: none; }
.footer nav a:hover { text-decoration: underline; }
.footer small { color: var(--muted); font-family: var(--mono); }

/* =========================================================
 *  お問い合わせフォーム
 * ========================================================= */
.form-page { padding-top: 3.5rem; max-width: 760px; }
.form-page h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 900; }
.form-intro { margin-top: .8rem; color: var(--ink-2); }
.notes { margin: 1.4rem 0 2rem; padding: 1rem 1.2rem 1rem 2.4rem; background: var(--paper-2); border-radius: 8px; font-size: .9rem; color: var(--ink-2); }
.notes li + li { margin-top: .3rem; }

.form-card { background: var(--white); border: 2px solid var(--line); border-radius: 12px; box-shadow: 6px 6px 0 var(--line); padding: clamp(1.3rem, 4vw, 2.2rem); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem 1rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field.full { grid-column: 1 / -1; }
.field > label, .field > .label { font-size: .9rem; font-weight: 700; display: flex; align-items: center; gap: .4rem; }
.req, .opt { font-size: .68rem; font-weight: 700; padding: 0 .4rem; border-radius: 3px; }
.req { background: var(--red); color: #fff; }
.opt { border: 1px solid var(--soft-line); color: var(--muted); }
.hint { color: var(--muted); font-size: .8rem; }

.input, .select, .textarea {
  width: 100%; padding: .7rem .85rem; font: 500 1rem var(--font); color: var(--ink);
  background: var(--white); border: 2px solid var(--line); border-radius: 6px; outline: none;
  transition: box-shadow .12s;
}
.input::placeholder, .textarea::placeholder { color: #b0a898; }
.input:focus, .select:focus, .textarea:focus { box-shadow: 3px 3px 0 var(--blurple); }
.select { appearance: none; cursor: pointer; padding-right: 2.4rem; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d1b18' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .8rem center / 16px; }
.textarea { min-height: 170px; resize: vertical; line-height: 1.7; }
.counter { align-self: flex-end; font: 500 .75rem var(--mono); color: var(--muted); }

.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border-color: var(--red); background: #fff5f3; }
.err-msg { display: none; color: var(--red); font-size: .8rem; font-weight: 700; }
.field.invalid .err-msg { display: block; }

/* 種別ラジオ */
.type-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.type-opt input { position: absolute; opacity: 0; pointer-events: none; }
.type-opt label {
  display: inline-block; padding: .5rem 1rem; font-size: .9rem; font-weight: 700; cursor: pointer;
  background: var(--white); border: 2px solid var(--line); border-radius: 999px; transition: background .12s;
}
.type-opt label:hover { background: var(--paper); }
.type-opt input:checked + label { background: var(--ink); color: var(--white); }
.type-opt input:focus-visible + label { outline: 3px solid var(--blurple); outline-offset: 2px; }

/* サーバー情報ブロック */
.server-block { grid-column: 1 / -1; display: none; grid-template-columns: 1fr 1fr; gap: 1.2rem 1rem; padding: 1.2rem; background: var(--paper); border: 2px dashed var(--line); border-radius: 8px; }
.server-block.show { display: grid; }
.server-block .block-title { grid-column: 1 / -1; font-weight: 900; font-size: .95rem; }

/* チェックボックス */
.check { display: flex; align-items: flex-start; gap: .6rem; cursor: pointer; font-size: .9rem; font-weight: 500 !important; }
.check input { appearance: none; flex: none; width: 20px; height: 20px; margin-top: .2rem; border: 2px solid var(--line); border-radius: 4px; background: var(--white); cursor: pointer; display: grid; place-items: center; }
.check input:checked { background: var(--ink); }
.check input:checked::after { content: ""; width: 9px; height: 5px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; rotate: -45deg; translate: 0 -1px; }
.check input:focus-visible { outline: 3px solid var(--blurple); outline-offset: 2px; }

.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1.8rem; padding-top: 1.4rem; border-top: 1px dashed var(--soft-line); }
.spinner { display: none; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.loading .spinner { display: inline-block; }
@keyframes spin { to { rotate: 360deg; } }

/* 送信完了 */
.done { max-width: 560px; margin: 5rem auto 0; text-align: center; }
.done-box { background: var(--white); border: 2px solid var(--line); border-radius: 12px; box-shadow: 6px 6px 0 var(--line); padding: 2.4rem 1.6rem; }
.done-stamp { display: inline-block; padding: .2rem 1rem; border: 3px solid var(--green); color: var(--green); border-radius: 6px; font-weight: 900; rotate: -4deg; margin-bottom: 1.2rem; }
.done h1 { font-size: 1.6rem; font-weight: 900; }
.done p { margin-top: .8rem; color: var(--ink-2); }
.done .hero-actions { justify-content: center; }

/* =========================================================
 *  規約・ポリシー
 * ========================================================= */
.legal { padding-top: 3.5rem; }
.legal-head h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 900; }
.legal-head p { margin-top: .6rem; color: var(--ink-2); }
.legal-meta { margin-top: .8rem; font: 500 .8rem var(--mono); color: var(--muted); }

.part-switch { display: flex; gap: .6rem; flex-wrap: wrap; margin: 2rem 0 0; }
.part-switch a { text-decoration: none; }

.legal-body { display: grid; grid-template-columns: 220px 1fr; gap: 2.5rem; margin-top: 2.5rem; align-items: start; }
.toc-wrap { position: sticky; top: 88px; }
.toc { font-size: .85rem; }
.toc p { font-weight: 900; margin: 0 0 .4rem; }
.toc p + ol { margin-bottom: 1.4rem; }
.toc ol { list-style: none; border-left: 2px solid var(--soft-line); }
.toc a { display: block; padding: .2rem 0 .2rem .8rem; margin-left: -2px; border-left: 2px solid transparent; text-decoration: none; color: var(--ink-2); }
.toc a:hover { border-left-color: var(--ink); color: var(--ink); }

.part { background: var(--white); border: 2px solid var(--line); border-radius: 12px; box-shadow: 5px 5px 0 var(--line); padding: clamp(1.3rem, 4vw, 2.2rem); }
.part + .part { margin-top: 2.5rem; }
.part-label { display: inline-block; font: 500 .75rem var(--mono); padding: .1rem .55rem; border: 1.5px solid var(--line); border-radius: 4px; margin-bottom: .6rem; }
.part > h2 { font-size: 1.45rem; font-weight: 900; padding-bottom: .7rem; border-bottom: 2px solid var(--line); }
.part > .lead { margin-top: 1rem; color: var(--ink-2); font-size: .95rem; }
.article { margin-top: 2rem; scroll-margin-top: 90px; }
.article h3 { font-size: 1.05rem; font-weight: 900; margin-bottom: .5rem; }
.article p, .article li { font-size: .94rem; color: var(--ink-2); }
.article p + p { margin-top: .5rem; }
.article ol, .article ul { padding-left: 1.4rem; margin-top: .4rem; }
.article li + li { margin-top: .25rem; }
.article table { width: 100%; border-collapse: collapse; margin-top: .6rem; font-size: .88rem; }
.article th, .article td { border: 1.5px solid var(--line); padding: .55rem .7rem; text-align: left; vertical-align: top; }
.article th { background: var(--paper); font-weight: 700; white-space: nowrap; }
.article td { color: var(--ink-2); }
.table-wrap { overflow-x: auto; }
.legal-note { margin-top: 2.5rem; padding: 1rem 1.2rem; background: var(--paper-2); border-radius: 8px; font-size: .88rem; color: var(--ink-2); }

/* ===== responsive ===== */
.toc-wrap > summary { display: none; }
@media (max-width: 860px) {
  .legal-body { grid-template-columns: 1fr; gap: 1.5rem; }
  .toc-wrap { position: static; background: var(--white); border: 2px solid var(--line); border-radius: 10px; }
  .toc-wrap > summary { display: flex; justify-content: space-between; cursor: pointer; list-style: none; padding: .8rem 1rem; font-weight: 900; }
  .toc-wrap > summary::-webkit-details-marker { display: none; }
  .toc-wrap > summary::after { content: "+"; font: 700 1.1rem var(--mono); }
  .toc-wrap[open] > summary::after { content: "−"; }
  .toc-wrap[open] > summary { border-bottom: 1px dashed var(--soft-line); }
  .toc { position: static; padding: 1rem; }
  .toc a { padding-block: .4rem; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; }
  .bot { grid-template-columns: 72px 1fr; }
  .bot-icon { width: 72px; height: 72px; }
  .bot-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .container { width: calc(100% - 32px); }
  .header-inner { height: 58px; }
  .nav { display: none; }
  .menu-toggle { display: block; }
  .nav.open { display: flex; flex-direction: column; gap: 0; position: absolute; top: 100%; left: 0; right: 0; padding: .4rem 16px .8rem; background: var(--paper); border-bottom: 2px solid var(--line); box-shadow: 0 10px 20px -12px rgba(0,0,0,.35); }
  .nav.open a { padding: .85rem .2rem; border-bottom: 1px dashed var(--soft-line); font-size: 1rem; }
  .nav.open a:last-child { border-bottom: none; }

  .section { padding-top: 3.2rem; }
  .section-title h2 { font-size: 1.3rem; }
  .hero { padding-top: 2.4rem; }
  .hero h1 { font-size: 1.85rem; }
  .hero h1 br { display: none; }
  .hero-actions .btn { flex: 1 1 100%; }
  .news, .bot, .contact-band, .form-card, .part, .done-box { box-shadow: 4px 4px 0 var(--line); }

  .bot { grid-template-columns: 56px 1fr; gap: .9rem; padding: 1.1rem; }
  .bot-icon { width: 56px; height: 56px; border-radius: 10px; font-size: 1.4rem; }
  .bot-head h3 { font-size: 1.15rem; }
  .bot-actions { min-width: 0; }
  .bot-actions .btn { flex: 1 1 100%; padding-block: .7em; font-size: .92rem; }

  .contact-band { padding: 1.3rem; }
  .contact-band .btn { width: 100%; }

  .form-page, .legal { padding-top: 2.2rem; }
  .notes { padding-left: 1.8rem; }
  .form-grid, .server-block { grid-template-columns: 1fr; }
  .server-block { padding: 1rem; }
  .type-grid { display: grid; grid-template-columns: 1fr 1fr; }
  .type-opt label { display: block; text-align: center; padding: .7rem .4rem; }
  .form-foot { flex-direction: column-reverse; align-items: stretch; text-align: center; }
  .form-foot .btn { width: 100%; padding-block: .9em; font-size: 1rem; }

  .part-switch .btn { flex: 1 1 100%; }
  .part > h2 { font-size: 1.25rem; }
  .article table, .article tbody, .article tr, .article td { display: block; width: 100%; }
  .article tr:first-child { display: none; }
  .article tr { border: 1.5px solid var(--line); border-radius: 6px; margin-bottom: .6rem; overflow: hidden; }
  .article td { border: none; }
  .article td:first-child { background: var(--paper); font-weight: 700; color: var(--ink); border-bottom: 1px dashed var(--soft-line); }

  .done { margin-top: 2.5rem; }
  .done .hero-actions .btn { flex: 1 1 100%; }

  .footer { margin-top: 3.5rem; padding-bottom: calc(2rem + env(safe-area-inset-bottom)); }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer nav { gap: .2rem 1rem; }
  .footer nav a { padding: .3rem 0; }
}
