:root {
  --blue: #2762EB;
  --ink: #0f172a;
  --sub: #475569;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  background-color: var(--bg);
  overscroll-behavior-y: none;
  overscroll-behavior-x: none;
}
body {
  margin: 0;
  min-height: 100vh;
  background-color: transparent;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  line-height: 1.7;
  position: relative;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  line-break: strict;
}
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg);
  background-image: radial-gradient(rgba(100, 116, 139, 0.32) 1px, transparent 0);
  background-size: 36px 36px;
  z-index: -1;
  pointer-events: none;
}
@font-face {
  font-family: 'BerriveArchitectThin';
  src: url('fonts/BerriveArchitectThin-Regular.ttf') format('truetype');
  font-display: swap;
}
.site-header {
  max-width: 880px; margin: 0 auto; padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #0f172a;
  text-decoration: none;
  font-family: 'BerriveArchitectThin', -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 32px;
  letter-spacing: 0.05em;
  font-weight: 400;
  -webkit-text-stroke: 0.35px currentColor;
  padding: 8px 14px;
  margin: -8px -14px;
  border-radius: 8px;
  transition: background-color .15s ease, color .15s ease;
}
.brand:hover {
  background: rgba(39, 98, 235, 0.06);
  color: var(--blue);
}
.font-berrive {
  font-family: 'BerriveArchitectThin', -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-weight: 400;
  letter-spacing: 0.05em;
}
.mark {
  width: 26px;
  height: 26px;
  background: var(--blue);
  border-radius: 4px;
  display: inline-block;
  flex-shrink: 0;
  transition: transform .15s ease;
}
.brand:hover .mark {
  transform: scale(1.05);
}
.header-link {
  color: var(--sub);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.header-link:hover { color: var(--blue); text-decoration: underline; }
.nobrk {
  display: inline-block;
  white-space: nowrap;
}
.container { max-width: 880px; margin: 0 auto; padding: 12px 20px 40px; }
.container.wide,
.page-top .container,
.page-top .site-header,
.page-top .site-footer {
  max-width: 1040px;
}
h1 { font-size: 24px; margin: 14px 0 8px; line-height: 1.4; color: var(--ink); letter-spacing: -0.01em; }
h1, h2, h3 { word-break: auto-phrase; }
.hero-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin: 20px 0 6px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  word-break: auto-phrase;
}
.title-part {
  display: inline-block;
}
.hero-lead {
  font-size: 14px;
  color: var(--sub);
  margin: 0 0 22px;
  line-height: 1.6;
  word-break: auto-phrase;
}
h2 { font-size: 16.5px; margin: 0 0 14px; color: var(--ink); font-weight: 700; }
.lead { color: var(--sub); margin: 0 0 22px; font-size: 14.5px; line-height: 1.65; word-break: auto-phrase; }
.card {
  background: var(--card);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03), 0 6px 16px -4px rgba(15, 23, 42, 0.02);
}
.field {
  margin-bottom: 18px;
  min-width: 0;
}
.field:last-child { margin-bottom: 0; }
.label, label { display: block; font-size: 13.5px; font-weight: 600; color: #334155; margin-bottom: 7px; }
.input-wrap { position: relative; width: 100%; max-width: 480px; min-width: 0; }
input[type="text"], input[type="number"], input[type="date"], select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: 16px;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color .15s ease, box-shadow .15s ease;
  box-sizing: border-box;
}
input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
}
select {
  font-size: 15px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 14px;
  padding-right: 38px;
  cursor: pointer;
}
input[type="text"]:focus, input[type="number"]:focus, input[type="date"]:focus, select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(39, 98, 235, 0.14), 0 1px 2px rgba(0, 0, 0, 0.04);
}
.help {
  display: block;
  font-size: 12px;
  color: var(--sub);
  margin-top: 5px;
  line-height: 1.4;
}
.unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--sub); font-size: 15px; font-weight: 500; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg label { flex: 1 1 200px; display: flex; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  min-height: 56px;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  color: #334155;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: all .15s ease;
}
.seg-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}
.seg-sub {
  display: block;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--sub);
  margin-top: 3px;
}
.seg span:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}
.seg input:checked + span {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(39, 98, 235, 0.25);
}
.seg input:checked + span .seg-sub {
  color: rgba(255, 255, 255, 0.9);
}
.seg input:focus-visible + span {
  outline: none;
  box-shadow: 0 0 0 3px rgba(39, 98, 235, 0.2);
}
.rows {
  margin: 0 0 22px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}
