@charset "UTF-8";

html {
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: #f7f8fb;
  color: #222;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Hiragino Sans",
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    Meiryo,
    sans-serif;
  line-height: 1.75;
  word-break: break-word;
}

a {
  color: #1d4ed8;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px;
}

.page-header {
  margin-bottom: 16px;
}

.site-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.site-title a {
  color: #111827;
  text-decoration: none;
}

.site-title a:hover {
  text-decoration: none;
}

.law-card,
.search-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.error-box {
  background: #fff1f2;
  color: #9f1239;
  border: 1px solid #fecdd3;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.back-link-wrap {
  margin: 14px 0;
}

.back-link {
  display: inline-block;
  padding: 8px 12px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  color: #3730a3;
  font-weight: 600;
}

.back-link:hover {
  background: #e0e7ff;
  text-decoration: none;
}

.law-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.law-nav-links .back-link {
  margin: 0;
}

@media (max-width: 768px) {
  .law-nav-links {
    gap: 8px;
  }
}

/* law_view.cgi */
.law-page .law-main {
  display: block;
}

.law-header {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5e7eb;
}

.law-title {
  margin: 0 0 12px 0;
  font-size: 28px;
  line-height: 1.4;
  font-weight: 700;
  color: #111827;
}

.law-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.law-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
}

.meta-label {
  min-width: 80px;
  font-weight: 700;
  color: #374151;
}

.meta-value {
  color: #111827;
}

.article-toc {
  margin: 0 0 22px 0;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.article-toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.article-toc-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.article-toc-top-link {
  font-size: 13px;
  color: #475569;
}

.article-toc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-toc-link {
  display: inline-block;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.4;
  color: #1e3a8a;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
}

.article-toc-link:hover {
  background: #dbeafe;
  text-decoration: none;
}

/* law_view.cgi 目次 案1（標準強化型） */
.law-structure-toc.article-toc {
  padding: 16px;
}

.law-structure-toc .article-toc-list,
.law-structure-toc-tree,
.law-structure-toc-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.law-structure-toc .article-toc-list,
.law-structure-toc .law-structure-toc-tree-root {
  display: block;
}

.law-structure-toc .law-structure-toc-item {
  position: relative;
  margin: 0 0 8px 0;
}

.law-structure-toc .law-structure-toc-item:last-child {
  margin-bottom: 0;
}

.law-structure-toc .law-structure-toc-tree-child {
  margin-top: 8px;
  margin-left: 18px;
  padding-left: 14px;
  border-left: 2px solid #dbeafe;
}

.law-structure-toc .law-structure-toc-link {
  display: block;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid #dbeafe;
  background: #ffffff;
  color: #1e3a8a;
}

.law-structure-toc .law-structure-toc-link:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  text-decoration: none;
}

.law-structure-toc .law-structure-toc-item-part > .law-structure-toc-link,
.law-structure-toc .law-structure-toc-item-chapter > .law-structure-toc-link,
.law-structure-toc .law-structure-toc-item-preamble > .law-structure-toc-link,
.law-structure-toc .law-structure-toc-item-suppl-provision > .law-structure-toc-link {
  font-weight: 700;
  color: #0f172a;
  background: #f8fafc;
}

.law-structure-toc .law-structure-toc-item-article > .law-structure-toc-link,
.law-structure-toc .law-structure-toc-item-section > .law-structure-toc-link,
.law-structure-toc .law-structure-toc-item-subsection > .law-structure-toc-link,
.law-structure-toc .law-structure-toc-item-division > .law-structure-toc-link {
  font-weight: 600;
  color: #1f2937;
}

.law-content {
  font-size: 16px;
}

.law-body {
  display: block;
}

.law-empty {
  padding: 14px;
  color: #6b7280;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
}

.article-block {
  margin: 0 0 28px 0;
  padding-top: 8px;
  scroll-margin-top: 16px;
}

.article-head {
  margin-bottom: 10px;
}

.article-title {
  margin: 0 0 8px 0;
  padding: 8px 0 8px 0;
  font-size: 18px;
  line-height: 1.5;
  font-weight: 700;
  color: #111827;
  border-bottom: 2px solid #dbeafe;
}

.article-num-label {
  display: inline-block;
}

.article-caption {
  margin: 0 0 12px 0;
  color: #4b5563;
  font-size: 17px;
  line-height: 1.7;
  font-weight: 600;
}

.article-body-block,
.preamble-body-block {
  margin: 0 0 14px 0;
  padding: 10px 12px;
  background: #fcfcfd;
  border-left: 4px solid #d1d5db;
  border-radius: 6px;
  scroll-margin-top: 16px;
}

.paragraph-block {
  margin: 0 0 14px 0;
  padding: 10px 0;
  background: transparent;
  border-left: none;
  border-radius: 0;
  scroll-margin-top: 16px;
}

.article-body-block > .paragraph-block:last-child,
.preamble-body-block > .paragraph-block:last-child {
  margin-bottom: 0;
}

.paragraph-head {
  margin-bottom: 6px;
}

.paragraph-num {
  display: inline-block;
  min-width: 2em;
  font-weight: 700;
  color: #1f2937;
}

.paragraph-body {
  margin: 0;
}

.sentence {
  margin: 0 0 8px 0;
}

.sentence:last-child {
  margin-bottom: 0;
}

.item-list {
  margin-top: 8px;
}

.item-block {
  margin: 6px 0;
  padding-left: 1.2em;
  text-indent: -1.2em;
}

.item-title {
  font-weight: 700;
  color: #111827;
}

.item-term {
  font-weight: 600;
  color: #1f2937;
}

.item-sep {
  white-space: pre;
}

.item-desc {
  color: #111827;
}

.article-footer {
  margin-top: 10px;
  text-align: right;
}

.back-to-top-link {
  font-size: 13px;
  color: #475569;
}

.floating-top-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #1d4ed8;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  font-weight: 700;
  text-decoration: none;
  z-index: 999;
}

