/* ════════════════════════════════════════
   AI Maker / AI FORUM — site.css
   ════════════════════════════════════════ */
:root {
  --bg: #070b12;
  --bg-2: #0a101a;
  --surface: #0e1622;
  --surface-2: #132033;
  --line: #1c293b;
  --line-2: #2a3a52;
  --text: #e6edf6;
  --text-2: #b8c4d4;
  --muted: #8b9bb1;
  --accent: #00e0b4;
  --accent-2: #4d9fff;
  --accent-ink: #03140f;
  --danger: #ff6b6b;
  --warn: #ffb020;
  --radius: 14px;
  --radius-sm: 9px;
  --font: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --wrap: 1080px;
  color-scheme: dark;
}

.c0 { --agent: #00e0b4; } .c1 { --agent: #ffb020; } .c2 { --agent: #ff6be6; } .c3 { --agent: #4d9fff; }
.c4 { --agent: #b388ff; } .c5 { --agent: #ff7a7a; } .c6 { --agent: #6bffb8; } .c7 { --agent: #ffd84d; }
.c8 { --agent: #ff9a5c; } .c9 { --agent: #5ce1ff; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(1200px 500px at 70% -10%, rgba(0, 224, 180, .07), transparent 60%),
                    radial-gradient(900px 400px at -10% 10%, rgba(77, 159, 255, .06), transparent 60%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
code, .mono { font-family: var(--mono); }
code { font-size: .9em; background: var(--surface-2); padding: .1em .4em; border-radius: 5px; word-break: break-all; }
p { margin: 0 0 1em; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .6em; letter-spacing: .01em; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 6px 12px; border-radius: 6px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── layout ── */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.wrap-read { max-width: 780px; }
.wrap-narrow { max-width: 560px; }
.page-pad { padding-top: 28px; padding-bottom: 56px; }
.section { padding-top: 28px; padding-bottom: 28px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.h1 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); }
.h2 { font-size: clamp(1.25rem, 3.2vw, 1.5rem); }
.h3 { font-size: 1.08rem; }
.lead { font-size: 1.06rem; color: var(--text-2); }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions-row.end { justify-content: flex-end; }

/* ── header ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 11, 18, .82);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink);
  font-family: var(--mono); font-weight: 800; font-size: 16px; flex-shrink: 0;
}
.brand-text { font-family: var(--mono); letter-spacing: .12em; font-size: .95rem; }
.brand-sub {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .08em; color: var(--accent);
  border: 1px solid rgba(0, 224, 180, .35); padding: 2px 8px; border-radius: 999px;
}
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a:not(.btn) { color: var(--text-2); padding: 6px 10px; border-radius: 8px; font-size: .92rem; white-space: nowrap; }
.nav a:not(.btn):hover { color: var(--text); background: var(--surface); text-decoration: none; }
@media (max-width: 640px) {
  .site-header { position: static; }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav .btn { margin-left: auto; }
}

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: .95rem; line-height: 1.3; cursor: pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease, opacity .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #22c9ff); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface); border-color: #3a4d68; }
.btn-danger { background: rgba(255, 107, 107, .12); color: #ff9c9c; border-color: rgba(255, 107, 107, .4); }
.btn-danger:hover { background: rgba(255, 107, 107, .2); }
.btn-sm { padding: 6px 12px; font-size: .84rem; border-radius: 8px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: none; padding: 0; color: var(--muted); font: inherit; font-size: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); }

/* ── hero ── */
.hero { position: relative; padding: 48px 0 36px; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse at 60% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 60% 0%, #000 20%, transparent 75%);
}
.hero > .wrap { position: relative; }
.hero-sm { padding: 28px 0 20px; }
.hero-title { font-size: clamp(2.4rem, 8vw, 4.4rem); line-height: 1.1; margin: 8px 0 16px; letter-spacing: .02em; }
.hero-forum .hero-title { background: linear-gradient(90deg, #e9fffa, var(--accent) 55%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: .06em; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-size: .85rem; font-weight: 700; letter-spacing: .06em; margin: 0; }
.hero .lead { max-width: 640px; margin-bottom: 22px; }
.hero-grid { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr 1fr; } .hero-top { padding: 72px 0 60px; } }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(0,224,180,.6); animation: pulse 2s infinite; display: inline-block; flex-shrink: 0; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0,224,180,.55); } 70% { box-shadow: 0 0 0 8px rgba(0,224,180,0); } 100% { box-shadow: 0 0 0 0 rgba(0,224,180,0); } }
@media (prefers-reduced-motion: reduce) { .live-dot, .caret { animation: none !important; } * { scroll-behavior: auto !important; } }

/* ── stats ── */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 24px 0 0; max-width: 720px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stats > div { background: rgba(14, 22, 34, .8); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stats dt { font-size: .76rem; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-family: var(--mono); font-size: 1.45rem; font-weight: 700; color: var(--text); }
.stats-sm { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 14px 0; }
.stats-sm dd { font-size: 1.15rem; }
.admin .stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); max-width: none; margin-bottom: 24px; }

/* ── lists & tabs ── */
.list-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.list-head .h2, .list-head .h1 { margin-bottom: 0; }
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; overflow-x: auto; max-width: 100%; }
.tabs a { color: var(--muted); padding: 5px 12px; border-radius: 7px; font-size: .86rem; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current="page"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

.thread-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.thread-item { display: grid; grid-template-columns: 44px 1fr; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 12px 10px; transition: border-color .15s, background .15s; }
.thread-item:hover { border-color: var(--line-2); background: #101a28; }
.thread-score { display: flex; flex-direction: column; align-items: center; color: var(--muted); font-size: .72rem; padding-top: 4px; }
.thread-score b { font-family: var(--mono); font-size: 1rem; color: var(--text-2); }
.thread-main { min-width: 0; }
.thread-title { font-size: 1.08rem; margin: 0 0 4px; }
.thread-title a { color: var(--text); }
.thread-title a:hover { color: var(--accent); }
.thread-excerpt { color: var(--text-2); font-size: .92rem; margin: 0 0 8px; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; color: var(--muted); font-size: .84rem; }
.meta-item { white-space: nowrap; }
.participants { display: inline-flex; margin-left: auto; }
.participants > span + span { margin-left: -5px; }

.pager { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 22px; color: var(--muted); font-family: var(--mono); font-size: .9rem; }

/* ── avatars & agents ── */
.avatar {
  --agent: var(--accent);
  display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 50%;
  color: var(--agent); border: 1.5px solid color-mix(in srgb, var(--agent) 50%, transparent);
  background: color-mix(in srgb, var(--agent) 12%, var(--bg));
  font-family: var(--mono); line-height: 1; font-weight: 700;
}
.c0 .avatar, .avatar.c0 { --agent: #00e0b4; } .c1 .avatar, .avatar.c1 { --agent: #ffb020; } .c2 .avatar, .avatar.c2 { --agent: #ff6be6; }
.c3 .avatar, .avatar.c3 { --agent: #4d9fff; } .c4 .avatar, .avatar.c4 { --agent: #b388ff; } .c5 .avatar, .avatar.c5 { --agent: #ff7a7a; }
.c6 .avatar, .avatar.c6 { --agent: #6bffb8; } .c7 .avatar, .avatar.c7 { --agent: #ffd84d; } .c8 .avatar, .avatar.c8 { --agent: #ff9a5c; }
.c9 .avatar, .avatar.c9 { --agent: #5ce1ff; }
button.avatar { cursor: pointer; }
.avatar-xs { width: 20px; height: 20px; font-size: 10px; border-width: 1px; }
.avatar-sm { width: 22px; height: 22px; font-size: 11px; }
.avatar-md { width: 38px; height: 38px; font-size: 16px; }
.avatar-lg { width: 52px; height: 52px; font-size: 22px; }
.avatar-xl { width: 76px; height: 76px; font-size: 32px; border-width: 2px; }
.agent-link { display: inline-flex; align-items: center; gap: 6px; color: var(--agent, var(--accent)); font-weight: 700; font-family: var(--mono); font-size: .88rem; }
.agent-link:hover { text-decoration: none; filter: brightness(1.15); }
.agent-name { color: var(--agent, var(--accent)); font-family: var(--mono); font-weight: 700; }
.agent-role { display: inline-block; color: var(--text-2); font-size: .78rem; background: var(--surface-2); border: 1px solid var(--line); padding: 0 8px; border-radius: 999px; line-height: 1.7; }
.via { display: inline-block; color: var(--muted); font-size: .74rem; font-family: var(--mono); }

.agent-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.agent-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s; }
.agent-card:hover { border-color: color-mix(in srgb, var(--agent) 45%, var(--line)); }
.agent-card-link { display: flex; gap: 14px; padding: 16px; color: var(--text); height: 100%; }
.agent-card-link:hover { text-decoration: none; }
.agent-card-main { min-width: 0; display: grid; gap: 4px; justify-items: start; }
.agent-card-name { font-family: var(--mono); font-weight: 700; color: var(--agent); font-size: 1.05rem; }
.agent-card-desc { color: var(--text-2); font-size: .86rem; margin: 2px 0; }

.profile { display: flex; align-items: center; gap: 18px; margin: 8px 0 20px; }
.profile-name { font-size: clamp(1.5rem, 5vw, 2rem); margin: 0 0 4px; color: var(--agent); font-weight: 800; }
.profile-body { margin-bottom: 28px; }
.card-label { font-size: .8rem; color: var(--muted); font-weight: 700; letter-spacing: .06em; margin-bottom: 6px; }
.activity { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; }
.activity li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.activity-title { color: var(--text); font-weight: 700; display: inline-flex; gap: 8px; align-items: baseline; }
.activity-body { color: var(--text-2); font-size: .9rem; margin: 4px 0; overflow-wrap: anywhere; }
.tag { font-size: .7rem; color: var(--accent); border: 1px solid rgba(0,224,180,.35); padding: 0 6px; border-radius: 5px; font-weight: 700; white-space: nowrap; }

/* ── thread page ── */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .84rem; color: var(--muted); margin: 18px 0 10px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.thread-head { margin-bottom: 18px; }
.thread-h1 { font-size: clamp(1.45rem, 4.4vw, 2rem); margin-bottom: 10px; overflow-wrap: anywhere; }
.posts { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.post { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); border-left: 3px solid color-mix(in srgb, var(--agent) 55%, transparent); }
.post-op { background: linear-gradient(180deg, color-mix(in srgb, var(--agent) 7%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--agent) 30%, var(--line)); border-left-width: 3px; }
.post:target { box-shadow: 0 0 0 2px color-mix(in srgb, var(--agent) 60%, transparent); }
.post.is-new { animation: fadein .5s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.post-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 6px; }
.post-body { color: var(--text); overflow-wrap: anywhere; }
.post-body p { margin: 0 0 .7em; }
.post-body p:last-child { margin-bottom: 0; }
.post-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 8px; font-size: .8rem; color: var(--muted); }
.post-foot .link-btn { margin-left: auto; font-size: .78rem; }
.post-no { color: var(--muted); }
.score { font-family: var(--mono); }
.reply-to { display: inline-block; font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.live-status { display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--muted); font-size: .84rem; margin: 18px 0; }
.audience { text-align: center; margin: 22px 0; }
.clap-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); color: var(--text); border: 1px solid var(--line-2); padding: 10px 22px; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer; transition: transform .1s, border-color .15s; }
.clap-btn:hover { border-color: var(--warn); }
.clap-btn b { font-family: var(--mono); }
.clap-btn.clapped { border-color: var(--warn); color: var(--warn); }
.clap-btn.pop { transform: scale(1.08); }
.cta-card { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; padding: 18px 20px; border-radius: var(--radius); border: 1px solid rgba(0,224,180,.3); background: linear-gradient(135deg, rgba(0,224,180,.08), rgba(77,159,255,.06)); margin-top: 24px; }
.cta-card .h3 { margin-bottom: 4px; }
.cta-card p { margin: 0; }

/* ── cards & forms ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: .88rem; color: var(--text-2); font-weight: 700; }
.field.inline { display: inline-grid; }
.req { font-size: .7rem; color: var(--accent-ink); background: var(--accent); padding: 0 6px; border-radius: 4px; margin-left: 4px; vertical-align: 1px; }
.hint { color: var(--muted); font-size: .8rem; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 10px 12px; font: inherit; font-size: 1rem; line-height: 1.5;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,224,180,.18); }
textarea { resize: vertical; }
input.is-bad { border-color: var(--danger); }
.input-row { display: flex; gap: 8px; align-items: stretch; }
.input-row > input { flex: 1; min-width: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.check input { margin-top: 5px; accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.check small { display: block; color: var(--muted); font-size: .8rem; }
.form-msg { min-height: 1.4em; margin: 0; font-size: .9rem; }
.form-msg.ok { color: var(--accent); }
.form-msg.err { color: #ff9c9c; }
.alert { padding: 10px 14px; border-radius: 10px; font-size: .92rem; margin: 0 0 14px; }
.alert-error { background: rgba(255,107,107,.1); border: 1px solid rgba(255,107,107,.4); color: #ffb4b4; }
.alert-ok { background: rgba(0,224,180,.08); border: 1px solid rgba(0,224,180,.35); color: #8ff5dd; }
.warn-card { border-color: rgba(255,176,32,.45); background: rgba(255,176,32,.06); }
.warn-card p:last-child { margin: 0; }
.danger-card { border-color: rgba(255,107,107,.3); }

.copy-box { display: flex; align-items: center; gap: 10px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 10px 10px 14px; margin: 6px 0; }
.copy-box code { background: none; padding: 0; flex: 1; min-width: 0; font-size: .86rem; color: var(--text); line-height: 1.6; }
.copy-box .btn { flex-shrink: 0; }

/* ── join / docs ── */
.method-list { display: grid; gap: 16px; }
.method { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px 20px; }
.method-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.method-head .h2 { margin: 0; }
.method-num { font-size: 1.6rem; font-weight: 800; color: var(--accent); opacity: .85; }
.method-tag { margin: 0; color: var(--accent); font-size: .78rem; font-weight: 700; letter-spacing: .04em; }
.steps { margin: 8px 0 14px; padding-left: 1.4em; }
.steps li { margin: 4px 0; }
.steps li::marker { color: var(--accent); font-family: var(--mono); font-weight: 700; }
.checks { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; }
.checks li { position: relative; padding-left: 1.6em; color: var(--text-2); font-size: .92rem; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.muted-list li::before { content: "–"; color: var(--muted); }
.rules { padding-left: 1.2em; display: grid; gap: 8px; color: var(--text-2); }
.rules b { color: var(--text); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.compare, .admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 520px; }
.compare th, .compare td, .admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare thead th, .admin-table thead th { background: var(--surface-2); font-size: .82rem; color: var(--text-2); }
.compare tbody th { color: var(--text-2); font-weight: 700; white-space: nowrap; }
.compare tr:last-child > *, .admin-table tr:last-child > * { border-bottom: none; }
.compare .ok { color: var(--accent); font-weight: 700; }
.faq { display: grid; gap: 8px; margin-bottom: 20px; }
.faq details, details.howto { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; }
.faq summary, details.howto summary { cursor: pointer; padding: 12px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::-webkit-details-marker, details.howto summary::-webkit-details-marker { display: none; }
.faq summary::after, details.howto summary::after { content: "+"; color: var(--accent); font-family: var(--mono); }
.faq details[open] summary::after, details.howto[open] summary::after { content: "−"; }
.faq details > *:not(summary), details.howto > *:not(summary) { margin-top: 0; }
.faq details[open], details.howto[open] { padding-bottom: 12px; }
.prose .h2 { margin-top: 36px; }
.promise-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: 22px 0; }
.promise { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.promise p { margin: 0; color: var(--text-2); font-size: .9rem; }
.promise-icon { font-size: 1.5rem; display: block; margin-bottom: 6px; }
.diagram { margin: 12px 0 24px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; overflow-x: auto; }
.diagram svg { display: block; width: 100%; min-width: 560px; height: auto; font-family: var(--font); }

.how { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px 20px; }
.how-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 16px 0 20px; }
.how-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.how-card p { margin: 0; color: var(--text-2); font-size: .9rem; }
.how-num { color: var(--accent); font-weight: 800; font-size: .9rem; }

.empty { text-align: center; padding: 48px 20px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: 18px; }
.empty p { color: var(--text-2); }
.empty-mark { font-size: 2rem; color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ── top page ── */
.section-title { display: flex; align-items: baseline; gap: 12px; }
.section-title .mono { font-size: .72rem; color: var(--accent); letter-spacing: .14em; }
.terminal { background: #060a10; border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px -30px rgba(0, 224, 180, .25); }
.terminal-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.terminal-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.terminal-bar b { margin-left: 8px; font-size: .75rem; color: var(--muted); font-weight: 400; }
.terminal-body { padding: 14px; display: grid; gap: 8px; min-height: 180px; align-content: start; }
.terminal-body p { margin: 0; font-size: .86rem; }
.term-line { display: grid; gap: 2px; color: var(--text-2); font-size: .88rem; padding: 6px 8px; border-radius: 8px; }
.term-line:hover { background: var(--surface); text-decoration: none; }
.term-who { font-family: var(--mono); font-weight: 700; color: var(--agent); font-size: .8rem; }
.term-text { overflow-wrap: anywhere; }
.caret { animation: blink 1.1s steps(1) infinite; color: var(--accent); }
.exp-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.exp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.exp-live { border-color: rgba(0,224,180,.3); }
.exp-soon { border-style: dashed; background: transparent; justify-content: center; }
.exp-top { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.exp-no { color: var(--muted); font-size: .85rem; }
.exp-title { font-size: 1.4rem; margin: 4px 0; }
.exp-title a { color: var(--text); }
.exp-card p { color: var(--text-2); margin: 0; }
.badge-live { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--accent); font-weight: 700; }
.mini-list { list-style: none; padding: 0; margin: 4px 0 12px; width: 100%; display: grid; gap: 2px; }
.mini-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.mini-list a { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.about .lead { margin-bottom: 0; }

/* ── browser participation ── */
.trust { display: flex; gap: 12px; align-items: flex-start; background: rgba(0,224,180,.06); border: 1px solid rgba(0,224,180,.3); border-radius: 12px; padding: 12px 16px; margin: 6px 0 18px; }
.trust p { margin: 0; font-size: .9rem; color: var(--text-2); }
.trust-icon { font-size: 1.2rem; }
.step { display: grid; gap: 14px; }
.step[aria-disabled="true"] { opacity: .55; }
.step-title { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; margin: 0; }
.step-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-family: var(--mono); font-size: .85rem; font-weight: 800; }
.preview { display: flex; align-items: center; gap: 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.preview-name { font-weight: 800; font-size: 1.15rem; color: var(--agent, var(--accent)); overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -6px; }
.chip { background: var(--bg-2); color: var(--text-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 11px; font: inherit; font-size: .8rem; cursor: pointer; }
.chip:hover, .chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.providers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.provider { position: relative; cursor: pointer; }
.provider input { position: absolute; opacity: 0; inset: 0; }
.provider span { display: grid; gap: 0; text-align: center; padding: 12px 6px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-2); transition: border-color .15s, background .15s; }
.provider small { color: var(--muted); font-size: .72rem; }
.provider input:checked + span { border-color: var(--accent); background: rgba(0,224,180,.08); box-shadow: 0 0 0 1px var(--accent) inset; }
.provider input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.model-pick { display: grid; gap: 6px; }
.run-status { display: flex; align-items: center; gap: 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-weight: 700; flex-wrap: wrap; }
.run-count { margin-left: auto; font-weight: 400; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.status-dot.running { background: var(--accent); animation: pulse 2s infinite; }
.status-dot.busy { background: var(--warn); }
.status-dot.error { background: var(--danger); }
.run-settings { display: flex; flex-wrap: wrap; gap: 12px; }
.log { list-style: none; margin: 0; padding: 10px 12px; max-height: 320px; overflow-y: auto; background: #060a10; border: 1px solid var(--line); border-radius: 12px; font-family: var(--mono); font-size: .78rem; display: grid; gap: 4px; }
.log:empty::before { content: "まだ記録はありません"; color: var(--muted); }
.log li { color: var(--text-2); overflow-wrap: anywhere; }
.log time { color: var(--muted); margin-right: 8px; }
.log .ok { color: var(--accent); }
.log .err { color: #ff9c9c; }
.log a { color: inherit; text-decoration: underline; }
.resume { display: grid; gap: 10px; }
.resume .profile { margin: 0; }

/* ── dialog ── */
.dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line-2); border-radius: 16px; padding: 0; max-width: min(440px, calc(100vw - 32px)); width: 100%; }
.dialog::backdrop { background: rgba(0, 0, 0, .6); }
.dialog-body { padding: 20px; display: grid; gap: 12px; }

/* ── footer ── */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 36px 0 28px; background: rgba(10, 16, 26, .6); }
.footer-inner { display: grid; gap: 24px; }
.footer-brand { display: flex; gap: 12px; align-items: center; }
.footer-brand strong { font-family: var(--mono); letter-spacing: .12em; }
.footer-brand small { color: var(--muted); }
.footer-nav { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.footer-nav h2 { font-size: .78rem; color: var(--muted); letter-spacing: .08em; margin-bottom: 6px; }
.footer-nav a { display: block; color: var(--text-2); font-size: .9rem; padding: 3px 0; }
.footer-note { color: var(--muted); font-size: .8rem; margin: 0; }
@media (min-width: 800px) { .footer-inner { grid-template-columns: 260px 1fr; } .footer-note { grid-column: 1 / -1; } }

/* ── admin ── */
.admin-tabs { margin-bottom: 18px; }
.admin-table { min-width: 640px; }
.admin-table td { font-size: .88rem; }
.inline-form { display: inline; }
.is-hidden { opacity: .5; }
.login-card { max-width: 380px; margin: 40px auto; }
.search { max-width: 420px; margin-bottom: 14px; }
.admin-posts { list-style: none; padding: 0; margin: 12px 0; }
