﻿.filter-actions--details {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.btn-link--sm {
  font-size: 0.85rem;
}

:root {
  --color-bg: #ebeff5;
  --color-bg-alt: #dde3ec;
  --color-surface: #ffffff;
  --color-surface-hover: #f5f7fb;
  --color-text: #2d3748;
  --color-text-muted: #64748b;
  --color-border: rgba(148, 163, 184, 0.28);
  --color-accent: #2563eb;
  --color-accent-soft: rgba(37, 99, 235, 0.14);
  --color-accent-strong: #1d4ed8;
  --color-danger: #f87171;
  --shadow-card: 0 14px 32px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 6px 20px rgba(15, 23, 42, 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: "Noto Sans JP", "Segoe UI", sans-serif;
  --font-mono: "Roboto Mono", "SFMono-Regular", Menlo, monospace;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: linear-gradient(160deg, var(--color-bg) 0%, var(--color-bg-alt) 40%, var(--color-bg) 100%);
}

a {
  color: var(--color-accent);
  transition: color 0.2s ease;
}

a:hover,
a:focus-visible {
  color: var(--color-accent-strong);
}

header {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  padding: 16px 28px 18px;
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 0;
  z-index: 20;
}

header h1 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1f2937;
}

nav {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

nav a:hover,
nav a:focus-visible {
  color: var(--color-accent);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.25);
}

.nav-spacer {
  flex: 1 1 auto;
}

.nav-user {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
}

.nav-logout button {
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #ffffff;
  color: var(--color-text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-logout button:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 18px rgba(37, 99, 235, 0.2);
  color: var(--color-accent-strong);
}

main {
  padding: 32px clamp(16px, 4vw, 36px) 64px;
  margin: 0 auto;
}

.card {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 248, 252, 0.98) 100%);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(148, 163, 184, 0.15);
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border-top: 3px solid rgba(37, 99, 235, 0.18);
  pointer-events: none;
}

.card h2 {
  margin-top: 0;
  font-size: 1.28rem;
  letter-spacing: 0.02em;
  color: #1f2937;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  border: none;
  color: #ffffff;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-strong) 85%);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.3);
}

.btn--sm {
  padding: 6px 14px;
  font-size: 0.85rem;
}

.btn--ghost {
  background: #f8fafc;
  color: var(--color-accent);
  border: 1px solid rgba(37, 99, 235, 0.35);
  box-shadow: none;
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  box-shadow: none;
  background: #eef2ff;
}

.btn.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.btn.is-loading::after {
  content: "";
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-top-color: #fff;
  animation: ft-spin 0.8s linear infinite;
  margin-left: 0.6rem;
}

.btn-link {
  color: var(--color-accent);
  text-decoration: none;
  font-size: 0.9rem;
  position: relative;
  padding-bottom: 2px;
}

.btn-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  opacity: 0.65;
  transition: opacity 0.2s ease;
}

.btn-link:hover::after {
  opacity: 1;
}

.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;
}

.switch-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 6px;
  font-size: 0.92rem;
  color: var(--color-text-muted);
}

.switch-nav .separator {
  color: rgba(148, 163, 184, 0.5);
}

.switch-nav span {
  color: var(--color-accent-strong);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.flash-container {
  max-width: 1080px;
  margin: 18px auto 0;
  padding: 0 28px;
}

.flash {
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 10px;
  background: rgba(37, 99, 235, 0.12);
  color: #1f2937;
  border: 1px solid rgba(37, 99, 235, 0.25);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.flash--error {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.3);
  color: #b91c1c;
}

.flash--success {
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.3);
  color: #0f766e;
}

.table-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 70vh;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.2);
  margin-top: 20px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.6);
  position: relative;
}

.table-scroll table {
  min-width: 960px;
}

.ft-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--color-text);
  table-layout: auto;
}

.ft-table thead th {
  background: #f1f4f9;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  border-left: 1px solid rgba(148, 163, 184, 0.2);
  border-right: 1px solid rgba(148, 163, 184, 0.2);
  text-align: left;
  color: #475569;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ft-table thead th:first-child {
  border-left: none;
}

.ft-table thead th:last-child {
  border-right: none;
}

.ft-table thead th.is-sortable {
  padding: 0;
}

.ft-table thead th .table-sort {
  width: 100%;
  height: 100%;
  padding: 12px;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  text-align: left;
}