.floating-top-button:hover {
  background: #1e40af;
  text-decoration: none;
}

/* search.cgi */
.search-page .search-main {
  display: block;
}

.search-page > .container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px;
}

.search-card {
  width: 100%;
  box-sizing: border-box;
}

.search-form {
  width: 100%;
  margin: 0 0 16px 0;
}

.search-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.search-input {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-width: 400px;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.5;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
}

.search-button {
  flex: 0 0 auto;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: #2563eb;
  border: 1px solid #2563eb;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.search-button:hover {
  background: #1d4ed8;
}

.result-count {
  margin: 10px 0 16px 0;
  font-size: 14px;
  color: #374151;
}

.result-list {
  display: grid;
  gap: 12px;
}

.result-item {
  padding: 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.result-title {
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 700;
}

.result-meta {
  font-size: 13px;
  color: #6b7280;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  align-items: center;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 8px 11px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  line-height: 1.2;
}

.pagination .current {
  font-weight: 700;
  color: #111827;
  background: #eef2ff;
  border-color: #c7d2fe;
}

.pagination .ellipsis {
  border: none;
  background: transparent;
  padding: 0 4px;
}

@media (max-width: 768px) {
  .container {
    padding: 12px;
  }

  .law-card,
  .search-card {
    padding: 16px;
    border-radius: 10px;
  }

  .law-title {
    font-size: 23px;
  }

  .article-title {
    font-size: 17px;
  }

  .article-caption {
    font-size: 15px;
  }

  .article-toc-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .article-toc-list {
    gap: 6px;
  }

  .article-toc-link {
    font-size: 12px;
    padding: 5px 9px;
  }

  .law-structure-toc .law-structure-toc-tree-child {
    margin-left: 12px;
    padding-left: 10px;
  }

  .law-structure-toc .law-structure-toc-link {
    padding: 8px 10px;
  }

  .article-body-block,
  .preamble-body-block {
    padding: 10px;
  }

  .paragraph-block {
    padding: 10px 0;
  }

  .search-form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .search-input {
    min-width: 0;
    width: 100%;
  }

  .search-button {
    width: 100%;
  }

  .floating-top-button {
    right: 12px;
    bottom: 12px;
    width: 38px;
    height: 38px;
  }
}

/* law_view.cgi minimal refinements for rebuilt HTML */
.structure-block {
  margin: 0 0 24px 0;
}

.part-block,
.chapter-block,
.suppl-provision-block {
  margin-bottom: 30px;
}

.section-block,
.subsection-block,
.division-block {
  margin-bottom: 18px;
}

.section-title,
.subsection-title,
.division-title {
  display: block;
  margin: 4px 0 10px 0;
  padding-left: 2px;
  font-weight: 700;
}

.section-title {
  font-size: 20px;
  color: #1f2937;
}

.subsection-title {
  font-size: 18px;
  color: #334155;
}

.division-title {
  font-size: 17px;
  color: #475569;
}

.paragraph-head {
  display: flex;
  align-items: flex-start;
  gap: 0.45em;
}

.paragraph-num {
  flex: 0 0 auto;
  min-width: 2.2em;
}

.paragraph-body {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.paragraph-head .sentence {
  display: inline;
  margin: 0;
}

.item-entry {
  margin: 6px 0;
}

.item-list {
  margin-top: 8px;
}

.item-entry > .item-list {
  margin: 6px 0 0 1.1em;
  padding-left: 0.9em;
  border-left: 2px solid #e5e7eb;
}

.item-block {
  line-height: 1.8;
}

.item-title,
.item-desc {
  display: inline;
}

.item-block[class*="subitem"] {
  padding-left: 1.5em;
  text-indent: -1.5em;
}

.part-title,
.chapter-title,
.suppl-provision-title {
  margin-top: 4px;
}

@media (max-width: 768px) {
  .section-title,
  .subsection-title,
  .division-title {
    margin-bottom: 8px;
  }

  .section-title {
    font-size: 18px;
  }

  .subsection-title {
    font-size: 16px;
  }

  .division-title {
    font-size: 15px;
  }

  .paragraph-head {
    gap: 0.35em;
  }

  .paragraph-num {
    min-width: 1.8em;
  }

  .item-entry > .item-list {
    margin-left: 0.8em;
    padding-left: 0.7em;
  }
}


.result-title a {
  color: #111827;
  text-decoration: none;
}

.result-title a:hover {
  text-decoration: underline;
}

.article-toc {
  margin-bottom: 22px;
}


/* topics.cgi */
.topic-page .topic-main {
  display: block;
}

.topic-intro {
  margin: 0 0 16px 0;
  font-size: 15px;
  line-height: 1.8;
  color: #374151;
}

.topic-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px 0;
}

.topic-count-badge {
  display: inline-block;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
}

.topic-list-note,
.topic-index-desc,
.topic-index-meta {
  font-size: 14px;
  line-height: 1.7;
  color: #6b7280;
}

.topic-index-card .result-title,
.topic-law-card .result-title {
  margin-bottom: 8px;
}

/* admin */
.admin-container {
  max-width: 1100px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.admin-top-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 14px 0;
}

.admin-card {
  margin-bottom: 18px;
}

.admin-form {
  display: block;
}

.admin-subform {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5e7eb;
}

.admin-form-row {
  margin: 0 0 14px 0;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-law-add-grid {
  grid-template-columns: 2fr 1fr 2fr;
}

.admin-label {
  display: block;
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 700;
  color: #374151;
}

.admin-help {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.7;
  color: #6b7280;
}

.admin-textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.7;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-sizing: border-box;
  resize: vertical;
  background: #fff;
}

.admin-checkbox-row {
  display: flex;
  align-items: center;
}

.admin-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: #111827;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  line-height: 1.6;
}

.admin-table th {
  background: #f8fafc;
  font-weight: 700;
  color: #374151;
}

.admin-link-button {
  display: inline-block;
  padding: 7px 11px;
  font-size: 13px;
  line-height: 1.2;
  color: #fff;
  background: #2563eb;
  border: 1px solid #2563eb;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
}

