:root {
  --k-bg: #f6f7f5;
  --k-surface: #ffffff;
  --k-surface-muted: #eef1f2;
  --k-ink: #202b33;
  --k-muted: #64717a;
  --k-line: #dce2e5;
  --k-accent: #315f82;
  --k-accent-dark: #244963;
  --k-accent-soft: #e8f0f5;
  --k-radius: 10px;
  --k-content: 1120px;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  overflow-x: clip;
  background: var(--k-bg);
  color: var(--k-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  line-height: 1.7;
}

body.layout-fixed .container,
.container {
  width: min(calc(100% - 40px), var(--k-content));
  max-width: var(--k-content);
  padding-left: 0;
  padding-right: 0;
}

a {
  color: var(--k-accent);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--k-accent-dark);
}

:focus-visible {
  outline: 3px solid rgba(49, 95, 130, 0.35);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 2000;
  top: 10px;
  left: 10px;
  transform: translateY(-150%);
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--k-ink);
  color: #fff;
}

.skip-link:focus {
  transform: translateY(0);
  color: #fff;
}

/* Header */
.kakitiro-header.site-header {
  position: relative;
  z-index: 100;
  padding: 0;
  border-bottom: 1px solid var(--k-line);
  background: rgba(255, 255, 255, 0.98);
  color: var(--k-ink);
}

.kakitiro-header .header-container {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.kakitiro-header .navbar-brand {
  flex: 0 0 auto;
  margin: 0;
  color: var(--k-ink);
  text-decoration: none;
}

.kakitiro-header .site-title {
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  font-weight: 720;
  letter-spacing: -0.025em;
}

.kakitiro-header .header-right {
  min-width: 0;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  text-align: left;
}

.kakitiro-header .site-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kakitiro-header .site-menu li {
  display: block;
  margin: 0;
}

.kakitiro-header .nav-link {
  padding: 10px 11px;
  color: #34434d;
  font-size: 0.95rem;
  font-weight: 580;
  text-decoration: none;
  border-radius: 6px;
}

.kakitiro-header .nav-link:hover,
.kakitiro-header .nav-link:focus-visible {
  background: var(--k-accent-soft);
  color: var(--k-accent-dark);
  text-decoration: none;
}

.kakitiro-header .header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-search {
  display: flex;
  align-items: center;
  height: 38px;
  border: 1px solid var(--k-line);
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}

.header-search input {
  width: 112px;
  min-width: 0;
  padding: 6px 0 6px 10px;
  border: 0;
  background: transparent;
  color: var(--k-ink);
  font-size: 0.9rem;
  outline: 0;
}

.header-search button {
  width: 38px;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--k-muted);
}

.language-selector select {
  max-width: 132px;
  height: 38px;
  padding: 5px 28px 5px 9px;
  border: 1px solid var(--k-line);
  border-radius: 7px;
  background-color: #fff;
  color: var(--k-ink);
  font-size: 0.88rem;
}

.site-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid var(--k-line);
  border-radius: 7px;
  background: #fff;
}

.site-menu-toggle span {
  display: block;
  height: 2px;
  margin: 4px 0;
  background: var(--k-ink);
}

/* Breadcrumbs */
.breadcrumb-band {
  border-bottom: 1px solid var(--k-line);
  background: #fff;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 10px 0;
  list-style: none;
  color: var(--k-muted);
  font-size: 0.84rem;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-inline-start: 6px;
  color: #9aa4aa;
}

.breadcrumbs a {
  color: var(--k-muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--k-accent);
  text-decoration: underline;
}

/* Main content */
.site-main {
  flex: 1;
  padding: 46px 0 64px;
  font-size: 1rem;
}

.site-main.mt-4 {
  margin-top: 0 !important;
}

.cms-page > h1 {
  margin: 0 0 24px;
  color: var(--k-ink);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.page-content {
  margin-bottom: 0;
}

.page-content h2 {
  margin: 48px 0 18px;
  color: var(--k-ink);
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  line-height: 1.3;
}

.page-content h3 {
  color: var(--k-ink);
}

.k-lead {
  max-width: 760px;
  margin: 0 0 28px;
  color: #4f5e67;
  font-size: clamp(1.05rem, 2vw, 1.22rem);
}

.k-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 0;
}

.k-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 9px 17px;
  border: 1px solid var(--k-accent);
  border-radius: 7px;
  background: var(--k-accent);
  color: #fff;
  font-weight: 650;
  text-decoration: none;
}