.ft-table thead th .table-sort:hover,
.ft-table thead th .table-sort:focus-visible {
  background: rgba(37, 99, 235, 0.08);
}

.ft-table thead th .table-sort:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.ft-table thead th .table-sort .table-sort__label {
  flex: 1 1 auto;
}

.ft-table thead th .sort-indicator {
  font-size: 0.75rem;
  opacity: 0.6;
  min-width: 0.75rem;
  text-align: right;
}

.ft-table thead th.is-sorted-asc,
.ft-table thead th.is-sorted-desc {
  color: var(--color-accent-strong);
}

.ft-table thead th.is-sorted-asc .sort-indicator,
.ft-table thead th.is-sorted-desc .sort-indicator {
  opacity: 1;
}

.ft-table tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  border-left: 1px solid rgba(226, 232, 240, 0.6);
  border-right: 1px solid rgba(226, 232, 240, 0.6);
  font-size: 0.95rem;
  vertical-align: top;
  background: #ffffff;
  white-space: nowrap;
}

.ft-table thead th.table-detail-header {
  width: 56px;
  text-align: center;
  padding: 12px 8px;
}

.ft-table tbody td:first-child {
  border-left: none;
}

.ft-table tbody td:last-child {
  border-right: none;
}

.ft-table tbody td.detail-cell {
  padding: 10px 6px;
  text-align: center;
  vertical-align: middle;
}

.ft-table tbody tr:nth-of-type(odd) td {
  background: #f8fafc;
}

.ft-table tbody tr:hover td {
  background: rgba(37, 99, 235, 0.08);
}

.entry-normalized-table tbody th {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: #f8fafc;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.entry-normalized-table__required {
  color: var(--color-danger);
  margin-left: 0.25rem;
  font-size: 0.85em;
}

.entry-normalized-table__row {
  transition: background 0.2s ease;
}

.entry-normalized-table__row:hover th,
.entry-normalized-table__row:hover td {
  background: rgba(37, 99, 235, 0.08);
}

.entry-normalized-table__row--disabled {
  opacity: 0.55;
}

.entry-normalized-table__status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.entry-card__status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(148, 163, 184, 0.18);
  color: #475569;
}

.entry-card__status--ok {
  background: rgba(37, 99, 235, 0.18);
  color: var(--color-accent-strong);
}

.entry-card__status--warn {
  background: rgba(234, 179, 8, 0.2);
  color: #92400e;
}

.entry-card__status--muted {
  background: rgba(107, 114, 128, 0.18);
  color: #4b5563;
}

.ft-table td.numeric {
  text-align: right;
  font-family: var(--font-mono);
  min-width: 80px;
}

.ft-table thead th.numeric {
  text-align: right;
  min-width: 80px;
}

.detail-trigger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-accent-strong);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.detail-trigger-btn:hover,
.detail-trigger-btn:focus-visible {
  background: rgba(37, 99, 235, 0.16);
  color: #1d4ed8;
  transform: scale(1.05);
}

.detail-trigger-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.ft-table td.table-memo {
  min-width: 240px;
  max-width: 300px;
  white-space: normal;
  word-break: break-word;
  font-size: 0.9rem;
}

.ft-table td.actions {
  text-align: right;
}

.cell-main {
  display: block;
  font-weight: 600;
  color: #1f2937;
}

.cell-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(148, 163, 184, 0.18);
  color: #1f2937;
}

.badge--success {
  background: rgba(37, 99, 235, 0.18);
  color: var(--color-accent-strong);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.25);
}

.badge--warning {
  background: rgba(250, 204, 21, 0.18);
  color: #b45309;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.3);
}

.badge--danger {
  background: rgba(248, 113, 113, 0.18);
  color: #b91c1c;
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.3);
}

.spec-flag-badge {
  text-transform: none;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.spec-flag-badge--inline {
  flex-shrink: 0;
}

.model-name-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.model-name-text {
  display: inline-block;
  min-width: 0;
}

.badge--muted {
  background: rgba(148, 163, 184, 0.15);
  color: var(--color-text-muted);
}

.table-empty {
  margin-top: 28px;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.summary-card {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.5);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.summary-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.summary-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #1f2937;
}

.summary-card__action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.summary-card__action[aria-busy="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.summary-card--highlight {
  background: rgba(16, 185, 129, 0.1);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18);
}

.summary-card dl {
  margin: 0;
}

.summary-card dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.summary-card dd {
  margin: 0 0 0.75rem;
  color: var(--color-text);
  word-break: break-word;
}

