/* 無料ツール共通(見た目はトップページ index.html に合わせる。色・フォントはそちらと同じ値) */
:root {
  --bg: #f6f4ee; --surface: #fff; --ink: #253b33; --ink-soft: #4e5c54;
  --muted: #626e65; --line: #dcded3; --accent: #70917a;
  --accent-deep: #365f47; --accent-wash: #e7ede3; --warn: #a2482f; --max: 1080px;
  --serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: "Noto Sans JP", "Hiragino Sans", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.9; letter-spacing: .025em; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-deep); text-underline-offset: 5px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #98672e; outline-offset: 3px; }
.wrap { width: min(100%, var(--max)); margin-inline: auto; padding-inline: 28px; }
h1, h2, h3, .serif { font-family: var(--serif); }
h1 { font-size: clamp(24px, 3vw, 32px); line-height: 1.55; letter-spacing: .05em; margin: 0 0 12px; }
h2 { font-size: clamp(21px, 2.4vw, 26px); line-height: 1.6; letter-spacing: .05em; margin: 0 0 14px; }
h3 { font-size: 17px; line-height: 1.7; margin: 0 0 8px; }
.skip { position: absolute; left: 20px; top: -80px; z-index: 20; padding: 10px 20px; background: white; }
.skip:focus { top: 10px; }

/* 上の帯(トップページと同じ) */
header.site { position: sticky; top: 0; z-index: 10; background: #f6f4eef5; border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand span { font-family: var(--serif); font-weight: 700; font-size: 21px; letter-spacing: .12em; }
header.site nav { display: flex; gap: 26px; font-size: 13px; }
header.site nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-soft); text-decoration: none; white-space: nowrap; }
header.site nav a:hover { text-decoration: underline; }
header.site nav a[aria-current] { color: var(--accent-deep); font-weight: 700; }