.rows > div {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.rows > div:last-child {
  border-bottom: none;
}
.rows > div:nth-child(even) {
  background: #f8fafc;
}
.rows dt {
  color: var(--sub);
  font-size: 14px;
  width: 160px;
  flex-shrink: 0;
}
.rows dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: left;
  flex-grow: 1;
}
@media (max-width: 600px) {
  .hero-title {
    font-size: 19px;
    margin: 16px 0 6px;
    line-height: 1.45;
  }
  .hero-lead {
    font-size: 13.5px;
    margin: 0 0 18px;
    line-height: 1.55;
  }
  .rows > div {
    gap: 12px;
    padding: 10px 12px;
  }
  .rows dt {
    width: 120px;
    font-size: 13px;
  }
  .rows dd {
    font-size: 13.5px;
  }
}
.rows .sub dt { padding-left: 14px; font-size: 13px; }
.rows .sub dd { font-weight: 400; }
.notice { background: #eef3ff; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip { font: inherit; padding: 8px 14px; border: 1px solid var(--blue); background: #fff; color: var(--blue); border-radius: 999px; cursor: pointer; }
.chip.on { background: var(--blue); color: #fff; }
.journal { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 18px; }
.journal th, .journal td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.journal th { color: var(--sub); font-weight: 500; font-size: 13px; }
.journal .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.primary {
  display: block; width: 100%; text-align: center; font: inherit; font-weight: 700;
  background: var(--blue); color: #fff; border: 0; border-radius: 10px;
  padding: 14px; cursor: pointer; text-decoration: none;
}
.primary:hover { opacity: .92; }
.primary:disabled { opacity: .4; cursor: default; }
.copy-msg { min-height: 1.5em; margin: 10px 0 0; color: var(--blue); font-size: 14px; }
.btn-copy {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 10px; font-size: 12px; font-weight: 500;
  color: var(--blue); background: #fff; border: 1px solid var(--blue);
  border-radius: 6px; cursor: pointer; margin-left: 10px;
  vertical-align: middle; font-family: inherit;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-copy:hover { background: var(--blue); color: #fff; }
.btn-copy.copied { background: #2ea44f; border-color: #2ea44f; color: #fff; }
.btn-copy:disabled { opacity: .35; cursor: default; pointer-events: none; }
.note ul { margin: 0; padding-left: 20px; color: var(--sub); font-size: 14px; }
.site-footer {
  max-width: 880px;
  margin: 0 auto;
  padding: 20px 20px calc(80px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--sub);
  font-size: 13px;
  flex-wrap: wrap;
  gap: 12px;
}
.site-footer p {
  margin: 0;
}
.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
}
.footer-link {
  color: var(--sub);
  text-decoration: none;
  white-space: nowrap;
  font-size: 13px;
}
.footer-link:hover {
  color: var(--blue);
  text-decoration: underline;
}
.nav-bottom {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-top: 24px;
}
.btn-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 240px;
  max-width: 320px;
  margin: 0 auto;
  padding: 12px 24px;
  background: #f0f5ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  color: var(--blue);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.btn-home:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}
.nav-other-section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.nav-other-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.nav-other-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
}
.nav-cat-link {
  font-size: 12px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}
.nav-cat-link:hover {
  text-decoration: underline;
}
.nav-tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.nav-tool-link {
  display: block;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 13.5px;
  text-align: center;
  text-decoration: none;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all .15s ease;
}
.nav-tool-link:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: #fff;
}
.nav-tool-link.current {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 700;
  pointer-events: none;
}
.nav-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.nav-cat-btn {
  display: block;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: all .15s ease;
}
.nav-cat-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: #f0f5ff;
}
.nav-feedback-wrap {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  text-align: center;
}
.nav-feedback-link {
  display: inline-block;
  text-align: center;
  line-height: 1.6;
  color: var(--sub);
  font-size: 13px;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color .15s, background-color .15s;
}
.nav-feedback-link:hover {
  color: var(--blue);
  background: #f0f5ff;
  text-decoration: underline;
}

/* Tool Header Badges */
.tool-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

/* Visual Rule Boxes (計算のきまり視覚化) */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 14px 0 16px;
}
.rule-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
}
.rule-tag {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--blue);
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.rule-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--blue);
  line-height: 1.25;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.rule-sub {
  font-size: 12px;
  color: var(--sub);
  line-height: 1.5;
  margin: 0;
}
@media (min-width: 600px) {
  .rule-box {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 14px;
    row-gap: 6px;
    align-items: center;
    padding: 16px 18px;
  }
  .rule-tag {
    grid-column: 1 / -1;
    justify-self: start;
    width: fit-content;
    margin-bottom: 2px;
  }
  .rule-val {
    grid-column: 1;
    margin-bottom: 0;
    padding-right: 12px;
    border-right: 1px solid var(--line);
    white-space: nowrap;
  }
  .rule-sub {
    grid-column: 2;
    margin: 0;
    align-self: center;
  }
}
.rule-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rule-list li {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.6;
  padding-left: 18px;
  position: relative;
  word-break: auto-phrase;
}
.rule-list li::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--blue);
}
.rule-list li strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}
.rule-list li p {
  margin: 0;
  color: var(--sub);
  font-size: 12.5px;
  line-height: 1.55;
}