.summary-card dd:last-of-type {
  margin-bottom: 0;
}

.summary-card__action span[aria-hidden="true"] {
  font-size: 0.95rem;
}

.ft-table .price {
  white-space: nowrap;
  display: inline-block;
}

.rod-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 2000;
}

.rod-detail-overlay[hidden] {
  display: none;
}

.rod-detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 92vw);
  background: #ffffff;
  box-shadow: -8px 0 20px rgba(15, 23, 42, 0.18);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  z-index: 2001;
  display: flex;
  flex-direction: column;
}

.rod-detail-drawer.is-open {
  transform: translateX(0);
}

.rod-detail-drawer[hidden] {
  display: none;
}

body.rod-detail-open {
  overflow: hidden;
}

.rod-detail-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.rod-detail-drawer__header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1f2937;
}

.rod-detail-drawer__close {
  border: none;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  color: rgba(15, 23, 42, 0.6);
  transition: background 0.2s ease, color 0.2s ease;
}

.rod-detail-drawer__close:hover,
.rod-detail-drawer__close:focus-visible {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.rod-detail-drawer__close:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.rod-detail-drawer__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 24px 10px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.rod-detail-drawer__model {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
}

.rod-detail-drawer__updated {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.rod-detail-drawer__tabs {
  display: flex;
  gap: 6px;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.rod-detail-tab {
  flex: 1 1 auto;
  border: none;
  background: rgba(148, 163, 184, 0.16);
  color: #475569;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.rod-detail-tab.is-active {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  transform: translateY(-1px);
}

.rod-detail-tab[aria-disabled="true"] {
  opacity: 0.5;
  cursor: default;
}

.rod-detail-drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 24px 24px;
  position: relative;
}

.rod-detail-drawer__state {
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: rgba(148, 163, 184, 0.18);
  color: #475569;
  font-size: 0.9rem;
}

.rod-detail-drawer__state.is-error {
  background: rgba(248, 113, 113, 0.2);
  color: #b91c1c;
}

.rod-detail-panel {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.rod-detail-panel.is-active {
  display: flex;
}

.rod-detail-basic {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
}

.rod-detail-basic__row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #f8fafc;
}

.rod-detail-basic__row dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin: 0;
}

.rod-detail-basic__row dd {
  margin: 0;
  font-weight: 600;
  color: #1f2937;
}

.rod-detail-audit__list {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.rod-detail-audit__row {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(148, 163, 184, 0.4);
  background: rgba(248, 250, 252, 0.6);
}

.rod-detail-audit__row dt {
  margin: 0 0 4px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.rod-detail-audit__row dd {
  margin: 0;
  font-size: 0.92rem;
  color: #1f2937;
  font-weight: 500;
}

.rod-detail-log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rod-detail-log__item {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.rod-detail-log__headline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.88rem;
  color: #1f2937;
  font-weight: 600;
}

.rod-detail-log__timestamp {
  color: #1d4ed8;
}

.rod-detail-log__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.rod-detail-log__tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  background: rgba(148, 163, 184, 0.18);
  color: #475569;
}

.rod-detail-log__summary {
  margin: 0 0 6px;
  font-size: 0.9rem;
  color: #334155;
}

.rod-detail-log__link {
  font-size: 0.85rem;
}

.rod-detail-log--empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.rod-detail-holding {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rod-detail-holding__total {
  margin: 0;
  font-weight: 700;
  color: #1f2937;
}

.rod-detail-holding__list {
  margin: 0;
  padding-left: 18px;
  color: #1f2937;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rod-detail-holding__item {
  font-size: 0.9rem;
}

.rod-detail-holding__empty {
  margin: 0;
  font-size: 0.88rem;
  color: var(--color-text-muted);
}

.rod-detail-holding__link {
  align-self: flex-start;
}

.rod-detail-memo {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rod-detail-memo__section {
  border-radius: var(--radius-md);
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #ffffff;
  padding: 12px 14px;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

.rod-detail-memo__heading {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1f2937;
}

.rod-detail-memo__content {
  font-size: 0.9rem;
  color: #1f2937;
  line-height: 1.6;
  word-break: break-word;
}

.rod-detail-memo__empty {
  color: var(--color-text-muted);
}

.ft-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 18px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.input,
.textarea,
select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #ffffff;
  color: var(--color-text);
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus,
.textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 18px rgba(37, 99, 235, 0.2);
}

.textarea {
  min-height: 110px;
  resize: vertical;
}

.form-errors {
  color: var(--color-danger);
  font-size: 0.85rem;
}

footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  padding: 24px 0 40px;
}

@media (max-width: 720px) {
  header {
    padding: 16px 18px 18px;
  }

  main {
    padding: 24px 18px 48px;
  }

  .card {
    padding: 20px;
  }

  .table-scroll table {
    min-width: 700px;
  }
}

.btn-link--disabled {
  color: #888;
  cursor: default;
  pointer-events: none;
  text-decoration: none;
  opacity: 0.6;
}

.ft-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 2000;
}

.ft-modal--open {
  display: flex;
}

.ft-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.ft-modal__dialog {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 8px;
  max-width: 640px;
  width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
}

.ft-modal__header,
.ft-modal__footer {
  padding: 1rem 1.25rem;
  background: #f6f7f8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ft-modal__title {
  font-size: 1.25rem;
  margin: 0;
}

/* フィルタフォーム */
.filter-form {
  margin-top: 20px;
  margin-bottom: 20px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, max-content));
  gap: 16px;
  align-items: end;
}