.k-button:hover {
  background: var(--k-accent-dark);
  color: #fff;
  text-decoration: none;
}

.k-button-secondary {
  border-color: var(--k-line);
  background: #fff;
  color: var(--k-ink);
}

.k-button-secondary:hover {
  border-color: #aab7be;
  background: var(--k-surface-muted);
  color: var(--k-ink);
}

.k-section {
  margin-top: 58px;
  padding-top: 1px;
  border-top: 1px solid var(--k-line);
}

.k-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin: 32px 0 18px;
}

.k-section-heading h2 {
  margin: 0;
}

.k-section-heading a {
  flex: 0 0 auto;
  font-size: 0.92rem;
  font-weight: 650;
}

.k-home-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 0;
  list-style: none;
}

.k-home-links a {
  display: block;
  min-height: 100%;
  padding: 18px;
  border: 1px solid var(--k-line);
  border-radius: var(--k-radius);
  background: #fff;
  color: var(--k-ink);
  font-weight: 650;
  text-decoration: none;
}

.k-home-links a span {
  display: block;
  margin-top: 4px;
  color: var(--k-muted);
  font-size: 0.88rem;
  font-weight: 450;
}

.k-home-links a:hover {
  border-color: #aebcc4;
  background: #fbfcfc;
}

/* Home */
body.page-home .site-main {
  padding-top: 64px;
}

body.page-home .cms-page > h1 {
  max-width: 960px;
  margin-bottom: 18px;
  font-size: clamp(2.25rem, 4.3vw, 3.55rem);
}

body.page-home .cms-page > h1::before {
  content: "kakitiro.com";
  display: block;
  margin-bottom: 12px;
  color: var(--k-accent);
  font-size: 0.9rem;
  font-weight: 720;
  letter-spacing: 0.08em;
}

/* Product directory */
.product-finder {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin: 28px 0 34px;
  padding: 18px;
  border: 1px solid var(--k-line);
  border-radius: var(--k-radius);
  background: #fff;
}

.product-search-field label {
  display: block;
  margin-bottom: 5px;
  color: var(--k-muted);
  font-size: 0.82rem;
  font-weight: 680;
}

.product-search-field input {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #bfc9ce;
  border-radius: 7px;
  background: #fff;
  color: var(--k-ink);
}

.product-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.product-filter-buttons button {
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid var(--k-line);
  border-radius: 999px;
  background: #fff;
  color: #42515a;
  font-size: 0.9rem;
}

.product-filter-buttons button[aria-pressed="true"] {
  border-color: var(--k-accent);
  background: var(--k-accent-soft);
  color: var(--k-accent-dark);
  font-weight: 650;
}

.product-result-status {
  grid-column: 1 / -1;
  min-height: 1.4em;
  margin: -4px 0 0;
  color: var(--k-muted);
  font-size: 0.86rem;
}

.product-directory[hidden],
[data-product-item][hidden] {
  display: none !important;
}

.product-card-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  position: relative;
  width: auto;
  min-width: 0;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--k-line);
  border-radius: var(--k-radius);
  background: var(--k-surface);
  box-shadow: none;
  transition: border-color 160ms ease, transform 160ms ease;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: #aebbc2;
  box-shadow: none;
}

.product-card-link {
  display: flex;
  height: 100%;
  min-height: 100%;
  flex-direction: column;
  padding: 18px;
  color: inherit;
  text-decoration: none;
}

.product-card-link:hover {
  color: inherit;
  text-decoration: none;
}

.product-card-media {
  display: flex;
  aspect-ratio: 16 / 9;
  align-items: center;
  justify-content: center;
  margin: -18px -18px 15px;
  padding: 14px;
  border-bottom: 1px solid var(--k-line);
  background: #f0f2f3;
}

.product-card .product-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.product-card h2,
.product-card h3 {
  margin: 0 0 7px;
  color: var(--k-ink);
  font-size: 1.12rem;
  line-height: 1.35;
}

.product-card p {
  margin: 0;
  color: var(--k-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.product-card .product-category {
  align-self: flex-start;
  margin: 0 0 9px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--k-surface-muted);
  color: #53616a;
  font-size: 0.74rem;
  font-weight: 650;
}

.product-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.product-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: auto 24px 0 0;
  padding: 15px 0 0;
  list-style: none;
}

.product-platforms li {
  padding: 2px 6px;
  border: 1px solid var(--k-line);
  border-radius: 4px;
  color: var(--k-muted);
  font-size: 0.72rem;
}