.admin-link-button:hover {
  background: #1d4ed8;
}

.admin-link-secondary {
  background: #fff;
  color: #1f2937;
  border-color: #d1d5db;
}

.admin-link-secondary:hover {
  background: #f8fafc;
}

.admin-link-danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.admin-link-danger:hover {
  background: #b91c1c;
}

.admin-order-input {
  width: 90px;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-sizing: border-box;
}

.admin-note-input {
  min-width: 220px;
}

.admin-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.admin-badge-public {
  color: #065f46;
  background: #d1fae5;
}

.admin-badge-private {
  color: #92400e;
  background: #fef3c7;
}

.admin-flash {
  margin: 0 0 14px 0;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.7;
}

.admin-flash-success {
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.admin-flash-error {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.admin-danger-card {
  border-color: #fecaca;
}

@media (max-width: 768px) {
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-form-grid,
  .admin-law-add-grid {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-link-button,
  .admin-actions .back-link,
  .admin-actions .search-button {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }
}


.search-input-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.search-input-wrap .search-input {
  min-width: 0;
}

.search-history-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

.search-history-header {
  padding: 10px 12px 8px;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

.search-history-list {
  max-height: 320px;
  overflow-y: auto;
}

.search-history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.search-history-item:last-child {
  border-bottom: none;
}

.search-history-select {
  flex: 1 1 auto;
  min-width: 0;
  padding: 11px 12px;
  border: none;
  background: #fff;
  text-align: left;
  font-size: 15px;
  line-height: 1.5;
  color: #111827;
  cursor: pointer;
}

.search-history-select:hover {
  background: #f8fafc;
}

.search-history-remove {
  flex: 0 0 auto;
  margin-right: 8px;
  width: 30px;
  height: 30px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  color: #6b7280;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.search-history-remove:hover {
  background: #f3f4f6;
  color: #111827;
}

.search-history-empty {
  padding: 14px 12px;
  font-size: 14px;
  color: #6b7280;
}

.search-history-footer {
  display: flex;
  justify-content: flex-end;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}

.search-history-clear {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
}

.search-history-clear:hover {
  background: #f8fafc;
}

.search-history-clear:disabled {
  opacity: 0.5;
  cursor: default;
}

.search-history-note {
  padding: 0 12px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #6b7280;
  background: #fff;
}

@media (max-width: 768px) {
  .search-history-dropdown {
    left: 0;
    right: 0;
  }

  .search-history-select {
    font-size: 14px;
  }
}


.search-empty-state {
  margin: 2px 0 18px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.search-empty-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.search-empty-text {
  font-size: 14px;
  color: #475569;
}

.recent-laws-panel {
  margin-top: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.recent-laws-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

.recent-laws-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #111827;
}

.recent-laws-list {
  display: grid;
  gap: 0;
}

.recent-laws-item {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.recent-laws-item:last-child {
  border-bottom: none;
}

.recent-laws-link {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
  overflow: hidden;
}

.recent-laws-link:hover {
  text-decoration: none;
}

.recent-laws-law-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 16px;
  font-weight: 700;
  color: #1d4ed8;
}

.recent-laws-law-num {
  flex: 0 0 auto;
  font-size: 13px;
  color: #4b5563;
}

.recent-laws-meta {
  flex: 0 0 auto;
  margin-top: 0;
  font-size: 12px;
  color: #6b7280;
}

.recent-laws-remove {
  flex: 0 0 auto;
  align-self: center;
  width: 30px;
  height: 30px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  color: #6b7280;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.recent-laws-remove:hover {
  background: #f3f4f6;
  color: #111827;
}

.recent-laws-empty {
  padding: 14px 16px;
  font-size: 14px;
  color: #6b7280;
}

.recent-laws-note {
  padding: 0 16px 14px;
  font-size: 12px;
  line-height: 1.5;
  color: #6b7280;
}


@media (max-width: 768px) {
  .recent-laws-item {
    align-items: flex-start;
  }

  .recent-laws-link {
    display: block;
    white-space: normal;
  }

  .recent-laws-law-title,
  .recent-laws-law-num,
  .recent-laws-meta {
    display: inline;
  }
}



/* rebuild_html_from_xml.py nested item hierarchy refinements */
.law-indent-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  min-width: 0;
}

.law-label {
  flex: 0 0 auto;
  min-width: 2.2em;
}

.law-text {
  flex: 1 1 auto;
  min-width: 0;
}

.item-entry {
  margin: 6px 0;
}

.item-list {
  margin-top: 8px;
}

.item-entry > .item-list {
  margin: 6px 0 0 0;
  padding-left: 0;
  border-left: none;
}

.item-block {
  padding-left: 0;
  text-indent: 0;
  line-height: 1.8;
}

.item-level-1 {
  margin-left: 1.4em;
}

.item-level-2 {
  margin-left: 2.8em;
}

.item-level-3 {
  margin-left: 4.2em;
}

.item-level-4 {
  margin-left: 5.6em;
}

.item-level-5 {
  margin-left: 7em;
}

.item-level-6 {
  margin-left: 8.4em;
}

.item-title {
  display: inline-block;
  min-width: 2.2em;
  font-weight: 700;
  color: #111827;
}

.item-title-empty {
  min-width: 0;
  width: 0;
}

.item-text {
  display: block;
}

.item-term,
.item-desc {
  display: inline;
}

.item-term {
  font-weight: 600;
  color: #1f2937;
}

.item-desc {
  color: #111827;
}

@media (max-width: 768px) {
  .law-label,
  .item-title {
    min-width: 1.9em;
  }

  .item-level-1 {
    margin-left: 1.1em;
  }

  .item-level-2 {
    margin-left: 2.2em;
  }

  .item-level-3 {
    margin-left: 3.3em;
  }

  .item-level-4 {
    margin-left: 4.4em;
  }

  .item-level-5 {
    margin-left: 5.5em;
  }

  .item-level-6 {
    margin-left: 6.6em;
  }
}

/* Paragraph numbers after the first are rendered inline with the text */
.paragraph-head {
  display: block;
}

.paragraph-num {
  display: none;
}

.paragraph-body {
  display: block;
}

.paragraph-inline-num {
  font-weight: 600;
  color: inherit;
}

.paragraph-head .sentence {
  display: inline;
  margin: 0;
}

.paragraph-block.no-paragraph-num .paragraph-head {
  display: block;
}

.paragraph-block.no-paragraph-num .paragraph-body {
  display: block;
}


.site-title-wrap {
  display: block;
}


/* category / related / classification links */
.result-meta-field,
.jcxrel-meta-field {
  display: inline;
}

.result-meta-sep,
.jcxrel-meta-sep {
  color: #94a3b8;
}

.law-category-link {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
}

.law-category-link:hover {
  text-decoration: underline;
}

.law-category-link-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  line-height: 1.2;
}

.law-category-link-badge:hover {
  background: #dbeafe;
  text-decoration: none;
}

.category-page .category-main {
  display: block;
}

.jcxcat-index-card .result-title,
.jcxcat-law-card .result-title,
.jcxtheme-related-card .result-title {
  margin-bottom: 8px;
}

.law-related-section {
  margin-top: 32px;
}

.jcxrel-section {
  margin-top: 0;
  padding: 24px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.jcxrel-section .jcxrel-header {
  margin-bottom: 12px;
}

.jcxrel-section .jcxrel-note {
  margin: 0 0 18px 0;
}

@media (max-width: 768px) {
  .law-related-section {
    margin-top: 24px;
  }

  .jcxrel-section {
    padding: 18px 16px;
  }
}

.jcxrel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.jcxrel-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

.jcxrel-note,
.jcxtheme-related-note {
  margin: 0 0 14px 0;
  font-size: 14px;
  line-height: 1.7;
  color: #6b7280;
}

.jcxrel-more-link {
  font-size: 14px;
  font-weight: 700;
}

.jcxrel-list {
  display: grid;
  gap: 12px;
}

.jcxrel-item {
  padding: 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.jcxrel-item-title {
  margin: 0 0 6px 0;
  font-size: 16px;
  font-weight: 700;
}

.jcxrel-item-title a {
  color: #111827;
  text-decoration: none;
}

.jcxrel-item-title a:hover {
  text-decoration: underline;
}

.jcxrel-item-meta {
  font-size: 13px;
  line-height: 1.7;
  color: #6b7280;
}

.jcxtheme-badges {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.jcxtheme-related-section {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

.jcxtheme-related-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.jcxtheme-related-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

@media (max-width: 768px) {
  .jcxrel-title,
  .jcxtheme-related-title {
    font-size: 18px;
  }

  .jcxrel-header,
  .jcxtheme-related-header {
    align-items: flex-start;
  }

  .law-category-link-badge {
    padding: 5px 9px;
    font-size: 13px;
  }
}

.jcxtheme-badge-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}


/* category sort controls */
.jcxcat-detail-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 16px;
}

.jcxcat-sort-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.jcxcat-sort-label {
  font-size: 0.95rem;
  color: #555;
}

.jcxcat-sort-select {
  min-width: 180px;
  padding: 8px 10px;
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  background: #fff;
  font-size: 0.95rem;
}

.jcxcat-sort-button {
  padding: 8px 12px;
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

@media (max-width: 640px) {
  .jcxcat-detail-toolbar {
    justify-content: flex-start;
  }

  .jcxcat-sort-form {
    width: 100%;
  }

  .jcxcat-sort-select {
    width: 100%;
  }
}


/* index.cgi / home */
.home-page .container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px;
}

.home-page .page-header {
  margin-bottom: 22px;
  text-align: left;
}

/* shared site header */
.site-global-header {
  margin: 0;
  padding: 20px 0 8px;
}

.site-global-header .container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.home-page > .container.home-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 16px 12px;
}

.home-header.site-global-header {
  padding-top: 10px;
}

.site-global-brand {
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-start;
  max-width: 100%;
  text-decoration: none;
  line-height: 0;
}

.site-global-brand:hover {
  text-decoration: none;
}

.site-global-logo {
  display: block;
  width: 240px;
  height: auto;
  max-width: 100%;
  vertical-align: top;
}

.home-brand {
  display: inline-block;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 700;
  color: #111827;
  text-decoration: none;
}

.home-brand:hover {
  text-decoration: none;
}

.home-main {
  display: block;
}

.home-hero {
  margin: 0 auto 18px;
  padding: 32px 28px;
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.home-kicker {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #1e3a8a;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
}

.home-title {
  margin: 0 0 10px;
  font-size: 36px;
  line-height: 1.3;
  color: #111827;
}

.home-subtitle {
  max-width: 820px;
  margin: 0 auto 20px;
  font-size: 17px;
  line-height: 1.8;
  color: #475569;
}

.home-search-card {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px;
  background: #ffffff;
  border: 1px solid #dbeafe;
  border-radius: 12px;
}

.home-search-form {
  position: relative;
  margin: 0;
}

.home-search-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.home-search-input-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.home-search-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 56px;
  padding: 0 18px;
  font-size: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
}

.home-search-input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
}

.home-search-button {
  flex: 0 0 auto;
  min-width: 130px;
  height: 56px;
  padding: 0 22px;
  font-size: 17px;
  font-weight: 700;
  border: 1px solid #2563eb;
  border-radius: 12px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}

.home-search-button:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.home-search-help {
  margin: 12px 0 0;
  font-size: 14px;
  color: #64748b;
}

.home-search-help-link {
  display: inline-block;
  margin: 4px 6px 0;
  padding: 4px 8px;
  font-weight: 700;
  color: #1e3a8a;
  background: #eff6ff;
  border-radius: 8px;
}

.home-grid {
  display: grid;
  gap: 18px;
}

.home-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-top: 18px;
}

.home-section-title {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.4;
  color: #111827;
  text-align: center;
}

.home-section-desc {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.8;
  color: #475569;
  text-align: center;
}

.home-route-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-route-card {
  display: block;
  padding: 16px 18px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #111827;
  text-decoration: none;
}

.home-route-card:hover,
.home-law-link:hover,
.home-type-link:hover,
.home-category-block:hover {
  background: #f1f5f9;
  text-decoration: none;
}

.home-route-title,
.home-law-link strong,
.home-type-link strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
  color: #111827;
}

.home-route-desc,
.home-law-link span,
.home-type-link span {
  display: block;
  font-size: 13px;
  line-height: 1.7;
  color: #64748b;
}

.home-law-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-law-link,
.home-type-link {
  display: block;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #111827;
  text-decoration: none;
}

.home-type-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.home-category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.home-category-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 78px;
  padding: 12px 10px;
  text-align: center;
  line-height: 1.45;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-sizing: border-box;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.home-category-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.home-category-count {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.home-category-block:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.home-category-footer {
  margin-top: 16px;
  text-align: center;
}

.home-category-more {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-weight: 700;
}

.home-category-more:hover {
  background: #dbeafe;
  text-decoration: none;
}

.home-footer {
  margin-top: 22px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
  line-height: 1.8;
}

.home-footer a {
  color: #334155;
}

.home-footer-sep {
  padding: 0 0.5em;
  color: #94a3b8;
}

@media (max-width: 1024px) {
  .home-category-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .home-type-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .home-route-grid {
    grid-template-columns: 1fr;
  }

  .home-category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-type-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .home-page > .container.home-shell {
    padding-top: 10px;
    padding-bottom: 28px;
  }

  .site-global-header {
    padding-top: 8px;
  }

  .site-global-header .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .home-brand {
    font-size: 26px;
  }

  .home-hero {
    padding: 24px 16px;
    border-radius: 12px;
  }

  .home-title {
    font-size: 28px;
  }

  .home-subtitle {
    font-size: 15px;
  }

  .home-search-card,
  .home-section {
    padding: 16px;
  }

  .home-search-row {
    flex-direction: column;
  }

  .home-search-button {
    width: 100%;
  }

  .home-law-grid,
  .home-type-grid,
  .home-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .home-law-grid,
  .home-type-grid,
  .home-route-grid {
    grid-template-columns: 1fr;
  }

  .home-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* home header logo sizing */
.home-header .site-global-brand {
  display: inline-flex;
  align-items: flex-start;
}

@media (max-width: 768px) {
  .site-global-logo {
    width: min 320px;
  }
}


/* header spacing fix */
.site-global-header .container {
  padding-top: 0;
  padding-bottom: 0;
}

.site-global-brand {
  line-height: 0;
}

/* site footer: portal dark (integrated from footer proposal HTML) */
.site-global-footer.site-global-footer-portal-dark {
  margin-top: 40px;
  padding: 32px 0 28px;
  background: #0f172a;
}

.site-global-footer.site-global-footer-portal-dark .container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.site-global-footer.site-global-footer-portal-dark .site-global-footer-main {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.site-global-footer.site-global-footer-portal-dark .site-global-footer-block {
  min-width: 0;
}

.site-global-footer.site-global-footer-portal-dark .site-global-footer-heading {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
}

.site-global-footer.site-global-footer-portal-dark .site-global-footer-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: #cbd5e1;
}

.site-global-footer.site-global-footer-portal-dark .site-global-footer-list {
  display: grid;
  gap: 8px;
}

.site-global-footer.site-global-footer-portal-dark .site-global-footer-list a {
  font-size: 14px;
  line-height: 1.7;
  color: #dbeafe;
  text-decoration: none;
}

.site-global-footer.site-global-footer-portal-dark .site-global-footer-list a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.site-global-footer.site-global-footer-portal-dark .site-global-footer-bottom {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.site-global-footer.site-global-footer-portal-dark .site-global-footer-meta {
  margin: 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
  color: #94a3b8;
}

@media (max-width: 768px) {
  .site-global-footer.site-global-footer-portal-dark {
    margin-top: 32px;
    padding-top: 28px;
    padding-bottom: 24px;
  }

  .site-global-footer.site-global-footer-portal-dark .site-global-footer-main {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .site-global-footer.site-global-footer-portal-dark .site-global-footer-bottom {
    margin-top: 18px;
    padding-top: 12px;
  }
}


/* index.cgi top search full-width band */
.home-search-band {
  width: 100%;
  margin: 0 0 18px 0;
  padding: 50px 0 60px;
  background: radial-gradient(circle at top left, #1e3a8a 0%, #0f172a 58%, #0b1220 100%);
}

.home-search-band-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.home-search-band-card {
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 22px 60px rgba(2, 6, 23, 0.34);
}

@media (max-width: 768px) {
  .home-search-band {
    padding: 32px 0 38px;
    margin-bottom: 16px;
  }

  .home-search-band-inner {
    padding: 0 12px;
  }

  .home-search-band-card {
    padding: 16px;
    border-radius: 12px;
  }
}


/* contact.cgi fallback (template load error only) */
.page-contact-fallback {
  padding: 40px 16px;
}

.jcxrel-footer {
  margin-top: 14px;
  text-align: right;
}


/* breadcrumb */
.jcx-breadcrumb {
  margin: 12px 0 16px;
  font-size: 14px;
  color: #6b7280;
}
.jcx-breadcrumb a {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
}
.jcx-breadcrumb a:hover {
  text-decoration: underline;
}
.jcx-breadcrumb-sep {
  margin: 0 6px;
  color: #9ca3af;
}


/* header layout fix */
.site-global-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-global-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-global-nav-link {
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
  text-decoration: none;
}

.site-global-nav-link:hover {
  color: #1d4ed8;
  text-decoration: none;
}

.site-global-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
}

.site-global-menu-toggle:hover {
  background: #f8fafc;
  text-decoration: none;
}

.site-global-menu-toggle:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.site-global-menu-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #1f2937;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-global-menu-toggle[aria-expanded="true"] .site-global-menu-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-global-menu-toggle[aria-expanded="true"] .site-global-menu-toggle-bar:nth-child(2) {
  opacity: 0;
}

.site-global-menu-toggle[aria-expanded="true"] .site-global-menu-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
  .site-global-header-inner {
    position: relative;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
  }

  .site-global-menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .site-global-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 4px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-sizing: border-box;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  }

  .site-global-nav.is-open {
    display: flex;
  }

  .site-global-nav-link {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
  }

  .site-global-nav-link:hover {
    background: #eff6ff;
    text-decoration: none;
  }
}



/* =========================
   パンくずリスト
========================= */
.breadcrumb {
  max-width: 1120px;
  margin: 12px auto 8px;
  padding: 0 16px;
  font-size: 13px;
  color: #6b7280;
}

.breadcrumb a {
  color: #6b7280;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  margin: 0 6px;
  color: #9ca3af;
}



/* =========================
   角丸なし
========================= */
.law-card,
.search-card,
.home-search-band-card,
.home-section {
  border-radius: 0 !important;
}
/* admin feedback messages */
.admin-error {
  margin-top: 8px;
  color: #b91c1c;
  font-size: 14px;
  line-height: 1.7;
  font-weight: 700;
}

.admin-success {
  margin: 0 0 14px 0;
  padding: 12px 14px;
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.7;
  font-weight: 700;
}


.admin-page-title {
  margin: 0;
}

.admin-page-note {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: #6b7280;
}

.admin-login-card {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.admin-dashboard-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.admin-dashboard-user {
  font-size: 14px;
  color: #374151;
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.admin-dashboard-card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
}

.admin-dashboard-card-disabled {
  opacity: 0.92;
}

.admin-dashboard-title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

.admin-dashboard-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: #4b5563;
}

.admin-link-disabled {
  cursor: default;
  pointer-events: none;
}

.admin-placeholder-box {
  margin-top: 10px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
}

.admin-placeholder-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

.admin-placeholder-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: #475569;
}

@media (max-width: 900px) {
  .admin-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* search.cgi law type link: match category link */
.law-type-link {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
}

.law-type-link:hover {
  text-decoration: underline;
}


.search-suggestion-box {
  margin: 0 0 16px 0;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.search-suggestion-title {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.search-suggestion-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-suggestion-link {
  display: inline-block;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.4;
  color: #1e3a8a;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
}

.search-suggestion-link:hover {
  background: #dbeafe;
  text-decoration: none;
}

/* search.cgi suggestion UI */
.search-suggestion-box {
  margin: 0 0 16px 0;
  padding: 14px 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #60a5fa;
}

.search-suggestion-title {
  margin: 0 0 6px 0;
  font-size: 15px;
  line-height: 1.7;
  font-weight: 700;
  color: #1e3a8a;
}

.search-suggestion-note {
  margin: 0 0 10px 0;
  font-size: 13px;
  line-height: 1.6;
  color: #475569;
}

.search-suggestion-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-suggestion-link {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  background: #ffffff;
  border: 1px solid #93c5fd;
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.search-suggestion-link:hover {
  background: #dbeafe;
  text-decoration: none;
}

@media (max-width: 768px) {
  .search-suggestion-box {
    padding: 12px;
  }

  .search-suggestion-title {
    font-size: 14px;
  }

  .search-suggestion-links {
    flex-direction: column;
    align-items: stretch;
  }

  .search-suggestion-link {
    justify-content: center;
  }
}

.result-count-box {
  margin: 10px 0 16px 0;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.result-count-total {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 700;
  color: #374151;
}

.result-count-breakdown {
  font-size: 14px;
  line-height: 1.75;
  font-weight: 400;
  color: #374151;
}

.result-count-item {
  display: inline;
  font-size: inherit;
  line-height: inherit;
  font-weight: 400;
  color: inherit;
}

.result-count-sep {
  color: #6b7280;
}

@media (max-width: 768px) {
  .result-count-box {
    padding: 12px 14px;
  }

  .result-count-total,
  .result-count-breakdown {
    font-size: 14px;
  }
}


/* =========================================================
   JapanCodex redesign v1
   見た目優先のUI整理
   ========================================================= */
:root {
  --jcx-bg: #f4f7fb;
  --jcx-surface: #ffffff;
  --jcx-surface-muted: #f8fafc;
  --jcx-border: #e2e8f0;
  --jcx-border-strong: #cbd5e1;
  --jcx-text: #0f172a;
  --jcx-text-soft: #475569;
  --jcx-text-faint: #64748b;
  --jcx-accent: #1d4ed8;
  --jcx-accent-strong: #1e40af;
  --jcx-shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.05);
  --jcx-shadow-md: 0 18px 40px rgba(15, 23, 42, 0.08);
  --jcx-radius-lg: 18px;
  --jcx-radius-md: 14px;
  --jcx-radius-sm: 10px;
}

body {
  background:
    radial-gradient(circle at top, rgba(29, 78, 216, 0.05), transparent 28%),
    var(--jcx-bg);
  color: var(--jcx-text);
}

.container {
  max-width: 1120px;
}

.law-card,
.search-card,
.result-item,
.recent-laws-panel,
.home-route-card,
.home-law-link,
.home-type-link,
.home-category-block,
.search-empty-state,
.result-count-box,
.jcxrel-item {
  border-color: var(--jcx-border);
  box-shadow: var(--jcx-shadow-sm);
}



/* fixed header anchor offset */
:root {
  --site-anchor-offset: 96px;
}

html {
  scroll-padding-top: var(--site-anchor-offset);
}

.law-page [id^="article-"],
.law-page [id^="paragraph-"],
.law-page [id^="item-"],
.law-page [id^="suppl-provision-"],
.law-page [id^="chapter-"],
.law-page [id^="section-"],
.law-page [id^="subsection-"],
.law-page [id^="division-"] {
  scroll-margin-top: var(--site-anchor-offset);
}

@media (max-width: 768px) {
  :root {
    --site-anchor-offset: 84px;
  }
}

.site-global-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.site-global-header-inner {
  min-height: 72px;
}

.site-global-nav-link {
  position: relative;
  font-weight: 600;
}

.site-global-nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 2px;
  background: transparent;
  transition: background 0.2s ease;
}

.site-global-nav-link:hover::after {
  background: var(--jcx-accent);
}

.breadcrumb {
  max-width: 1120px;
  margin: 18px auto 0;
  padding: 0 16px;
  font-size: 13px;
  color: var(--jcx-text-faint);
}

.breadcrumb a {
  color: var(--jcx-text-soft);
}

.breadcrumb-sep {
  margin: 0 8px;
  color: #94a3b8;
}

.home-search-band {
  padding: 34px 16px 10px;
}

.home-search-band-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.home-search-band-card {
  padding: 34px;
  border: 1px solid rgba(191, 219, 254, 0.95);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
  box-shadow: var(--jcx-shadow-md);
}

.home-hero-copy {
  max-width: 720px;
  margin-bottom: 20px;
}

.home-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: var(--jcx-accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.home-hero-title {
  margin: 0 0 12px;
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #0b1324;
}

.home-hero-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.9;
  color: var(--jcx-text-soft);
}

.home-search-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.home-search-input {
  display: block;
  width: 100%;
  min-height: 60px;
  padding: 16px 18px;
  border: 1px solid var(--jcx-border-strong);
  border-radius: 16px;
  background: #fff;
  font-size: 18px;
  box-sizing: border-box;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

.home-search-input:focus,
.search-input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.home-search-button {
  min-width: 132px;
  min-height: 60px;
  padding: 0 24px;
  border: 1px solid var(--jcx-accent);
  border-radius: 16px;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.2);
}

.home-search-button:hover,
.search-button:hover {
  background: linear-gradient(180deg, #1d4ed8, #1e40af);
  text-decoration: none;
}

.home-search-help {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.home-search-help-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--jcx-border);
  font-size: 13px;
  color: var(--jcx-text-soft);
}

.home-shell {
  padding-top: 12px;
  padding-bottom: 30px;
}

.home-main {
  display: grid;
  gap: 22px;
}

.home-section {
  padding: 22px;
  border: 1px solid var(--jcx-border);
  border-radius: var(--jcx-radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--jcx-shadow-sm);
}

.home-section-title {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.35;
  color: #0f172a;
}

.home-section-lead {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--jcx-text-soft);
}

.home-type-grid,
.home-category-grid,
.home-law-grid,
.home-route-grid {
  display: grid;
  gap: 14px;
}

.home-type-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.home-category-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.home-route-grid,
.home-law-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.home-route-card,
.home-law-link,
.home-type-link,
.home-category-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 92px;
  padding: 18px;
  border-radius: 16px;
  background: #fff;
  color: var(--jcx-text);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-route-card:hover,
.home-law-link:hover,
.home-type-link:hover,
.home-category-block:hover,
.result-item:hover,
.jcxrel-item:hover {
  transform: translateY(-2px);
  text-decoration: none;
  border-color: #bfdbfe;
  box-shadow: var(--jcx-shadow-md);
}

.home-route-title,
.home-type-link strong,
.home-law-link strong,
.home-category-block {
  font-size: 17px;
  line-height: 1.5;
  color: #0f172a;
}

.home-route-desc,
.home-type-link span,
.home-law-link span {
  font-size: 14px;
  line-height: 1.7;
  color: var(--jcx-text-soft);
}

.recent-laws-panel {
  border-radius: 18px;
}

.recent-laws-header {
  justify-content: space-between;
  padding: 18px 20px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.recent-laws-title {
  font-size: 20px;
}

.recent-laws-item {
  padding: 16px 20px;
}

.recent-laws-link {
  flex-wrap: wrap;
  row-gap: 6px;
}

.recent-laws-law-title {
  font-size: 17px;
  color: #0f172a;
}

.recent-laws-law-num,
.recent-laws-meta {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--jcx-surface-muted);
  border: 1px solid var(--jcx-border);
  color: var(--jcx-text-soft);
}

.search-page > .container {
  padding-top: 22px;
  padding-bottom: 30px;
}

.search-main {
  display: grid;
  gap: 16px;
}

.search-toolbar-card {
  position: sticky;
  top: 88px;
  z-index: 20;
  padding: 18px;
  border: 1px solid rgba(191, 219, 254, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: var(--jcx-shadow-sm);
}

.search-toolbar-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 14px;
}

.search-toolbar-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
}

.search-toolbar-text {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--jcx-text-soft);
}

.search-form {
  margin: 0;
}

.search-form-row {
  gap: 12px;
}

.search-input {
  min-height: 54px;
  padding: 14px 16px;
  border-radius: 14px;
  border-color: var(--jcx-border-strong);
}

.search-button {
  min-width: 112px;
  min-height: 54px;
  padding: 0 22px;
  border-radius: 14px;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.16);
}