/* Quick Points (要点ショート常時表示) */
.rule-quick-points {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rule-quick-points li {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.55;
  padding-left: 18px;
  position: relative;
  word-break: auto-phrase;
}
.rule-quick-points li::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--blue);
}
.rule-quick-points strong {
  color: var(--ink);
  font-weight: 700;
}

/* Rule Details Accordion (詳細アコーディオン) */
.rule-details {
  margin-top: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
  transition: all 0.2s ease;
}
.rule-details[open] {
  background: #ffffff;
  border-color: #cbd5e1;
}
.rule-details-summary {
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  list-style: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.rule-details-summary::-webkit-details-marker {
  display: none;
}
.rule-details-summary:hover {
  color: var(--blue);
  background: #f1f5f9;
}
.rule-details-summary::after {
  content: "＋";
  font-size: 13px;
  font-weight: 700;
  color: var(--sub);
}
.rule-details[open] .rule-details-summary::after {
  content: "−";
  color: var(--blue);
}
.rule-details-content {
  padding: 12px 16px 14px;
  border-top: 1px solid #e2e8f0;
  font-size: 12.5px;
  color: var(--sub);
  line-height: 1.65;
}
.rule-details-content ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rule-details-content li {
  padding-left: 16px;
  position: relative;
  font-size: 12.5px;
  color: var(--sub);
  line-height: 1.6;
}
.rule-details-content li::before {
  content: "・";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--sub);
}
.rule-details-content strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}
.rule-details-content p {
  margin: 0;
  color: var(--sub);
  line-height: 1.6;
}

/* Knowledge Cards (実務知識カード) */
.qa-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}
.qa-item {
  border-bottom: 1px dashed #e2e8f0;
  padding-bottom: 12px;
}
.qa-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.qa-q {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  word-break: auto-phrase;
}
.qa-q::before {
  content: "Q";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--blue);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 4px;
  flex-shrink: 0;
}
.qa-a {
  font-size: 12.5px;
  color: var(--sub);
  line-height: 1.6;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  word-break: auto-phrase;
}
.qa-a::before {
  content: "A";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #475569;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 4px;
  flex-shrink: 0;
}
.qa-a-text {
  flex: 1;
  word-break: auto-phrase;
}
.qa-a-text strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