/* ページの頭 */
.page-head { padding-block: 40px 24px; }
.page-head .eyebrow { display: inline-block; font-size: 13px; font-weight: 500; color: var(--accent-deep); border-bottom: 1px solid var(--accent); padding-bottom: 6px; margin-bottom: 16px; }
.page-head .eyebrow a { color: inherit; text-decoration: none; }
.page-head .eyebrow a:hover { text-decoration: underline; }
.page-head .lead { font-size: 15px; color: var(--ink-soft); margin: 0; max-width: 46em; }
.privacy { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 6px 12px; font-size: 12px; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.privacy::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

/* ツール本体 */
.tool { padding-block: 8px 40px; }
.tool-grid { display: grid; grid-template-columns: minmax(300px, 2fr) minmax(0, 3fr); gap: 20px; align-items: start; }
.pane { min-width: 0; }
.pane-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.pane-bar .count strong { font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; font-family: var(--serif); }
.pane-bar .count .sub { margin-left: 8px; }
.bar-buttons { display: flex; gap: 6px; }

textarea, select, input[type="text"], input[type="number"] { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
textarea { display: block; width: 100%; min-height: 360px; resize: vertical; padding: 12px 14px; font-size: 15px; line-height: 1.8; }
textarea:focus, select:focus, input:focus { outline: none; border-color: var(--accent-deep); box-shadow: 0 0 0 3px var(--accent-wash); }
textarea::placeholder { color: #9aa39b; }
select, input[type="text"], input[type="number"] { padding: 6px 10px; font-size: 14px; min-height: 40px; max-width: 100%; min-width: 0; }
input[type="number"] { width: 5.5em; }
button, .button { font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 14px; min-height: 40px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button:hover, .button:hover { border-color: var(--accent); background: var(--accent-wash); }
button.primary { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; font-weight: 700; padding: 10px 22px; min-height: 48px; }
button.primary:hover { background: #2c4e3a; }
button.small { font-size: 13px; padding: 5px 10px; min-height: 34px; }

.note { margin: 8px 2px 0; font-size: 12px; line-height: 1.7; color: var(--muted); }
.caution { margin: 12px 0 0; padding: 10px 14px; font-size: 12px; line-height: 1.7; color: var(--ink-soft); background: var(--surface); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; }

/* 設定(フォーム) */
.settings { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 0 0 14px; font-size: 13px; color: var(--ink-soft); }
.settings label { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 100%; }
.settings label.check { gap: 6px; }
.settings input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent-deep); }
fieldset.settings { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: var(--surface); }
fieldset.settings legend { padding: 0 6px; font-size: 12px; color: var(--muted); }
.settings .inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; max-width: 100%; }
.settings input[type="text"] { width: 12em; max-width: 100%; }

/* 折りたたみパネル */
.panel { margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; }
.panel summary { cursor: pointer; font-weight: 700; color: var(--accent-deep); font-size: 14px; }
.panel summary span { font-weight: 400; color: var(--muted); }
.howto { margin: 8px 0 4px; border-collapse: collapse; font-size: 13px; }
.howto td { padding: 4px 8px 4px 0; vertical-align: top; line-height: 1.6; }
.howto code, .article code { font-family: var(--sans); white-space: nowrap; background: var(--accent-wash); border-radius: 4px; padding: 1px 6px; font-size: .95em; }
.empty { margin: 8px 0 2px; color: var(--muted); font-size: 13px; }
.ruby-list { list-style: none; margin: 8px 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ruby-list li { border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: 13px; line-height: 1.7; }
.ruby-list li .times { color: var(--muted); font-size: 12px; margin-left: 4px; }
.ruby-list li.varies { border-color: var(--warn); }
.ruby-list li.varies::after { content: '読みが複数'; margin-left: 6px; font-size: 11px; color: var(--warn); }

/* 綴箱への案内カード(各ツール 1 つだけ) */
.app-card { margin: 36px auto 0; max-width: 720px; display: grid; grid-template-columns: 64px 1fr; gap: 20px; padding: 24px 26px; background: var(--accent-wash); border: 1px solid #ced8ca; border-radius: 10px; }
.app-card img { width: 64px; height: 64px; border-radius: 15px; }
.app-card h2 { font-size: 19px; margin: 2px 0 8px; }
.app-card p { margin: 0 0 14px; font-size: 14px; color: var(--ink-soft); }
.app-card .cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.app-card .cta .badge img { height: 44px; width: auto; border-radius: 0; }
.app-card .cta .web { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; border: 1px solid var(--accent); border-radius: 6px; padding: 7px 14px; font-size: 13px; text-decoration: none; background: #ffffff80; }
.app-card .cta .web:hover { background: #fff; }
.app-card .cta-note { width: 100%; margin: 0; font-size: 12px; color: var(--muted); }

/* ツール一覧のカード */
.tool-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin: 24px 0 0; padding: 0; list-style: none; }
.tool-cards li { background: var(--surface); border-top: 2px solid var(--accent); border-radius: 2px 2px 10px 10px; padding: 26px; display: flex; flex-direction: column; }
.tool-cards .kind { font-size: 12px; color: var(--accent-deep); font-weight: 700; letter-spacing: .12em; margin-bottom: 10px; }
.tool-cards h2 { font-size: 20px; margin: 0 0 10px; }
.tool-cards h2 a { color: inherit; text-decoration: none; }
.tool-cards h2 a::after { content: ''; position: absolute; inset: 0; }
.tool-cards li { position: relative; }
.tool-cards p { margin: 0 0 16px; font-size: 14px; color: var(--ink-soft); flex: 1; }
.tool-cards .go { font-size: 13px; color: var(--accent-deep); font-weight: 700; }
.tool-cards .sub-link { position: relative; z-index: 1; margin-top: 10px; font-size: 12px; color: var(--muted); }
.tool-cards li.soon { border-top-color: var(--line); color: var(--muted); }
.tool-cards li.soon h2 { color: var(--muted); }

/* 説明の文章(ページの下半分) */
.article { padding: 56px 0; background: var(--surface); border-top: 1px solid var(--line); }
.article .wrap { max-width: 820px; }
.article h2 { margin-top: 40px; }
.article h2:first-child { margin-top: 0; }
.article p, .article li { color: var(--ink-soft); font-size: 15px; }
.article ul, .article ol { padding-left: 1.4em; }
.article table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 12px 0; }
.article th, .article td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; line-height: 1.7; }
.article th { background: var(--bg); font-weight: 500; white-space: nowrap; }
.article .example { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 12px 0 20px; }
.article .example > div { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; background: var(--bg); }
.article .example .label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.article .example .tate { writing-mode: vertical-rl; text-orientation: mixed; font-family: var(--serif); font-size: 17px; line-height: 2; height: 9em; color: var(--ink); margin: 0 auto; }
.article .example .tate .em { -webkit-text-emphasis: filled sesame; text-emphasis: filled sesame; -webkit-text-emphasis-position: over right; text-emphasis-position: over right; }
.article .example .tate rt { font-size: .5em; }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq details summary { cursor: pointer; font-weight: 500; list-style: none; position: relative; padding-right: 32px; font-size: 15px; color: var(--ink); }
.faq details summary::-webkit-details-marker { display: none; }
.faq details summary::after { content: '+'; position: absolute; right: 4px; top: -3px; font-size: 22px; color: var(--accent-deep); }
.faq details[open] summary::after { content: '−'; }
.faq details p { margin: 14px 0 0; font-size: 14px; }

/* 下の帯(トップページと同じ) */
footer { border-top: 1px solid var(--line); padding: 32px 0; font-size: 12px; color: var(--muted); }
footer .links { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-bottom: 16px; }
footer .links a { color: var(--ink-soft); display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 900px) {
  .tool-grid { grid-template-columns: minmax(0, 1fr); }
  textarea { min-height: 260px; }
}
@media (max-width: 640px) {
  .wrap { padding-inline: 22px; }
  header.site .wrap { min-height: 62px; }
  header.site nav { gap: 18px; font-size: 12px; }
  header.site nav a.hide-sp { display: none; }
  .page-head { padding-block: 28px 18px; }
  .page-head .lead { font-size: 14px; }
  .article { padding: 44px 0; }
  .article .example { grid-template-columns: 1fr; }
  .app-card { grid-template-columns: 48px 1fr; gap: 14px; padding: 20px; }
  .app-card img { width: 48px; height: 48px; border-radius: 11px; }
  .app-card h2 { font-size: 17px; }
  .app-card .cta .badge img { height: 40px; }
  .tool-cards li { padding: 22px; }
  footer .links { gap: 0 20px; }
}
@media print { header.site, footer, .page-head, .article, .app-card, .skip { display: none !important; } }

/* hidden 属性は display の指定より強くする */
[hidden] { display: none !important; }
html { scroll-padding-top: 90px; }