.result-count-box {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--jcx-border);
  border-radius: 16px;
}

.result-count-total {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

.result-count-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.result-count-item,
.result-meta-field,
.search-summary-chip,
.law-meta-chip,
.jcxrel-meta-field {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--jcx-surface-muted);
  border: 1px solid var(--jcx-border);
  font-size: 13px;
  line-height: 1.4;
  color: var(--jcx-text-soft);
}

.result-count-sep,
.result-meta-sep,
.jcxrel-meta-sep {
  display: none;
}

.search-note,
.search-suggestion-box {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--jcx-border);
  background: rgba(255,255,255,0.92);
}

.result-list {
  gap: 14px;
}

.result-item {
  padding: 18px;
  border-radius: 18px;
}

.result-title {
  margin-bottom: 10px;
  font-size: 22px;
  line-height: 1.45;
}

.result-title a {
  color: #0f172a;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--jcx-text-soft);
}

.result-snippet,
.result-summary,
.result-body,
.result-excerpt {
  color: var(--jcx-text-soft);
}

.pagination {
  margin-top: 22px;
  gap: 10px;
}

.pagination a,
.pagination span {
  min-width: 40px;
  text-align: center;
  border-radius: 12px;
}

.pagination .current {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e3a8a;
}

.law-page > .container {
  padding-top: 16px;
  padding-bottom: 30px;
}