/* Rule Table (アコーディオン内テーブル) */
.rule-table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: none;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
}
.rule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}
.rule-table th {
  background: #f8fafc;
  color: var(--ink);
  font-weight: 700;
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.rule-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--sub);
  white-space: nowrap;
}
.rule-table tr:last-child td {
  border-bottom: none;
}
.rule-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}
.rule-table tbody tr:hover td {
  background: #f1f5f9;
}
.rule-table .highlight-col {
  font-weight: 700;
  color: var(--blue);
}

/* 印紙税早見表専用レイアウト（コンパクト化と適正間隔） */
.stamp-rule-wrap {
  max-width: 540px;
}
.stamp-rule-table th,
.stamp-rule-table td {
  padding: 8px 12px;
  text-align: left;
}
.stamp-rule-table th:nth-child(1),
.stamp-rule-table td:nth-child(1) {
  width: 44%;
}
.stamp-rule-table th:nth-child(2),
.stamp-rule-table td:nth-child(2) {
  width: 32%;
  text-align: left;
}
.stamp-rule-table th:nth-child(3),
.stamp-rule-table td:nth-child(3) {
  width: 24%;
  text-align: left;
}

.knowledge-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}
.k-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--blue);
  border-radius: 6px;
  padding: 12px 16px;
}
.k-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.k-desc {
  font-size: 13.5px;
  color: var(--sub);
  line-height: 1.6;
  margin: 0;
}

/* Quick Tables (早見表テーブル) */
.table-wrap,
.tbl-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: none;
  -webkit-overflow-scrolling: touch;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}
@media (min-width: 768px) {
  .table-wrap,
  .tbl-wrap {
    overflow-x: hidden;
  }
}
.quick-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
.quick-table th, .quick-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  line-height: 1.55;
  vertical-align: top;
}
.quick-table th {
  background: #f8fafc;
  color: var(--sub);
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.quick-table tr:last-child td {
  border-bottom: none;
}
.quick-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}
.quick-table tr:hover td {
  background: #f1f5f9;
}
.quick-table td:nth-child(1) {
  white-space: nowrap;
  font-weight: 700;
  color: var(--ink);
  width: 17%;
}
.quick-table td:nth-child(2) {
  width: 36%;
  color: var(--ink);
}
.quick-table td:nth-child(3) {
  width: 22%;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
}
.quick-table td:nth-child(4) {
  width: 25%;
  color: var(--ink);
}

/* 借入スケジュール5列テーブル専用レイアウト（金額の改行落ち防止） */
.loan-schedule-table th,
.loan-schedule-table td {
  white-space: nowrap !important;
  font-variant-numeric: tabular-nums;
  padding: 11px 13px;
}
.loan-schedule-table td:nth-child(1) { width: 12% !important; }
.loan-schedule-table td:nth-child(2) { width: 22% !important; }
.loan-schedule-table td:nth-child(3) { width: 22% !important; }
.loan-schedule-table td:nth-child(4) { width: 22% !important; }
.loan-schedule-table td:nth-child(5) { width: 22% !important; }

/* 3列比較テーブル専用レイアウト（106万vs130万など） */
.compare-table th:nth-child(1),
.compare-table td:nth-child(1) {
  width: 18%;
  white-space: nowrap;
}
.compare-table th:nth-child(2),
.compare-table td:nth-child(2) {
  width: 41%;
}
.compare-table th:nth-child(3),
.compare-table td:nth-child(3) {
  width: 41%;
}
.tbl-sub {
  display: block;
  font-size: 11px;
  color: var(--sub);
  line-height: 1.35;
  margin-top: 3px;
  font-weight: 400;
}

