/* Karukku reading and authoring components. No article-copy replacement. */
body.single-post.sg-wp .article-body .karukku-toc {
  margin: 34px auto 44px;
  border: 1px solid #cbd9e7;
  border-top: 3px solid #0066ff;
  background: #fff;
  color: #183249;
  font-size: 15px;
}
.karukku-toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 22px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.karukku-toc summary::-webkit-details-marker { display: none; }
.karukku-toc summary:hover { background: #f1f6ff; }
.karukku-toc .karukku-toc-state { flex-shrink: 0; color: #416080; font-size: 12px; font-weight: 500; }
.karukku-toc details[open] .toc-open,.karukku-toc details:not([open]) .toc-close { display: none; }
body.single-post.sg-wp .article-body .karukku-toc ol {
  padding: 0; margin: 0; list-style: none;
}
body.single-post.sg-wp .article-body .karukku-toc details > ol {
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px 26px;
  padding: 0 22px 20px; counter-reset: karukku-section;
}
body.single-post.sg-wp .article-body .karukku-toc li { padding: 0; margin: 0; }
.karukku-toc details > ol > li { counter-increment: karukku-section; }
body.single-post.sg-wp .article-body .karukku-toc a {
  display: flex; gap: 10px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid #e5ecf3;
  font-size: 14px; line-height: 1.7; font-weight: 500;
  color: #183249; text-decoration: none; overflow-wrap: anywhere;
}
.karukku-toc details > ol > li > a::before {
  content: counter(karukku-section,decimal-leading-zero);
  flex: 0 0 22px; color: #0066ff; font-size: 12px; font-weight: 700;
}
body.single-post.sg-wp .article-body .karukku-toc ol ol { margin-left: 32px; }
body.single-post.sg-wp .article-body .karukku-toc ol ol a { color: #466078; font-size: 13px; }
body.single-post.sg-wp .article-body .karukku-toc a:hover { color: #0050cb; text-decoration: underline; }
.karukku-toc :is(a,summary):focus-visible,
.wp-block-table.is-style-karukku-compare:focus-visible { outline: 2px solid #0066ff; outline-offset: 4px; }

:is(body.sg-wp .article-body,body.single-post .post_content,.editor-styles-wrapper) .wp-block-group:is(.is-style-karukku-point,.is-style-karukku-note,.is-style-karukku-term) {
  --part-accent: #0066ff;
  --part-bg: #f1f6ff;
  box-sizing: border-box;
  position: relative;
  padding: 22px 24px;
  margin: 28px auto;
  border: 1px solid #ccdbef;
  border-inline-start: 4px solid var(--part-accent);
  background: var(--part-bg);
  border-radius: 0;
  box-shadow: none;
  color: #183249;
  font-family: 'Karukku Noto','Hiragino Kaku Gothic ProN','Yu Gothic',Meiryo,sans-serif;
  font-size: 16px;
  line-height: 1.95;
}
:is(body.sg-wp .article-body,body.single-post .post_content,.editor-styles-wrapper) .wp-block-group.is-style-karukku-note {
  --part-accent: #bc5600; --part-bg: #fff8eb; border-color: #f1d9b4; border-inline-start-color: var(--part-accent);
}
:is(body.sg-wp .article-body,body.single-post .post_content,.editor-styles-wrapper) .wp-block-group.is-style-karukku-term {
  --part-bg: #fff; border: 1px solid #9bb9df;
}
:is(body.sg-wp .article-body,body.single-post .post_content,.editor-styles-wrapper) .wp-block-group:is(.is-style-karukku-point,.is-style-karukku-note,.is-style-karukku-term) p { margin: 12px 0 0; }
:is(body.sg-wp .article-body,body.single-post .post_content,.editor-styles-wrapper) .wp-block-group:is(.is-style-karukku-point,.is-style-karukku-note,.is-style-karukku-term) > p:first-child {
  color: var(--part-accent); margin-top: 0; font-weight: 700;
}
:is(body.sg-wp .article-body,body.single-post .post_content,.editor-styles-wrapper) .wp-block-group.is-style-karukku-term > p:first-child::before {
  content: '?'; display: inline-flex; justify-content: center; align-items: center;
  margin-right: 9px; border: 1px solid #9bb9df; width: 22px; height: 22px;
  font-size: 14px; line-height: 1; border-radius: 50%;
}
:is(body.single-post .article-body,body.single-post .post_content,.editor-styles-wrapper) .wp-block-table {
  max-width: 100%; margin: 26px auto; overflow-x: auto;
}
:is(body.single-post .article-body,body.single-post .post_content,.editor-styles-wrapper) .wp-block-table table {
  width: 100%; border-collapse: collapse; border-spacing: 0; color: #183249; font-size: 16px; line-height: 1.8;
}
:is(body.single-post .article-body,body.single-post .post_content,.editor-styles-wrapper) .wp-block-table :is(th,td) {
  padding: 13px 16px; border: 1px solid #d5e1ed; text-align: left; vertical-align: top; overflow-wrap: anywhere;
}
:is(body.single-post .article-body,body.single-post .post_content,.editor-styles-wrapper) .wp-block-table th { background: #eaf2ff; font-weight: 700; }
:is(body.single-post .article-body,body.single-post .post_content,.editor-styles-wrapper) .wp-block-table tbody tr:nth-child(even) td { background: #f7f9fc; }
:is(body.single-post .article-body,body.single-post .post_content,.editor-styles-wrapper) .wp-block-table.is-style-karukku-compare table { min-width: 560px; }
:is(body.single-post .article-body,body.single-post .post_content,.editor-styles-wrapper) .wp-block-table figcaption { margin-top: 10px; color: #52677c; font-size: 13px; line-height: 1.7; text-align: left; }
:is(body.sg-wp .article-body,body.single-post .post_content,.editor-styles-wrapper) ul.is-style-karukku-checklist { list-style: none; padding: 0; margin: 24px auto; }
:is(body.sg-wp .article-body,body.single-post .post_content,.editor-styles-wrapper) ul.is-style-karukku-checklist > li { position: relative; padding: 10px 0 10px 30px; margin: 0; border-bottom: 1px solid #dce5ee; }
:is(body.sg-wp .article-body,body.single-post .post_content,.editor-styles-wrapper) ul.is-style-karukku-checklist > li::before {
  content: ''; position: absolute; left: 4px; top: 17px; width: 7px; height: 12px;
  border: solid #0066ff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
@media(max-width:700px) {
  body.single-post.sg-wp .article-body .karukku-toc details > ol { grid-template-columns: 1fr; padding: 0 17px 16px; }
  .karukku-toc summary { padding: 15px 17px; }
  :is(body.sg-wp .article-body,body.single-post .post_content,.editor-styles-wrapper) .wp-block-group:is(.is-style-karukku-point,.is-style-karukku-note,.is-style-karukku-term) { padding: 18px; }
}
@media print { .karukku-toc { display: none; } }
