:root {
  color-scheme: light;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.matter-list-page {
  background-color: #fbfaf6;
  color: #1f2937;
}

.matter-list {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
  min-height: 100vh;
  padding-bottom: 4rem;
}

.matter-list__hero {
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.5), rgba(255, 247, 237, 0.7));
  padding: 3rem 1.5rem 4rem;
}

.matter-list__hero-inner {
  margin: 0 auto;
  max-width: 1120px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.matter-list__breadcrumbs ol {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
  flex-wrap: wrap;
}

.matter-list__breadcrumbs a {
  color: #f43f5e;
  text-decoration: none;
  font-weight: 600;
}

.matter-list__breadcrumbs li:last-child {
  color: #111827;
  font-weight: 600;
}

.matter-list__heading h1 {
  font-size: clamp(2rem, 2.6vw + 1rem, 2.75rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #111827;
}

.matter-list__heading p {
  max-width: 680px;
  font-size: 1rem;
  line-height: 1.8;
  color: #4b5563;
}

.matter-list__search {
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 32px;
  padding: 2.25rem;
  box-shadow: 0 24px 45px -32px rgba(244, 63, 94, 0.55);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.matter-list__errors {
  border-radius: 16px;
  background: rgba(254, 202, 202, 0.25);
  border: 1px solid rgba(248, 113, 113, 0.35);
  padding: 1rem 1.25rem;
  color: #b91c1c;
  font-size: 0.9375rem;
}

.matter-list__errors ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.matter-list__search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 1rem;
  align-items: center;
}

.matter-list__search-field {
  position: relative;
  display: block;
}

.matter-list__search-field input {
  width: 100%;
  border-radius: 9999px;
  border: 1px solid rgba(244, 114, 182, 0.25);
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.85), rgba(255, 255, 255, 0.95));
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.matter-list__search-field input:focus-visible {
  outline: none;
  border-color: #f43f5e;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.25);
  background: #ffffff;
}

.matter-list__sort {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.matter-list__sort label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #f43f5e;
  text-transform: uppercase;
}

.matter-list__sort select {
  border-radius: 9999px;
  border: 1px solid rgba(244, 63, 94, 0.35);
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #dc2626;
  background: #ffffff;
  box-shadow: 0 16px 30px -22px rgba(244, 63, 94, 0.65);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.matter-list__sort select:focus-visible {
  outline: none;
  border-color: #f43f5e;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.2);
}

.matter-list__search-button {
  border: none;
  border-radius: 9999px;
  background: linear-gradient(135deg, #f43f5e, #fb7185);
  color: #fff;
  font-weight: 600;
  padding: 0.9rem 1.8rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
  box-shadow: 0 16px 28px -18px rgba(244, 63, 94, 0.7);
}

.matter-list__search-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px -18px rgba(244, 63, 94, 0.8);
}

.matter-list__filters summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #f43f5e;
}

.matter-list__filters summary::-webkit-details-marker {
  display: none;
}

.matter-list__filters[open] summary {
  color: #be123c;
}

.matter-list__filters-count {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  background: rgba(244, 63, 94, 0.12);
  color: #be123c;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
}

.matter-list__filters-body {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.filter-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filter-section h2 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #374151;
  letter-spacing: 0.02em;
}

.filter-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.filter-section__note {
  font-size: 0.75rem;
  color: #9ca3af;
}

.filter-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-chip {
  display: inline-flex;
  position: relative;
  align-items: center;
}

.filter-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.filter-chip span {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.1rem;
  border-radius: 9999px;
  border: 1px solid rgba(248, 113, 113, 0.38);
  background: #ffffff;
  color: #be123c;
  font-weight: 600;
  font-size: 0.85rem;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-chip input:checked + span {
  background: linear-gradient(135deg, #f43f5e, #fb7185);
  color: #fff;
  border-color: #f43f5e;
  box-shadow: 0 12px 28px -20px rgba(244, 63, 94, 0.75);
}

.filter-chip input:focus-visible + span {
  outline: 3px solid rgba(244, 63, 94, 0.3);
  outline-offset: 2px;
}

/* 解除可能なフィルターチップ */
.filter-chip--clearable {
  position: relative;
}

.filter-chip--clearable span {
  padding-right: 1.1rem;
  transition: padding-right 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-chip--clearable input:checked + span {
  padding-right: 2.2rem;
}

.filter-chip__clear {
  display: none;
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #be123c;
  transition: background 0.15s ease, color 0.15s ease;
}

.filter-chip__clear:hover {
  background: #fff;
  color: #9f1239;
}

.filter-chip--clearable input:checked ~ .filter-chip__clear {
  display: flex;
}

/* チェックボックス（成約済み案件用） */
.filter-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
}

.filter-checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.filter-checkbox__box {
  position: relative;
  width: 22px;
  height: 22px;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  flex-shrink: 0;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.filter-checkbox__box::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 7px;
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.filter-checkbox input:checked + .filter-checkbox__box {
  background: linear-gradient(135deg, #f43f5e, #fb7185);
  border-color: #f43f5e;
  box-shadow: 0 4px 12px -4px rgba(244, 63, 94, 0.5);
}

.filter-checkbox input:checked + .filter-checkbox__box::after {
  opacity: 1;
}

.filter-checkbox input:focus-visible + .filter-checkbox__box {
  outline: 3px solid rgba(244, 63, 94, 0.3);
  outline-offset: 2px;
}

.filter-checkbox__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid rgba(229, 231, 235, 0.6);
  margin-top: 0.5rem;
}

.filter-clear-all {
  padding: 0.6rem 1.2rem;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.filter-clear-all:hover {
  border-color: #f43f5e;
  color: #f43f5e;
  background: rgba(254, 242, 242, 0.5);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

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

.filter-section input[type="text"],
.filter-section select,
.filter-section input[type="number"] {
  border-radius: 14px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  padding: 0.75rem 0.9rem;
  font-size: 0.95rem;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-section input[type="text"]:focus-visible,
.filter-section select:focus-visible,
.filter-section input[type="number"]:focus-visible {
  outline: none;
  border-color: #f43f5e;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.2);
}

.filter-inline-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  color: #6b7280;
  font-size: 0.85rem;
}

.matter-list__result-header {
  padding: 0 1.5rem;
}

.matter-list__result-inner {
  margin: 0 auto;
  max-width: 1120px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.matter-list__result-inner h2 {
  font-size: clamp(1.5rem, 1.8vw + 1rem, 2rem);
  font-weight: 700;
  color: #1f2937;
}

.matter-list__result-inner p {
  color: #6b7280;
  font-size: 0.95rem;
}

.matter-list__results {
  padding: 0 1.5rem;
}

.matter-card-grid {
  margin: 0 auto;
  max-width: 1120px;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.matter-card {
  position: relative;
  border-radius: 28px;
  background: linear-gradient(135deg, #ffffff, rgba(255, 241, 242, 0.8));
  border: 1px solid rgba(252, 231, 243, 0.7);
  overflow: hidden;
  box-shadow: 0 28px 35px -30px rgba(190, 24, 93, 0.7);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.matter-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 36px 48px -28px rgba(190, 24, 93, 0.75);
}

.matter-card__link {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.75rem;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.matter-card__badge {
  position: absolute;
  top: 1.5rem;
  right: -2.5rem;
  transform: rotate(35deg);
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  font-weight: 700;
  padding: 0.4rem 2.75rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.matter-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.matter-card__labels {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.matter-card__label {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.matter-card__label--primary {
  background-color: rgba(248, 113, 113, 0.18);
  color: #c2410c;
}

.matter-card__label--outline {
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #f43f5e;
  background: rgba(255, 255, 255, 0.9);
}

.matter-card__summary {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: rgba(255, 255, 255, 0.75);
  border-radius: 20px;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(248, 113, 113, 0.18);
}

.matter-card__summary dt {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
}

.matter-card__summary dd {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #111827;
}

.matter-card__title h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: #111827;
  line-height: 1.4;
}

.matter-card__title span {
  font-size: 0.8rem;
  color: #9ca3af;
}

.matter-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.matter-card__tag {
  background: rgba(248, 113, 113, 0.12);
  color: #be123c;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
}

.matter-card__tag--accent {
  background: linear-gradient(135deg, #fb7185, #f43f5e);
  color: #fff;
}

.matter-card__budget {
  display: flex;
  align	items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.matter-card__budget-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #f43f5e;
}

.matter-card__budget-note {
  border-radius: 9999px;
  border: 1px solid rgba(248, 113, 113, 0.3);
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #be123c;
}

.matter-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.matter-card__profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.matter-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(248, 113, 113, 0.35);
  background: #fff;
}

.matter-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.matter-card__nickname {
  font-weight: 600;
  color: #1f2937;
}

.matter-card__cta {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f43f5e;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.matter-card__cta::after {
  content: "→";
  font-size: 1rem;
}

.matter-list__empty {
  margin: 0 auto;
  max-width: 720px;
  border-radius: 24px;
  border: 1px dashed rgba(248, 113, 113, 0.45);
  background: rgba(255, 255, 255, 0.9);
  padding: 2.5rem;
  text-align: center;
  color: #6b7280;
  line-height: 1.6;
}

.matter-pagination {
  margin: 0 auto;
  margin-top: 2.5rem;
  max-width: 1120px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  border: 1px solid rgba(229, 231, 235, 0.6);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.matter-pagination__status {
  font-size: 0.9rem;
  color: #4b5563;
}

.matter-pagination__actions {
  display: flex;
  gap: 0.75rem;
}

.matter-pagination__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  border-radius: 9999px;
  border: 1px solid rgba(209, 213, 219, 0.9);
  padding: 0.65rem 1.1rem;
  font-weight: 600;
  color: #4b5563;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.matter-pagination__button--primary {
  border-color: #f43f5e;
  background: linear-gradient(135deg, #f43f5e, #fb7185);
  color: #fff;
  box-shadow: 0 16px 26px -20px rgba(244, 63, 94, 0.6);
}

.matter-pagination__button--primary:hover {
  box-shadow: 0 18px 32px -18px rgba(244, 63, 94, 0.75);
}

.matter-pagination__button.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.matter-list__noscript-footer {
  background: #f9fafb;
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: #6b7280;
}

.matter-list__noscript-footer a {
  color: #f43f5e;
  margin: 0 0.6rem;
  text-decoration: none;
}

@media (max-width: 1024px) {
  .matter-list__search {
    padding: 1.75rem;
    border-radius: 24px;
  }
}

@media (max-width: 768px) {
  .matter-list {
    gap: 2.5rem;
    padding-bottom: 3rem;
  }

  .matter-list__hero {
    padding: 2.5rem 1rem 3rem;
  }

  .matter-list__search-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  .matter-list__sort,
  .matter-list__search-button {
    width: 100%;
  }

  .matter-list__search-button {
    padding: 0.85rem 1.2rem;
  }

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

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

  .matter-card__link {
    padding: 1.5rem;
  }

  .matter-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .matter-pagination__actions {
    width: 100%;
    flex-direction: column;
  }

  .matter-pagination__button,
  .matter-pagination__button--primary {
    width: 100%;
  }
}