.law-utility-bar {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--jcx-border);
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  box-shadow: var(--jcx-shadow-sm);
}

.law-utility-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.law-utility-search {
  flex: 1 1 auto;
  min-width: 0;
}

.law-utility-input {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid var(--jcx-border-strong);
  border-radius: 14px;
  box-sizing: border-box;
  font-size: 15px;
}

.law-utility-button {
  flex: 0 0 auto;
  min-width: 108px;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid var(--jcx-accent);
  border-radius: 14px;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.law-card {
  border-radius: 22px;
  padding: 28px;
}

.law-header {
  margin-bottom: 26px;
  padding-bottom: 20px;
}

.law-title {
  margin-bottom: 16px;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.25;
}

.law-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.law-meta-row {
  display: block;
}

.meta-label {
  display: none;
}

.meta-value {
  display: inline-flex;
}

.law-meta-chip a,
.result-meta-field a,
.jcxrel-meta-field a {
  color: inherit;
  text-decoration: none;
}

.law-content {
  font-size: 17px;
  line-height: 1.9;
}

.article-block {
  margin-bottom: 34px;
  padding-top: 10px;
}

.article-title {
  margin-bottom: 12px;
  padding-bottom: 10px;
  font-size: 22px;
  border-bottom: 2px solid #bfdbfe;
}

.article-caption {
  margin-bottom: 14px;
  color: #334155;
}

.article-body-block,
.preamble-body-block {
  padding: 14px 16px;
  border-left: 4px solid #93c5fd;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.article-toc {
  margin-bottom: 28px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.article-toc-title {
  font-size: 16px;
}

.article-toc-link,
.law-structure-toc .law-structure-toc-link {
  border-radius: 999px;
  background: #fff;
}

.jcxrel-section {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--jcx-border);
}

.jcxrel-title {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.35;
  color: #0f172a;
}

.jcxrel-note {
  margin-bottom: 14px;
  color: var(--jcx-text-soft);
}

.jcxrel-list {
  display: grid;
  gap: 12px;
}

.jcxrel-item {
  padding: 16px;
  border: 1px solid var(--jcx-border);
  border-radius: 16px;
  background: #fff;
}

.jcxrel-item-title {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
}

.jcxrel-item-title a {
  color: #0f172a;
}

.jcxrel-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.jcxrel-footer {
  margin-top: 14px;
}

.jcxrel-more-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  font-weight: 700;
}