.filter-grid>.filter-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  min-width: auto;
}

.filter-grid>.filter-actions:not(.filter-actions--details) {
  justify-self: end;
  margin-left: auto;
}

.filter-grid>div:not(.filter-actions) {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-grid label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  font-weight: 500;
}

.filter-grid select,
.filter-grid input[type="text"],
.filter-grid input[type="search"] {
  width: 100%;
  min-width: 160px;
  max-width: 220px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #ffffff;
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.filter-grid select:focus,
.filter-grid input[type="text"]:focus,
.filter-grid input[type="search"]:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.15);
}

.filter-actions .btn {
  font-size: 0.9rem;
  padding: 8px 16px;
  flex-shrink: 0;
}

.filter-actions .btn-link {
  flex-shrink: 0;
  white-space: nowrap;
}

/* キーワード検索フィールドは少し広めに */
.filter-grid #q {
  max-width: 280px;
}

/* エラーメッセージ */
.input-error {
  display: block;
  font-size: 0.85rem;
  color: var(--color-danger);
  margin-top: 4px;
  line-height: 1.4;
}

.filter-grid input[aria-invalid="true"] {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1);
}

.filter-chips {
  display: none;
  margin: 12px 0 18px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(248, 250, 255, 0.9);
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.55);
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-chips.is-active {
  display: flex;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-accent-strong);
  font-size: 0.88rem;
  line-height: 1.2;
}

.filter-chip__remove {
  appearance: none;
  border: none;
  background: rgba(37, 99, 235, 0.18);
  color: var(--color-accent-strong);
  border-radius: 999px;
  width: 20px;
  height: 20px;
  font-size: 0.85rem;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.filter-chip__remove:hover,
.filter-chip__remove:focus-visible {
  background: var(--color-accent-strong);
  color: #ffffff;
}

.filter-chips__clear {
  margin-left: auto;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: #ffffff;
  color: var(--color-accent-strong);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chips__clear:hover,
.filter-chips__clear:focus-visible {
  background: rgba(37, 99, 235, 0.08);
  border-color: var(--color-accent-strong);
}

.filter-grid input[aria-invalid="true"]:focus {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2);
}

@media (max-width: 768px) {
  .filter-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .filter-grid select,
  .filter-grid input[type="text"],
  .filter-grid input[type="search"] {
    max-width: 100%;
  }

  .filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

.ft-modal__tools {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.ft-modal__body {
  padding: 1.25rem;
  overflow-y: auto;
  background: #fff;
}

.ft-modal__section+.ft-modal__section {
  margin-top: 1.25rem;
  border-top: 1px solid #e0e4ea;
  padding-top: 1.25rem;
}

.ft-modal__section-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: #1f2933;
}

.ft-modal__list {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(140px, 35%) 1fr;
  row-gap: 0.5rem;
  column-gap: 1rem;
}

.ft-modal__term {
  font-weight: 600;
  color: #52606d;
}

.ft-modal__definition {
  margin: 0;
  color: #102a43;
  word-break: break-word;
}

.ft-modal__placeholder {
  margin: 0;
  color: #52606d;
  text-align: center;
}

.ft-modal__placeholder--error {
  color: #c81e1e;
}

.ft-modal__timestamp {
  margin: 0;
  font-size: 0.85rem;
  color: #6c7a89;
}

.ft-modal__close {
  border: none;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.ft-modal-open {
  overflow: hidden;
}

@media (max-width: 600px) {
  .ft-modal__dialog {
    max-width: 100%;
    border-radius: 0.5rem;
  }

  .ft-modal__list {
    grid-template-columns: 1fr;
  }

  .ft-modal__term {
    font-size: 0.9rem;
  }
}

.ft-toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 2200;
}

.ft-toast {
  min-width: 220px;
  max-width: 320px;
  background: rgba(37, 99, 235, 0.95);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.25);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  animation: ft-toast-slide 0.25s ease forwards;
}

.ft-toast--success {
  background: rgba(16, 185, 129, 0.95);
}

.ft-toast--error {
  background: rgba(248, 113, 113, 0.95);
}

@keyframes ft-toast-slide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ft-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}