.tool-list { list-style: none; margin: 0; padding: 0; }
.tool-list a { display: block; padding: 16px 0; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.tool-list a:hover .t { color: var(--blue); }
.tool-list .t { font-weight: 700; display: block; }
.tool-list .d { color: var(--sub); font-size: 14px; }

/* Version / Legal Tag (準拠法令・施行基準バッジ) */
.version-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  margin-bottom: 20px;
  line-height: 1.5;
}
.version-tag-label {
  display: inline-block;
  background: #334155;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Trust Banner (広告なし・安心宣言) */
.trust-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 18px;
  margin: 16px 0 20px;
}
.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.02em;
}
.trust-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #2762EB;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

/* Responsive Tool Grid & Cards */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
  margin: 18px 0 24px;
}
.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  padding: 22px;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03), 0 4px 12px -2px rgba(15, 23, 42, 0.02);
  transition: transform .2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow .2s cubic-bezier(0.16, 1, 0.3, 1), border-color .2s ease;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px -4px rgba(39, 98, 235, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  border-color: #2762EB;
}
.tool-card.is-pinned {
  border-color: #bfdbfe;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(39, 98, 235, 0.05);
}
.tool-card-title {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  margin: 0 0 10px 0;
  padding-right: 48px;
  transition: color .15s ease;
}
.tool-card.is-pinned .tool-card-title {
  padding-right: 116px;
}
.tool-card-title a {
  color: inherit;
  text-decoration: none;
  display: block;
}
.tool-card:hover .tool-card-title,
.tool-card:hover .tool-card-title a {
  color: var(--blue);
}

/* ピン留め・並び替え操作グループ */
.pin-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 3;
}
.pin-order-btn {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all .15s ease;
  touch-action: manipulation;
}
.tool-card.is-pinned .pin-order-btn {
  display: inline-flex;
}
.pin-order-btn:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #93c5fd;
  color: var(--blue);
}
.pin-order-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  border-color: #e2e8f0;
}
.pin-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all .15s ease;
  touch-action: manipulation;
}
.pin-btn:hover {
  background: #eff6ff;
  color: var(--blue);
  border-color: #bfdbfe;
}
.tool-card.is-pinned .pin-btn {
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
}
.tool-card.is-pinned .pin-btn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}
.pin-btn .pin-icon {
  width: 18px;
  height: 18px;
}
.tool-card.is-pinned .pin-icon path {
  fill: currentColor;
}

/* ドラッグ＆ドロップスタイル */
.tool-card.is-pinned {
  cursor: grab;
}
.tool-card.is-pinned:active {
  cursor: grabbing;
}
.tool-card.is-dragging {
  opacity: 0.45;
  border: 2px dashed var(--blue) !important;
  transform: scale(0.98);
}
.tool-card.drag-over {
  border-color: var(--blue) !important;
  box-shadow: 0 0 0 3px rgba(39, 98, 235, 0.2) !important;
  transform: translateY(-2px);
}
.tool-card .badge-group {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 12px;
}
.tool-card-desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--sub);
  margin: 0;
  word-break: auto-phrase;
}
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  letter-spacing: 0.02em;
  line-height: 1.3;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s ease;
}
.badge:hover {
  text-decoration: none;
}
.badge-free {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}
.badge-free:hover {
  background: #334155;
  color: #ffffff;
  border-color: #334155;
}
.badge-paid {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fcd34d;
}
.badge-paid:hover {
  background: #b45309;
  color: #ffffff;
  border-color: #b45309;
}
.badge-cat {
  background: #eef3ff;
  color: var(--blue);
  border: 1px solid #c7d7fe;
}
.badge-cat:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
/* ツール検索バー */
.search-bar-wrap {
  margin: 18px 0 14px;
}
.search-input-box {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-input-box:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(39, 98, 235, 0.12), 0 1px 3px rgba(0, 0, 0, 0.05);
}
.search-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  pointer-events: none;
  flex-shrink: 0;
}
.search-input {
  width: 100%;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 11px 40px 11px 42px !important;
  font-size: 16px !important;
  color: var(--ink);
  outline: none !important;
}
.search-input::placeholder {
  color: #94a3b8;
  font-size: 14px;
}
.search-clear-btn {
  position: absolute;
  right: 10px;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: background-color .15s, color .15s;
}
.search-clear-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.search-hit-count {
  font-size: 12.5px;
  color: var(--sub);
  margin-top: 6px;
  padding-left: 4px;
}

