:root {
  --bg: #f6f7f9; --card: #fff; --text: #1d2129; --muted: #6b7280; --line: #e5e7eb;
  --accent: #1d9bf0; --accent-ink: #fff; --ok: #16a34a; --warn: #d97706; --ng: #dc2626;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Meiryo", "Segoe UI", sans-serif; }
header { background: var(--card); border-bottom: 1px solid var(--line); padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 5; }
h1 { font-size: 18px; margin: 0; }
nav { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line); background: var(--card); padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 14px; }
.tab.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.pane { display: none; } .pane.on { display: block; }
.muted { color: var(--muted); font-size: 13px; }
.banner { display: none; padding: 12px 16px; border-radius: 10px; margin-bottom: 12px; font-weight: 600; }
.banner.break { display: block; background: #fef3c7; color: #92400e; }
.banner.window { display: block; background: #e0e7ff; color: #3730a3; }
.banner.done { display: block; background: #dcfce7; color: #166534; }
.summary { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.card h2 { font-size: 16px; margin: 0; display: flex; justify-content: space-between; }
.card .count { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.row { display: flex; gap: 6px; } .row select { flex: 1; min-width: 0; }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; width: 100%; background: #fff; color: var(--text); }
label { display: block; font-size: 13px; color: var(--muted); }
label input, label textarea, label select { margin-top: 2px; color: var(--text); }
label.check { display: flex; gap: 6px; align-items: center; color: var(--text); font-size: 14px; }
label.check input { width: auto; }
button { font: inherit; cursor: pointer; }
.sub { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px; white-space: nowrap; }
.big { border: 0; background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: 12px; font-size: 16px; font-weight: 700; }
.big:disabled { background: #cbd5e1; cursor: not-allowed; }
.link { border: 0; background: none; color: var(--muted); font-size: 12px; text-decoration: underline; align-self: flex-start; padding: 0; }
.wait { font-size: 13px; color: var(--warn); min-height: 1.2em; font-variant-numeric: tabular-nums; }
.drafts { display: flex; flex-direction: column; gap: 8px; }
.draft { border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #f9fafb; }
.draft textarea { background: #fff; }
.draft .acts { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.copybox textarea { font-size: 12px; }
.set { width: 100%; border-collapse: collapse; background: var(--card); }
.set th, .set td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; font-size: 14px; }
.set input { max-width: 120px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.form-grid .full { grid-column: 1 / -1; }
#settings-form h2, #tab-history h2, .guide h2 { font-size: 16px; margin: 24px 0 8px; }
.win { display: flex; gap: 6px; align-items: center; margin: 4px 0; } .win input { width: 120px; }
.save-row { margin-top: 24px; display: flex; gap: 12px; align-items: center; }
.log { list-style: none; padding: 0; } .log li { padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.log li.canceled { text-decoration: line-through; color: var(--muted); }
.guide li { margin-bottom: 8px; }
@media (max-width: 720px) {
  .grid, .form-grid { grid-template-columns: 1fr; }
  .set { font-size: 12px; } .set input { max-width: 70px; }
}
/* note-x-post-maker 用 */
#tab-make .card { margin-bottom: 12px; }
#tab-make .card h2 { justify-content: flex-start; gap: 8px; }
a.sub { color: var(--text); text-decoration: none; font-size: 14px; }
.out { display: flex; flex-direction: column; gap: 4px; }
.out button { text-align: left; border: 1px solid var(--line); background: #f9fafb; border-radius: 8px; padding: 6px 10px; }
.post { border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 8px; background: #f9fafb; }
.post .kind { font-size: 12px; font-weight: 700; color: var(--accent); }
.post .acts { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.post .fixbox { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.post .fixbox[hidden] { display: none; }
.post .fixwish { flex: 1 1 220px; min-width: 0; }
.len.over { color: var(--ng); font-weight: 700; }
.row label { flex: 0 0 200px; }
/* ブラウザ版 */
[hidden] { display: none !important; }
.auth { max-width: 460px; margin: 10vh auto; padding: 0 16px; }
.auth h1 { font-size: 20px; }
.err { color: var(--ng); font-size: 14px; min-height: 1.2em; }
.row.wrap { flex-wrap: wrap; }
.quota-bar { background: #eef6fe; border-bottom: 1px solid var(--line); padding: 6px 16px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.quota-bar .low { color: var(--ng); font-weight: 700; }
nav .link { align-self: center; margin-left: 4px; }
.plan-cur { font-size: 18px; font-weight: 700; }
#ext-token { font-family: ui-monospace, monospace; }
#user-button { display: inline-flex; align-items: center; }
#sign-in { display: flex; justify-content: center; margin-top: 16px; }
h1 small { font-size: .7em; font-weight: 500; color: var(--muted); }
.auth .lead { font-weight: 600; margin: 4px 0 12px; }
.auth-switch { flex-wrap: wrap; margin: 8px 0; }
.auth-switch a { text-decoration: none; text-align: center; flex: 1; }
.site-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; padding: 24px 16px; font-size: 12px; }
.site-foot a { color: var(--muted); }
body.legal main { max-width: 800px; }
body.legal h1 { font-size: 22px; } body.legal h2 { font-size: 16px; margin-top: 24px; }
body.legal th { width: 30%; white-space: nowrap; } body.legal td, body.legal p, body.legal li { font-size: 14px; }
@media (max-width: 720px) { body.legal th { white-space: normal; } }
.types { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; }
.ptype { margin-left: 8px; font-size: 11px; background: #eef6fe; color: var(--accent); border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.issues { display: flex; flex-wrap: wrap; gap: 4px; }
.warn { font-size: 12px; color: #92400e; background: #fef3c7; border-radius: 6px; padding: 1px 6px; }
.like.on { background: #dcfce7; border-color: #16a34a; }

/* ログイン画面（2026-10-03 作り直し） */
:root { --brand: #1d6ff2; --brand-2: #4f46e5; }
.auth { max-width: none; margin: 0; padding: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #eef4ff 0%, #f6f7f9 60%); }
.auth-wrap { display: grid; grid-template-columns: 1.1fr 1fr; max-width: 1040px; width: 100%; margin: 32px 16px; background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 20px 60px rgba(29, 64, 140, .12); }
.auth-hero { background: linear-gradient(150deg, var(--brand) 0%, var(--brand-2) 100%); color: #fff; padding: 48px 44px; display: flex; flex-direction: column; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 40px; height: 40px; border-radius: 12px; background: #fff; color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 22px; }
.brand-name { font-size: 24px; font-weight: 800; letter-spacing: .02em; }
.hero-sub { margin: -6px 0 0 50px; opacity: .85; font-size: 13px; letter-spacing: .1em; }
.hero-title { font-size: 26px; line-height: 1.5; margin: 12px 0 4px; font-weight: 800; }
.feats { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 14px; }
.feats li { display: flex; gap: 12px; align-items: flex-start; }
.feats b { flex: 0 0 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; font-size: 13px; }
.feats strong { display: block; font-size: 15px; }
.feats span { display: block; font-size: 13px; opacity: .85; line-height: 1.6; }
.hero-note { margin-top: auto; font-size: 13px; background: rgba(255,255,255,.14); border-radius: 10px; padding: 10px 14px; }
.hero-aside { font-size: 13px; opacity: .9; margin: 4px 0 0; }
.auth-panel { padding: 36px 32px; display: flex; flex-direction: column; align-items: stretch; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #f1f3f7; border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.seg a { text-align: center; padding: 10px 6px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.seg a.on { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.auth-panel #sign-in { display: flex; justify-content: center; margin-top: 0; }
.legal-links { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; margin-top: auto; padding-top: 16px; font-size: 12px; }
.legal-links a { color: var(--muted); }
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; margin: 0; border-radius: 0; box-shadow: none; }
  .auth-hero { padding: 28px 20px; }
  .hero-title { font-size: 21px; }
  .hero-note { margin-top: 8px; }
  .auth-panel { padding: 24px 16px; }
}
.auth:not([hidden]) ~ .site-foot { display: none; }
.seg a small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 1px; }
.hero-sub { font-size: 14px; letter-spacing: .04em; }
/* はじめにやること・拡張の手順 */
.checklist { border-color: #c7dafc; background: #f5f9ff; }
.checklist ol { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-direction: column; gap: 6px; }
.checklist li { display: flex; align-items: center; gap: 10px; }
.checklist .mark { flex: 0 0 26px; height: 26px; border-radius: 50%; background: #fff; border: 1px solid #c7dafc; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--brand); }
.checklist li.done .mark { background: #16a34a; border-color: #16a34a; color: #fff; }
.checklist li.done .t { color: var(--muted); text-decoration: line-through; }
.checklist .t { flex: 1; }
.step-card { margin-bottom: 12px; }
.step-card h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 16px; }
.step-card .num { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; }
.step-card ol { margin: 4px 0; padding-left: 20px; } .step-card li { margin-bottom: 4px; }
.step-card code { background: #f1f3f7; padding: 1px 6px; border-radius: 4px; }
.state { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px; }
.state.ok { background: #dcfce7; color: #166534; } .state.ng { background: #f1f3f7; color: var(--muted); }
details summary { cursor: pointer; margin-top: 8px; }
/* 使い方ガイド */
.guide-page main { max-width: 860px; }
.g-head { display: flex; justify-content: space-between; align-items: center; }
.g-head .brand-name { font-size: 18px; color: var(--text); }
.g-head .logo { background: linear-gradient(150deg, var(--brand), var(--brand-2)); color: #fff; }
.guide-page section.card, .g-toc { margin-bottom: 16px; }
.guide-page h2 { font-size: 19px; margin: 0 0 8px; }
.guide-page h3 { font-size: 15px; margin: 12px 0 4px; }
.guide-page p, .guide-page li, .guide-page dd { font-size: 14px; line-height: 1.8; }
.g-toc ol { margin: 6px 0 0; padding-left: 20px; columns: 2; }
.g-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.g-three > div { background: #f5f9ff; border-radius: 10px; padding: 12px; }
.g-three b { color: var(--brand); font-size: 16px; }
.g-note { background: #fff8e6; border-radius: 8px; padding: 10px 12px; }
.g-step { display: flex; gap: 12px; margin: 12px 0; }
.g-step .num { flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.g-step h3 { margin-top: 2px; }
.g-step code { background: #f1f3f7; padding: 1px 6px; border-radius: 4px; }
.g-faq dt { font-weight: 700; margin-top: 10px; } .g-faq dd { margin: 2px 0 0 0; color: #374151; }
@media (max-width: 720px) { .g-three { grid-template-columns: 1fr; } .g-toc ol { columns: 1; } }

.home-link { color: inherit; text-decoration: none; }
.home-link:hover { opacity: .8; }

/* 読み込み中 */
.loading { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); }
.loading .logo { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(150deg, #1d6ff2, #4f46e5); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 28px; }
.loading .spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #dbe4f5; border-top-color: #1d6ff2; animation: xns-spin .8s linear infinite; }
.loading p { margin: 0; font-size: 14px; }
@keyframes xns-spin { to { transform: rotate(360deg); } }
.loading:not([hidden]) ~ .site-foot { display: none; }

.ok-msg { color: #166534; font-weight: 600; }

/* お支払い（プラン画面） */
#billing a.big, #billing a.sub { display: inline-block; text-decoration: none; }
#billing h3 { margin: 0 0 8px; }