.holding-panel {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: flex-end;
  z-index: 2100;
}

.holding-panel[aria-hidden="false"] {
  display: flex;
}

.holding-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 32, 46, 0.45);
}

.holding-panel__dialog {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: 100%;
  background: #fff;
  box-shadow: -12px 0 32px rgba(16, 32, 46, 0.35);
  display: flex;
  flex-direction: column;
}

.holding-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #d9e2ec;
}

.holding-panel__title {
  margin: 0;
  font-size: 1.25rem;
}

.holding-panel__close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.holding-panel__content {
  padding: 1.25rem;
  overflow-y: auto;
}

.holding-panel__placeholder {
  text-align: center;
  color: #52606d;
  margin: 0;
}

.holding-panel__placeholder--error {
  color: #c81e1e;
}

.holding-panel-open {
  overflow: hidden;
}

.holding-detail--panel {
  box-shadow: none;
  border: none;
  padding: 0;
}

.holding-detail--panel .card-header {
  border-bottom: 1px solid #d9e2ec;
}

.holding-panel__messages {
  padding: 1rem 1.25rem 0;
}

.holding-detail__messages {
  margin-bottom: 1rem;
}

.holding-detail__close {
  margin-right: 0.5rem;
}

@media (max-width: 720px) {
  .holding-panel__dialog {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
  }
}


.holding-detail__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.holding-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.holding-detail__table-wrapper {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
}

.holding-detail-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  font-size: 0.875rem;
  background: #fff;
}

.holding-detail-table th,
.holding-detail-table td {
  border: 1px solid #d9e2ec;
  padding: 0.5rem 0.75rem;
  vertical-align: top;
}

.holding-detail-table th {
  background: #f0f4f8;
  font-weight: 600;
  white-space: nowrap;
}

.holding-detail-table__memo {
  min-width: 240px;
  white-space: normal;
}

.view-toggle {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.view-toggle .btn-link.is-active {
  font-weight: 600;
  text-decoration: underline;
}


.holding-detail--unavailable .flash {
  margin-bottom: 0;
}





.loading-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1050;
}

.loading-modal[hidden] {
  display: none;
}

.loading-modal__panel {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 1.75rem 2.25rem;
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.22);
  text-align: center;
  min-width: 240px;
}

.loading-modal__spinner {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem auto;
  border-radius: 50%;
  border: 4px solid rgba(148, 163, 184, 0.35);
  border-top-color: var(--color-accent);
  animation: fishtrack-loading-spin 0.9s linear infinite;
}

.loading-modal__text {
  font-weight: 600;
  letter-spacing: 0.04em;
}

body.has-loading-modal {
  overflow: hidden;
}

@keyframes fishtrack-loading-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* サマリーバー */
.summary-bar {
  display: flex;
  gap: 24px;
  padding: 16px 20px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  flex-wrap: wrap;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.summary-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  font-weight: 600;
}

.summary-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  font-family: var(--font-mono);
}

/* フィルタフォーム */
.filter-form {
  margin-bottom: 20px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  align-items: end;
}

.filter-grid--primary {
  margin-bottom: 16px;
}