.bottom-back-link {
  margin-top: 14px;
}

@media (max-width: 900px) {
  .home-category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .search-toolbar-head {

    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .site-global-header-inner {
    min-height: 64px;
  }

  .home-search-band {
    padding: 20px 12px 6px;
  }

  .home-search-band-card,
  .home-section,
  .law-card,
  .search-toolbar-card,
  .law-utility-bar {
    padding: 18px;
    border-radius: 18px;
  }

  .home-search-row,
  .law-utility-row,
  .search-form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .home-search-button,
  .law-utility-button,
  .search-button {
    width: 100%;
  }

  .home-hero-title {
    font-size: 30px;
  }

  .home-type-grid,
  .home-law-grid,
  .home-route-grid {
    grid-template-columns: 1fr;
  }

  .home-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-toolbar-card {
    position: static;
  }

  .result-title,
  .jcxrel-title {
    font-size: 20px;
  }

  .law-title {
    font-size: 28px;
  }

  .law-content {
    font-size: 16px;
  }

  .article-title {
    font-size: 19px;
  }

  .result-count-total {
    font-size: 18px;
  }
}


/* admin logs */
.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.admin-summary-card {
  min-height: 140px;
}

.admin-summary-label {
  font-size: 14px;
  font-weight: 700;
  color: #475569;
}

.admin-summary-value {
  margin-top: 10px;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 700;
  color: #111827;
}

.admin-summary-note {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.7;
  color: #6b7280;
}

.admin-log-filter-grid {
  align-items: end;
}

.admin-log-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.9fr);
  gap: 18px;
}