/* 検索結果ゼロ件カード */
.no-results-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  margin: 20px 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}
.no-results-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
}
.no-results-sub {
  font-size: 13.5px;
  color: var(--sub);
  margin: 0 0 16px;
  line-height: 1.6;
}
.no-results-link {
  display: inline-block;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: var(--blue);
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 8px;
  text-decoration: none;
  transition: all .15s ease;
}
.no-results-link:hover {
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
  text-decoration: none;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 22px;
}
.filter-tab {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--sub);
  cursor: pointer;
  transition: all .15s ease;
  line-height: 1.4;
}
.filter-tab:hover {
  border-color: #cbd5e1;
  color: var(--ink);
}
.filter-tab.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 600;
}
.filter-tab.tab-fav {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #eff6ff;
  color: var(--blue);
  border-color: #bfdbfe;
  font-weight: 600;
}
.filter-tab.tab-fav:hover {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}
.filter-tab.tab-fav.active {
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
}
.filter-tab.tab-fav.active .tab-fav-icon {
  fill: #ffffff;
}
.feedback-card {
  margin-top: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  text-align: center;
}
.feedback-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sub);
  font-size: 13.5px;
  text-decoration: none;
  transition: color .15s ease;
}
.feedback-link:hover {
  color: var(--blue);
  text-decoration: underline;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fffbeb;
  color: #b45309;
  border: 1.5px solid #f59e0b;
  letter-spacing: 0.04em;
  line-height: 1.3;
  margin-left: 6px;
}
.tool-card-desc {
  color: var(--sub);
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0;
  flex-grow: 1;
  word-break: auto-phrase;
}

@media (max-width: 640px) {
  .site-header {
    padding: 12px 14px;
  }
  .brand-wrap {
    gap: 8px;
  }
  .brand {
    font-size: 22px;
    gap: 8px;
    padding: 4px 6px;
    margin: -4px -6px;
  }
  .mark {
    width: 20px;
    height: 20px;
  }
  .header-tag {
    font-size: 11px;
    padding: 2px 6px;
  }
  .header-link {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 21px; }
  .hero-title { font-size: 26px; }
  .card { padding: 16px; }
  .journal { font-size: 13px; }
  .tool-grid { grid-template-columns: 1fr; gap: 12px; }
}

.hero-box {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 18px;
  text-align: center;
}
.hero-label {
  font-size: 13px;
  color: var(--sub);
  margin-bottom: 6px;
}
.hero-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-variant-numeric: tabular-nums;
}
.hero-value.zero {
  color: #16a34a;
}
.banner-eco {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 10px;
  padding: 16px;
  margin-top: 18px;
}
.banner-eco h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: #166534;
}
.banner-eco p {
  margin: 0;
  font-size: 13px;
  color: #14532d;
  line-height: 1.6;
}
.checkbox-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 14px;
  color: var(--sub);
  cursor: pointer;
}
.checkbox-wrap input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.field-hint {
  font-size: 12px;
  color: var(--sub);
  margin-top: 4px;
}

/* ヘッダー検索ボタン */
.header-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid #cbd5e1;
  color: var(--sub);
  font-size: 12.5px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.4;
  transition: all .15s ease;
  white-space: nowrap;
}
.header-search-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: var(--blue);
}

