:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f4f6;
  color: #111827;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f3f4f6;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

.shipment-ticker { margin: 24px 0; padding: 16px 0; border-top: 1px solid #d1d5db; border-bottom: 1px solid #d1d5db; min-width: 0; }
.shipment-ticker-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.shipment-ticker-heading h2 { margin: 0; font-size: 17px; }
.shipment-ticker-heading button { padding: 6px 12px; border: 1px solid #9ca3af; border-radius: 4px; background: #fff; cursor: pointer; flex-shrink: 0; }
.shipment-ticker-caption, .shipment-ticker-message { color: #4b5563; font-size: 12px; margin: 8px 0 12px; }
.shipment-ticker-viewport { overflow: hidden; width: 100%; height: 280px; background: #fff; border-bottom: 1px solid #d1d5db; }
.shipment-ticker-track { width: 100%; animation: shipment-scroll var(--ticker-duration, 60s) linear infinite; }
.shipment-ticker-group { display: flex; flex-direction: column; }
.shipment-ticker-item, .shipment-ticker-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .7fr) minmax(0, 1fr); align-items: center; gap: 8px; padding: 0 12px; font-size: 13px; }
.shipment-ticker-columns { height: 38px; background: #e8edf0; color: #4b5563; font-size: 12px; border-radius: 6px 6px 0 0; }
.shipment-ticker-item { height: 56px; flex-shrink: 0; border-bottom: 1px solid #edf0f2; font-variant-numeric: tabular-nums; }
.shipment-ticker-item:nth-child(even) { background: #f8fafb; }
.shipment-ticker-item strong { justify-self: start; color: #0369a1; background: #e0f2fe; padding: 4px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.shipment-ticker-item[data-status="配達完了"] strong { color: #166534; background: #dcfce7; }
.shipment-ticker-item[data-status="保管中"] strong, .shipment-ticker-item[data-status="返送"] strong { color: #9a3412; background: #ffedd5; }
.shipment-ticker-viewport:hover .shipment-ticker-track, .shipment-ticker-track.is-paused { animation-play-state: paused; }
@keyframes shipment-scroll { to { transform: translateY(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .shipment-ticker-track { animation: none; }
  .shipment-ticker-viewport { overflow-y: auto; }
  .shipment-ticker-group[aria-hidden="true"] { display: none; }
}

.search-card,
.result-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.search-card {
  padding: 20px;
}

.title {
  margin: 0 0 12px;
  font-size: 24px;
}

.hint {
  margin: 0 0 8px;
  line-height: 1.6;
  color: #4b5563;
  font-size: 14px;
}

.search-guide {
  margin-top: 16px;
}

.search-guide summary {
  color: #4b5563;
  font-size: 14px;
  cursor: pointer;
}

.search-guide[open] summary {
  margin-bottom: 16px;
}

.search-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: #374151;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size: 16px;
}

.field input:focus {
  outline: 2px solid #bfdbfe;
  border-color: #2563eb;
}

.submit-button {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: #2563eb;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.submit-button:disabled {
  opacity: 0.65;
}

.faq-button {
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #f9fafb;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.faq-button:hover {
  background: #f3f4f6;
}

.faq-dialog {
  width: min(560px, calc(100% - 32px));
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.24);
}

.faq-dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
}

.faq-dialog-card {
  max-height: min(80vh, 720px);
  overflow-y: auto;
  padding: 22px;
  background: #fff;
  color: #111827;
}

.faq-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.faq-dialog-header h2 {
  margin: 0;
  font-size: 20px;
}

.faq-close-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.faq-content {
  display: grid;
  gap: 16px;
  line-height: 1.7;
  color: #4b5563;
  font-size: 14px;
}

.faq-content section {
  padding-bottom: 14px;
  border-bottom: 1px solid #e5e7eb;
}

.faq-content h3 {
  margin: 0 0 5px;
  color: #1f2937;
  font-size: 15px;
}

.faq-content p {
  margin: 0;
}

.faq-note {
  color: #6b7280;
  font-size: 13px;
}

.faq-contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.faq-contact-link,
.inquiry-open-button,
.inquiry-submit-button {
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.faq-contact-link-line {
  background: #06c755;
  color: #fff;
}

.faq-contact-link-email {
  background: #111827;
  color: #fff;
}

.inquiry-open-button {
  width: 100%;
  margin-top: 2px;
  background: #2563eb;
  color: #fff;
}

.inquiry-dialog {
  width: min(560px, calc(100% - 32px));
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.24);
}

.inquiry-dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
}

.inquiry-dialog-card {
  max-height: min(80vh, 720px);
  overflow-y: auto;
  padding: 22px;
  background: #fff;
  color: #111827;
}

.inquiry-intro {
  margin: 0 0 16px;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.6;
}

.inquiry-form {
  display: grid;
  gap: 14px;
}

.field textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font: inherit;
  font-size: 16px;
  resize: vertical;
}

.field textarea:focus {
  outline: 2px solid #bfdbfe;
  border-color: #2563eb;
}

.inquiry-status {
  min-height: 22px;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.inquiry-status.success {
  color: #047857;
}

.inquiry-status.error {
  color: #b91c1c;
}

.inquiry-submit-button {
  background: #2563eb;
  color: #fff;
}

.inquiry-submit-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.status {
  min-height: 24px;
  margin: 14px 2px;
  font-size: 14px;
}

.status.success {
  color: #047857;
}

.status.error {
  color: #b91c1c;
}

.status.empty {
  color: #6b7280;
}

.results {
  display: grid;
  gap: 12px;
}

.result-card {
  padding: 16px;
}

.row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}

.row:last-child {
  border-bottom: 0;
}

.row-block {
  grid-template-columns: 88px 1fr;
  align-items: start;
}

.label {
  color: #6b7280;
  font-size: 13px;
}

.value,
.tracking-link {
  color: #111827;
  word-break: break-word;
}

.tracking-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.tracking-link:hover {
  text-decoration: underline;
}

.hide-button {
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid #dc2626;
  border-radius: 8px;
  background: #fff;
  color: #b91c1c;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.hide-button:hover {
  background: #fef2f2;
}

.hide-button:disabled {
  cursor: default;
  opacity: 0.6;
}

.contact-dock {
  position: fixed;
  top: 50%;
  right: max(16px, calc((100vw - 720px) / 2 - 108px));
  z-index: 20;
  display: grid;
  gap: 14px;
  transform: translateY(-50%);
}

.contact-link {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.contact-link-line {
  background: #06c755;
}

.contact-link-email {
  background: #17191b;
}

.contact-link:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
}

.contact-line-icon {
  position: relative;
  width: 42px;
  height: 31px;
  border-radius: 9px;
  background: #fff;
  color: #06c755;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.contact-line-icon::after {
  content: '';
  position: absolute;
  right: 7px;
  bottom: -5px;
  border-width: 5px 0 0 7px;
  border-style: solid;
  border-color: transparent transparent transparent #fff;
}

.contact-mail-icon {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.log-summary {
  display: grid;
  gap: 8px;
}

.log-summary-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f9fafb;
  display: grid;
  gap: 4px;
  font-size: 13px;
}

.log-name-list {
  line-height: 1.6;
}

.log-history {
  margin-top: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.log-history summary {
  padding: 12px 14px;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.log-history-list {
  border-top: 1px solid #e5e7eb;
}

.log-history-item {
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
}

.log-history-item:last-child {
  border-bottom: 0;
}

.log-history-item .row {
  grid-template-columns: 72px 1fr;
}

@media (min-width: 768px) {
  .page {
    padding: 32px 20px;
  }

  .search-card {
    padding: 28px;
  }
}

@media (max-width: 920px) {
  .title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
  }

  .title {
    min-width: 0;
    margin: 0;
    font-size: 20px;
    line-height: 1.3;
  }

  .contact-dock {
    position: static;
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
    transform: none;
  }

  .contact-link {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    gap: 0;
    opacity: 0.86;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.14);
  }

  .contact-link:hover,
  .contact-link:focus-visible {
    opacity: 1;
  }

  .contact-label {
    display: none;
  }

  .contact-line-icon {
    width: 28px;
    height: 20px;
    border-radius: 6px;
    font-size: 7px;
  }

  .contact-mail-icon {
    width: 21px;
    height: 21px;
  }
}