.admin-log-main,
.admin-log-side {
  min-width: 0;
}

.admin-log-table {
  table-layout: fixed;
}

.admin-log-table th,
.admin-log-table td {
  word-break: break-word;
}

.admin-log-text {
  min-width: 0;
  line-height: 1.6;
}

.admin-log-text-truncate {
  overflow-wrap: anywhere;
}

.admin-log-code {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #334155;
}

.admin-ranking-list {
  margin: 0;
  padding-left: 1.25em;
}

.admin-ranking-item {
  margin: 0 0 12px;
}

.admin-ranking-item:last-child {
  margin-bottom: 0;
}

.admin-ranking-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.admin-ranking-keyword {
  font-weight: 700;
  color: #111827;
  overflow-wrap: anywhere;
}

.admin-ranking-count {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
}

.admin-ranking-meta {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.6;
  color: #6b7280;
}

@media (max-width: 1024px) {
  .admin-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-log-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .admin-summary-grid {
    grid-template-columns: 1fr;
  }

  .admin-summary-value {
    font-size: 28px;
  }
}


/* law_type.cgi: PC 2-column layout */
.law-type-page .result-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 768px) {
  .law-type-page .result-list {
    grid-template-columns: 1fr;
  }
}


/* category.cgi: category index page multi-column layout */
.category-page .result-list {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.category-page .jcxcat-index-card {
  height: 100%;
}

@media (max-width: 900px) {
  .category-page .result-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .category-page .result-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .category-page .result-list {
    grid-template-columns: 1fr;
  }
}