/* 検索モーダル・オーバーレイ */
.search-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 30px 14px;
  box-sizing: border-box;
}
.search-modal {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 60px);
}
.search-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.search-modal-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.search-modal-input {
  width: 100%;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  border-radius: 8px !important;
  padding: 8px 34px 8px 34px !important;
  font-size: 16px !important;
  color: var(--ink);
  box-shadow: none !important;
}
.search-modal-input:focus {
  border-color: var(--blue) !important;
  box-shadow: 0 0 0 2px rgba(39, 98, 235, 0.15) !important;
}
.search-modal-input-wrap .search-icon {
  position: absolute;
  left: 10px;
  color: #94a3b8;
  pointer-events: none;
}
.search-modal-clear {
  position: absolute;
  right: 8px;
  background: #e2e8f0;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.search-modal-close {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: var(--sub);
  font-size: 12.5px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.search-modal-close:hover {
  background: #e2e8f0;
  color: var(--ink);
}
.search-modal-body {
  padding: 10px 12px;
  overflow-y: auto;
  flex: 1;
}
.search-modal-sec-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--sub);
  margin-bottom: 6px;
  padding-left: 2px;
  letter-spacing: 0.02em;
}
.search-modal-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.search-modal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  text-decoration: none;
  color: var(--ink);
  transition: all .12s ease;
  gap: 10px;
}
.search-modal-item:hover {
  border-color: var(--blue);
  background: #eff6ff;
  text-decoration: none;
}
.search-modal-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.search-modal-item:hover .search-modal-item-title {
  color: var(--blue);
}
.search-modal-item-desc {
  font-size: 11.5px;
  color: var(--sub);
  margin-top: 1px;
  line-height: 1.35;
}
.search-modal-item-cat {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--blue);
  background: #eef3ff;
  border: 1px solid #c7d7fe;
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.search-modal-empty {
  text-align: center;
  padding: 24px 12px;
  font-size: 13px;
  color: var(--sub);
}

/* 最下部ナビ内の検索ボックス */
.nav-bottom-search-wrap {
  margin: 14px 0 10px;
  position: relative;
}
.nav-bottom-search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.nav-bottom-search-box:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(39, 98, 235, 0.12);
}
.nav-bottom-search-box .search-icon {
  position: absolute;
  left: 12px;
  color: #94a3b8;
  pointer-events: none;
}
.nav-bottom-search-input {
  width: 100%;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 10px 34px 10px 36px !important;
  font-size: 16px !important;
  color: var(--ink);
  outline: none !important;
}
.nav-bottom-search-clear {
  position: absolute;
  right: 8px;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.nav-bottom-search-results {
  margin-top: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}
.nav-bottom-search-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nav-bottom-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  color: var(--ink);
  transition: background-color .12s;
}
.nav-bottom-search-item:hover {
  background: #f0f5ff;
  color: var(--blue);
  text-decoration: none;
}
.nav-bottom-item-title {
  font-weight: 600;
}
.nav-bottom-item-cat {
  font-size: 11px;
  color: var(--sub);
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.nav-bottom-search-empty {
  text-align: center;
  padding: 12px;
  font-size: 12.5px;
  color: var(--sub);
}

/* 横スクロール案内バッジ（スマホ実機での操作性向上） */
.table-scroll-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.table-scroll-badge-icon {
  font-size: 13px;
  line-height: 1;
}
@media (min-width: 768px) {
  .table-scroll-badge {
    display: none;
  }
}

/* トップお知らせバナー */
.news-banner {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.news-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.news-badge {
  background: var(--blue);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.news-date {
  font-size: 12px;
  color: var(--sub);
  white-space: nowrap;
  flex-shrink: 0;
}
.news-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}
.news-links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.news-tool-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  max-width: 340px;
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  transition: all .15s ease;
}
.news-tool-card:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--blue);
  transform: translateY(-1px);
}
.news-tool-cat {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.news-tool-name {
  font-size: 13.5px;
  font-weight: 700;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.news-tool-arrow {
  font-size: 13px;
  color: var(--blue);
  font-weight: 700;
}
@media (max-width: 480px) {
  .news-banner {
    padding: 12px 14px;
  }
  .news-tool-card {
    max-width: 100%;
  }
}

/* フローティング・クイックナビ（一覧へ ＆ ページ上部へ） */
.floating-quick-nav {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 990;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease;
}
.floating-quick-nav.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.floating-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
  transition: all .15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.floating-btn svg {
  flex-shrink: 0;
  color: var(--sub);
  transition: color .15s ease;
}
.floating-btn:hover {
  background: #f8fafc;
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(39, 98, 235, 0.15);
}
.floating-btn:hover svg {
  color: var(--blue);
}
@media (max-width: 540px) {
  .container {
    padding-bottom: 20px;
  }
  .site-footer {
    padding: 16px 16px calc(88px + env(safe-area-inset-bottom, 0px));
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
  }
  .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
  }
}
@media (max-width: 480px) {
  .floating-quick-nav {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    gap: 6px;
  }
  .floating-btn {
    padding: 7px 11px;
    font-size: 11px;
  }
  .floating-btn svg {
    width: 14px;
    height: 14px;
  }
}

/* クラウド作成ツールの案内グリッド */
.cloud-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.cloud-tool-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all .15s ease;
}
.cloud-tool-card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 14px rgba(39, 98, 235, 0.08);
}
.cloud-tool-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.cloud-tool-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.cloud-tool-desc {
  font-size: 12.5px;
  color: var(--sub);
  line-height: 1.55;
  margin: 0 0 12px;
  flex: 1;
}
.cloud-tool-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.cloud-tool-link:hover {
  text-decoration: underline;
}