.filter-grid--details {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.filter-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.filter-details {
  margin-top: 8px;
}

.filter-chips {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 20px;
  padding: 6px 0;
}

.filter-chips.is-active {
  display: flex;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(148, 163, 184, 0.12);
  font-size: 0.85rem;
  color: var(--color-text);
}

.filter-chip__label {
  white-space: nowrap;
}

.filter-chip__remove {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.filter-chip__remove:hover,
.filter-chip__remove:focus-visible {
  color: var(--color-text);
}

.filter-chips__clear {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--color-accent);
  font-size: 0.85rem;
  cursor: pointer;
  margin-left: auto;
  padding: 0 6px;
}

.filter-chips__clear:hover,
.filter-chips__clear:focus-visible {
  text-decoration: underline;
}

.filter-details-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-details-toggle:hover {
  background: rgba(148, 163, 184, 0.1);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.filter-details-toggle[aria-expanded="true"] .filter-details-toggle-icon {
  transform: rotate(180deg);
}

.filter-details-toggle-icon {
  transition: transform 0.2s ease;
  font-size: 0.75rem;
}

/* ページネーション */
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 16px 0;
  flex-wrap: nowrap !important;
  min-width: 0;
  width: 100%;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  flex-shrink: 1;
  flex-basis: auto;
}

.page-link:hover,
.page-link:focus-visible {
  background: var(--color-surface-hover);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.page-link.is-active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #ffffff;
  font-weight: 500;
}

.page-link.is-active:hover,
.page-link.is-active:focus-visible {
  background: var(--color-accent-strong);
  border-color: var(--color-accent-strong);
}

.pagination-total {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

.pagination-size {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-left: 16px;
  flex-shrink: 0;
  white-space: nowrap;
}

.perPage-select {
  width: 70px;
  padding: 6px 28px 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
  text-align: center;
}

.perPage-select:hover {
  border-color: var(--color-accent);
}

.perPage-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

/* Environment Indicator (Local Development Only) */
.env-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  color: #ffffff;
  text-align: center;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-family: var(--font-mono);
}

.env-indicator__text {
  display: inline-block;
  text-transform: uppercase;
}

/* Adjust header position when indicator is present */
.env-indicator+header {
  top: 40px;
}

/* ========================================
   Access Badge (公開モードインジケータ)
   ======================================== */

.ft-access-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  min-width: 120px;
  transition: all 0.2s ease;
  cursor: help;
}

.ft-access-badge--small {
  padding: 2px 8px;
  font-size: 0.75rem;
  min-width: 90px;
  gap: 4px;
}

.ft-access-badge__icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.ft-access-badge--small .ft-access-badge__icon {
  width: 14px;
  height: 14px;
}

.ft-access-badge__label {
  white-space: nowrap;
}

/* 一般公開 (public) - 緑 */
.ft-access-badge[data-access-level="public"] {
  background-color: rgba(27, 127, 93, 0.15);
  color: #1b7f5d;
}

.ft-access-badge[data-access-level="public"] .ft-access-badge__icon {
  color: #1b7f5d;
}

/* 限定公開 (limited) - 橙 */
.ft-access-badge[data-access-level="limited"] {
  background-color: rgba(196, 106, 0, 0.15);
  color: #c46a00;
}

.ft-access-badge[data-access-level="limited"] .ft-access-badge__icon {
  color: #c46a00;
}

/* 管理者のみ (admin) - 墨 */
.ft-access-badge[data-access-level="admin"] {
  background-color: rgba(59, 59, 59, 0.15);
  color: #3b3b3b;
}

.ft-access-badge[data-access-level="admin"] .ft-access-badge__icon {
  color: #3b3b3b;
}

/* ダークテーマ対応（将来拡張用） */
@media (prefers-color-scheme: dark) {
  .ft-access-badge[data-access-level="public"] {
    background-color: rgba(27, 127, 93, 0.3);
  }

  .ft-access-badge[data-access-level="limited"] {
    background-color: rgba(196, 106, 0, 0.3);
  }

  .ft-access-badge[data-access-level="admin"] {
    background-color: rgba(59, 59, 59, 0.3);
  }
}

/* ホバー時の強調 */
.ft-access-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ページHero内での配置 */
.page-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.page-hero h2,
.page-hero h1 {
  margin: 0;
  flex: 1 1 auto;
}

.page-hero .ft-access-badge {
  flex-shrink: 0;
}

/* モバイル対応 */
@media (max-width: 768px) {
  .page-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-hero .ft-access-badge {
    align-self: flex-start;
  }

  .ft-access-badge {
    min-width: 100px;
  }
}

/* ヘッダー内の小型バッジ */
header .ft-access-badge {
  margin-left: auto;
}

header nav .ft-access-badge {
  margin-left: 8px;
}