.product-card-more {
  position: absolute;
  right: 16px;
  bottom: 15px;
  color: var(--k-accent);
  font-weight: 700;
}

.badge-maintenance {
  margin-inline-start: 6px;
  padding: 3px 6px;
  border-radius: 4px;
  background: #fff2c7;
  color: #624e10;
  font-size: 0.68rem;
  vertical-align: middle;
}

.product-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--k-line);
  border-radius: var(--k-radius);
  background: #fff;
}

.product-table-list {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
}

.product-table-list th,
.product-table-list td {
  padding: 13px 12px;
  border: 0;
  border-bottom: 1px solid var(--k-line);
  text-align: left;
  vertical-align: middle;
}

.product-table-list th {
  background: var(--k-surface-muted);
  color: #4e5d66;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.product-table-list tr:last-child td {
  border-bottom: 0;
}

.product-table-list tr:nth-child(even) {
  background: #fbfcfc;
}

.product-table-list tr:hover {
  background: var(--k-accent-soft);
}

.product-table-list td:first-child {
  width: 84px;
}

.product-table-list td img {
  width: 58px;
  height: 42px;
  object-fit: contain;
  border-radius: 5px;
}

.product-table-name {
  color: var(--k-ink);
  font-weight: 680;
  text-decoration: none;
}

/* Product-page local navigation: fixes the previous mobile overflow. */
.product-nav-menu {
  display: block;
  max-width: 100%;
  margin: 0 0 24px;
  overflow-x: auto;
  border-bottom: 1px solid var(--k-line);
  scrollbar-width: thin;
}

.product-nav-menu ul {
  display: flex;
  width: max-content;
  min-width: 100%;
  gap: 2px;
  justify-content: flex-start;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-nav-menu li {
  flex: 0 0 auto;
}

.product-nav-menu a {
  display: block;
  padding: 9px 12px 10px;
  border-bottom: 2px solid transparent;
  color: var(--k-muted);
  font-size: 0.9rem;
  font-weight: 590;
  text-decoration: none;
}

.product-nav-menu li.active a,
.product-nav-menu a:hover {
  border-bottom-color: var(--k-accent);
  color: var(--k-accent-dark);
}

/* Product support */
.product-support-panel {
  max-width: 860px;
  margin: 34px auto 0;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid var(--k-line);
  border-radius: var(--k-radius);
  background: var(--k-surface);
}

.product-support-header {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--k-line);
}