/* X (Twitter) Share Button */
.btn-share-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #0F1419;
  color: #FFFFFF !important;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid #272C30;
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.btn-share-x:hover {
  background-color: #272C30;
  border-color: #3E444A;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.btn-share-x svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}
.btn-share-x-wrapper {
  margin: 16px 0;
  display: flex;
  justify-content: center;
}

/* 共通利用上の注意事項カード */
.disclaimer-card {
  margin: 24px 0 16px;
  padding: 16px 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.7;
}
.disclaimer-title {
  font-weight: 700;
  font-size: 13px;
  color: #334155;
  margin-bottom: 6px;
}
.disclaimer-text {
  margin: 0;
  color: #64748b;
}

/* 印刷用スタイル（A4用紙1枚に計算結果や判定根拠を収める） */
@media print {
  body {
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 11pt !important;
    line-height: 1.5 !important;
    padding: 0 !important;
  }

  .site-header,
  .site-footer,
  .floating-quick-nav,
  .btn-share-x-wrapper,
  .nav-feedback-wrap,
  .feedback-card,
  .btn-home,
  .nav-bottom,
  .btn-copy,
  .filter-tab-wrap,
  #toolSearchWrap,
  .pin-controls,
  .pin-btn,
  .news-banner,
  .terms-back-top,
  .admin-badge,
  #adminBadge {
    display: none !important;
  }

  .container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .card, .disclaimer-card {
    box-shadow: none !important;
    border: 1px solid #d1d5db !important;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 16px !important;
    padding: 16px !important;
    background: #ffffff !important;
  }

  h1 {
    font-size: 16pt !important;
    margin: 0 0 8px 0 !important;
    color: #111827 !important;
  }

  .lead {
    font-size: 10pt !important;
    margin-bottom: 14px !important;
    color: #4b5563 !important;
  }

  .container::before {
    content: "そのままシリーズ ｜ 実務計算・判定エビデンス（sonomama-series-test.pages.dev）";
    display: block;
    font-size: 8.5pt;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 6px;
    margin-bottom: 14px;
  }

  input, select {
    border: 1px solid #9ca3af !important;
    background: #ffffff !important;
    color: #111827 !important;
  }

  table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  th, td {
    border: 1px solid #d1d5db !important;
    padding: 6px 8px !important;
    font-size: 9.5pt !important;
  }

  a {
    color: #111827 !important;
    text-decoration: none !important;
  }
}