.product-support-header .product-support-kicker {
  margin: 0 0 4px;
  color: var(--k-accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page-content .product-support-header h2 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
}

.product-support-header p:last-child {
  max-width: 680px;
  margin: 0;
  color: var(--k-muted);
}

.product-support-type {
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

.product-support-type legend,
.product-support-field > label {
  display: block;
  margin-bottom: 8px;
  color: var(--k-ink);
  font-size: 0.92rem;
  font-weight: 680;
}

.product-support-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.product-support-type-grid label {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--k-line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.product-support-type-grid label:has(input:checked) {
  border-color: var(--k-accent);
  background: var(--k-accent-soft);
  color: var(--k-accent-dark);
}

.product-support-type-grid input {
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--k-accent);
}

.product-support-field {
  margin-bottom: 18px;
}

.product-support-field .form-control,
.product-support-field .form-select {
  min-height: 44px;
  border-color: #cbd4d9;
  border-radius: 7px;
  background-color: #fff;
}

.product-support-field textarea.form-control {
  min-height: 112px;
  resize: vertical;
}

.product-support-field .form-control:focus,
.product-support-field .form-select:focus {
  border-color: var(--k-accent);
  box-shadow: 0 0 0 0.2rem rgba(49, 95, 130, 0.14);
}

.product-support-field small {
  display: block;
  margin-top: 5px;
  color: var(--k-muted);
}

.product-support-optional {
  margin-top: 24px;
  border-top: 1px solid var(--k-line);
  border-bottom: 1px solid var(--k-line);
}

.product-support-optional summary {
  padding: 15px 2px;
  color: var(--k-accent-dark);
  font-weight: 680;
  cursor: pointer;
}

.product-support-optional summary span,
.product-support-optional > p {
  color: var(--k-muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.product-support-optional > p {
  margin: 0 0 18px;
}

.product-support-fields-grid,
.product-support-bug-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

.product-support-fields-grid .product-support-field:first-child,
.product-support-bug-fields .product-support-field:first-child {
  grid-column: 1 / -1;
}

.product-support-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
}

.product-support-actions .btn {
  min-width: 112px;
  min-height: 44px;
  border-color: var(--k-accent) !important;
  background: var(--k-accent) !important;
  color: #fff !important;
  font-weight: 650;
}

.product-support-actions .btn:hover {
  border-color: var(--k-accent-dark) !important;
  background: var(--k-accent-dark) !important;
}

.product-support-required-note {
  margin: 0;
  color: var(--k-muted);
  font-size: 0.82rem;
}

.product-support-result {
  margin: 20px 0 0;
  padding: 12px 14px;
  border-left: 3px solid #3f7a59;
  background: #edf5f0;
  color: #28543b;
}

.product-support-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* Footer */
.kakitiro-footer.site-footer {
  padding: 46px 0 36px;
  border-top: 1px solid var(--k-line);
  background: #27343c;
  color: #cbd3d7;
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(130px, 1fr));
  gap: 34px;
}

.footer-brand {
  min-width: 0;
}

.footer-site-name {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 720;
  text-decoration: none;
}

.footer-site-name:hover {
  color: #fff;
}

.footer-text {
  max-width: 340px;
  margin-top: 12px;
  color: #b7c1c6;
}

.footer-copyright {
  margin: 18px 0 0;
  color: #9eaaaf;
  font-size: 0.78rem;
}

.footer-column h2 {
  margin: 2px 0 12px;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 680;
}

.footer-column ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-column li {
  margin: 7px 0;
}

.footer-column a {
  color: #cbd3d7;
  text-decoration: none;
}

.footer-column a:hover {
  color: #fff;
  text-decoration: underline;
}

@media (min-width: 992px) {
  .kakitiro-header .header-right.collapse {
    display: flex !important;
  }
}

@media (max-width: 991.98px) {
  .kakitiro-header .header-container {
    min-height: 64px;
    flex-wrap: wrap;
    gap: 0;
  }

  .site-menu-toggle {
    display: block;
  }

  .kakitiro-header .header-right {
    flex: 0 0 calc(100% + 40px);
    width: calc(100% + 40px);
    margin: 0 -20px;
    padding: 8px 20px 18px;
    border-top: 1px solid var(--k-line);
    background: #fff;
  }

  .kakitiro-header .header-right.collapse:not(.show):not(.collapsing) {
    display: none;
  }

  .kakitiro-header .header-right.show,
  .kakitiro-header .header-right.collapsing {
    display: block;
  }

  .kakitiro-header .site-menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
    margin-bottom: 12px;
  }

  .kakitiro-header .nav-link {
    display: block;
    padding: 9px;
  }

  .kakitiro-header .header-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .header-search input {
    width: 100%;
  }

  .product-card-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  body.layout-fixed .container,
  .container {
    width: min(calc(100% - 28px), var(--k-content));
  }

  .site-main {
    padding: 34px 0 50px;
  }

  body.page-home .site-main {
    padding-top: 42px;
  }

  .cms-page > h1 {
    font-size: clamp(1.7rem, 7.4vw, 2rem);
  }

  body.page-home .cms-page > h1 {
    font-size: clamp(2.05rem, 10.5vw, 2.7rem);
  }

  .kakitiro-header .header-right {
    flex-basis: calc(100% + 28px);
    width: calc(100% + 28px);
    margin-inline: -14px;
    padding-inline: 14px;
  }

  .k-section {
    margin-top: 44px;
  }

  .k-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .k-home-links,
  .product-card-list,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .product-finder {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .product-support-panel {
    margin-top: 26px;
    padding: 20px 16px;
  }

  .product-support-type-grid,
  .product-support-fields-grid,
  .product-support-bug-fields {
    grid-template-columns: 1fr;
  }

  .product-support-fields-grid .product-support-field:first-child,
  .product-support-bug-fields .product-support-field:first-child {
    grid-column: auto;
  }

  .product-table-scroll {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .product-table-list,
  .product-table-list tbody,
  .product-table-list tr,
  .product-table-list td {
    display: block;
    width: 100%;
  }

  .product-table-list thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .product-table-list tr {
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid var(--k-line);
    border-radius: var(--k-radius);
    background: #fff;
  }

  .product-table-list td,
  .product-table-list td:first-child {
    width: 100%;
    padding: 5px 0;
    border: 0;
  }

  .product-table-list td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 1px;
    color: var(--k-muted);
    font-size: 0.7rem;
    font-weight: 680;
  }

  .product-table-list td img {
    width: 76px;
    height: 54px;
  }

  .footer-brand {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
