* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', sans-serif;
  font-weight: 400;
  color: #333333;
  background-color: #f0f2f5;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  padding: 24px 16px;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.page-header {
  padding: 24px 28px 20px;
  border-bottom: 2px solid #e8ebf0;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a4c9d;
  letter-spacing: 0.5px;
}

.error-summary {
  margin: 20px 28px 0;
  padding: 16px 20px;
  background-color: #fff5f5;
  border: 1px solid #e53e3e;
  border-left: 4px solid #e53e3e;
  border-radius: 4px;
}

.error-summary-title {
  font-size: 15px;
  font-weight: 700;
  color: #c53030;
  margin-bottom: 8px;
}

.error-summary-list {
  padding-left: 20px;
  font-size: 14px;
  color: #c53030;
}

.error-summary-list li {
  margin-bottom: 4px;
}

.error-summary-list li:last-child {
  margin-bottom: 0;
}

.success-message {
  margin: 20px 28px 0;
  padding: 16px 20px;
  background-color: #f0fff4;
  border: 1px solid #38a169;
  border-left: 4px solid #38a169;
  border-radius: 4px;
}

.success-title {
  font-size: 15px;
  font-weight: 700;
  color: #2f855a;
  margin-bottom: 8px;
}

.success-message p {
  font-size: 14px;
  color: #276749;
}

form {
  padding: 24px 28px 28px;
}

.form-section {
  margin-bottom: 32px;
}

.form-section:last-of-type {
  margin-bottom: 28px;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf0f5;
}

.section-bar {
  display: inline-block;
  width: 4px;
  height: 20px;
  background-color: #1a4c9d;
  border-radius: 2px;
  margin-right: 12px;
  flex-shrink: 0;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  color: #2d3748;
  letter-spacing: 0.3px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #2d3748;
  margin-bottom: 8px;
  padding: 10px 14px;
  background-color: #f7f8fa;
  border: 1px solid #e8ebf0;
  border-radius: 4px 4px 0 0;
  border-bottom: none;
}

.form-input,
.form-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: #2d3748;
  padding: 12px 14px;
  border: 1px solid #e8ebf0;
  border-radius: 0 0 4px 4px;
  background-color: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.searchable-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a0aec0'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 20px 20px;
  padding-right: 42px;
}

.searchable-input:hover {
  border-color: #1a4c9d;
}

.searchable-input:focus {
  border-color: #1a4c9d;
  box-shadow: 0 0 0 3px rgba(26, 76, 157, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #a0aec0;
}

.form-input:focus,
.form-textarea:focus {
  border-color: #1a4c9d;
  box-shadow: 0 0 0 3px rgba(26, 76, 157, 0.1);
}

.form-input[disabled],
.form-input[readonly].input-amount-disabled {
  background-color: #f4f6f9;
  color: #4a5568;
  cursor: not-allowed;
  -webkit-text-fill-color: #4a5568;
  opacity: 1;
}

.form-group.has-error .form-label {
  border-color: #e53e3e;
  background-color: #fff5f5;
}

.form-group.has-error .form-input,
.form-group.has-error .form-textarea {
  border-color: #e53e3e;
  background-color: #fffafa;
}

.form-group.has-error .input-with-unit .form-input {
  border-color: #e53e3e;
  background-color: #fffafa;
}

.form-group.has-error .input-with-unit .unit {
  border-color: #e53e3e;
  background-color: #fff5f5;
}

.error-text {
  margin-top: 6px;
  font-size: 13px;
  color: #c53030;
  padding-left: 4px;
}

.input-with-unit {
  display: flex;
  align-items: stretch;
}

.input-unit {
  border-radius: 0 0 0 4px;
  flex: 1;
}

.input-with-unit .form-input {
  border-right: none;
}

.unit {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  background-color: #f7f8fa;
  border: 1px solid #e8ebf0;
  border-left: none;
  border-radius: 0 0 4px 0;
  font-size: 14px;
  font-weight: 500;
  color: #4a5568;
  min-width: 48px;
}

.unit-disabled {
  background-color: #f0f2f5;
  color: #718096;
  cursor: not-allowed;
}

.amount-info-wrap {
  margin-top: 10px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 14px;
  line-height: 1.5;
}

.amount-target {
  font-weight: 700;
  color: #1a4c9d;
  display: none;
}

.amount-fee {
  display: none;
  color: #4a5568;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.amount-target[style*='display: '] + .amount-fee,
.amount-target[style=''] + .amount-fee {
  display: inline;
}

.form-actions {
  padding-top: 8px;
}

.btn-primary {
  width: 100%;
  padding: 16px 24px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  background-color: #1a4c9d;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
  box-shadow: 0 2px 6px rgba(26, 76, 157, 0.3);
}

.btn-primary:hover {
  background-color: #153d7d;
  box-shadow: 0 4px 10px rgba(26, 76, 157, 0.35);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(26, 76, 157, 0.3);
}

.btn-primary:disabled,
.btn-primary[disabled] {
  background-color: #5a7ab5;
  cursor: not-allowed;
  box-shadow: none;
  pointer-events: none;
  opacity: 0.9;
}

.btn-primary.is-loading {
  position: relative;
}

.btn-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 10px;
  animation: btn-spin 0.7s linear infinite;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-label {
  display: inline-block;
  vertical-align: middle;
}

.success-section {
  padding-top: 0px;
}

.success-section .section-title-wrap {
  border-bottom: none;
  margin-bottom: 18px;
  padding-bottom: 0;
}

.success-inner-wrap {
  padding: 24px 28px 28px;
}

.success-inner-wrap .success-message.success-panel {
  margin: 0;
}

.success-panel {
  margin-top: 18px;
  padding: 26px 22px;
  border: 1px solid #dce5f2;
  border-radius: 8px;
  background-color: #f6faff;
}

.success-panel .success-title {
  color: #1a4c9d;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #dce5f2;
}

.success-lead {
  font-size: 15px;
  font-weight: 600;
  color: #2d3748;
  margin: 0 0 14px 0;
}

.success-body {
  font-size: 14px;
  line-height: 1.8;
  color: #2d3748;
  margin: 0;
  white-space: normal;
}

.success-token {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed #cbd5e0;
  font-size: 13px;
  color: #4a5568;
}

.success-token-value {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  letter-spacing: 0.5px;
  color: #1a4c9d;
  font-weight: 600;
  word-break: break-all;
  margin-left: 6px;
}

.progress-section {
  padding-top: 0;
}

.progress-section .section-title-wrap {
  border-bottom: none;
  margin-bottom: 18px;
  padding-bottom: 0;
}

.progress-token {
  margin: 0 0 22px 0;
  padding: 12px 14px;
  background-color: #f7faff;
  border: 1px solid #dbe5f3;
  border-radius: 6px;
  font-size: 14px;
  color: #2d3748;
}

.progress-token .success-token-value {
  color: #1a4c9d;
  font-weight: 700;
}

.progress-stepper {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-step {
  position: relative;
  padding: 16px 18px 18px 58px;
  border-radius: 8px;
  border: 1px solid #e8ebf0;
  background-color: #ffffff;
}

.progress-step::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 58px;
  bottom: -10px;
  width: 2px;
  background-color: #e2e8f0;
}

.progress-step:last-child::before {
  display: none;
}

.progress-step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.progress-step-index {
  position: absolute;
  left: 18px;
  top: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  background-color: #e2e8f0;
  color: #718096;
  border: 2px solid #cbd5e0;
  box-sizing: border-box;
  flex-shrink: 0;
}

.progress-step-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #2d3748;
  letter-spacing: 0.3px;
}

.progress-step-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: #4a5568;
}

.progress-step.is-done {
  border-color: #c6f6d5;
  background-color: #f0fff4;
}

.progress-step.is-done .progress-step-index {
  background-color: #38a169;
  border-color: #2f855a;
  color: #ffffff;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
  color: transparent;
  text-indent: -9999px;
}

.progress-step.is-done .progress-step-title {
  color: #276749;
}

.progress-step.is-done::before {
  background-color: #c6f6d5;
  background-image: linear-gradient(to bottom, #38a169 0%, #c6f6d5 100%);
}

.progress-step.is-active {
  border-color: #bfdbfe;
  background-color: #eff6ff;
  box-shadow: 0 0 0 3px rgba(26, 76, 157, 0.06);
}

.progress-step.is-active .progress-step-index {
  background-color: #1a4c9d;
  border-color: #163f82;
  color: #ffffff;
  animation: progress-pulse 1.6s ease-in-out infinite;
}

.progress-step.is-active .progress-step-title {
  color: #1a4c9d;
}

@keyframes progress-pulse {
  0% { box-shadow: 0 0 0 0 rgba(26, 76, 157, 0.35); }
  70% { box-shadow: 0 0 0 8px rgba(26, 76, 157, 0); }
  100% { box-shadow: 0 0 0 0 rgba(26, 76, 157, 0); }
}

.progress-step.is-pending .progress-step-title {
  color: #718096;
}

.progress-note {
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid #feebc8;
  background-color: #fffaf0;
  border-radius: 8px;
  color: #744210;
}

.progress-note-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #744210;
}

.progress-note-list {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.8;
  color: #744210;
}

.progress-note-list li {
  margin-bottom: 4px;
}

.progress-note-list li:last-child {
  margin-bottom: 0;
}

.birth-date-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
  border-radius: 0 0 4px 4px;
}

.birth-field {
  display: flex;
  align-items: stretch;
  flex: 1 1 0;
  min-width: 0;
}

.birth-year {
  flex: 1.35 1 0;
}

.birth-field .form-input {
  border-radius: 0 0 0 4px;
  border-right: none;
  flex: 1 1 auto;
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.birth-field select.form-input {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a0aec0'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
  padding-right: 32px;
  cursor: pointer;
}

.birth-unit {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  background-color: #f7f8fa;
  border: 1px solid #e8ebf0;
  border-left: none;
  border-radius: 0 0 4px 0;
  font-size: 14px;
  font-weight: 500;
  color: #4a5568;
  flex: 0 0 auto;
  white-space: nowrap;
}

.form-group.has-error .birth-field .form-input {
  border-color: #e53e3e;
  background-color: #fffafa;
}

.form-group.has-error .birth-field select.form-input {
  border-color: #e53e3e;
}

.form-group.has-error .birth-unit {
  border-color: #e53e3e;
  background-color: #fff5f5;
}

@media (max-width: 480px) {
  body {
    padding: 0;
    background-color: #ffffff;
  }

  .container {
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
  }

  .page-header {
    padding: 20px 18px 16px;
  }

  .page-title {
    font-size: 19px;
  }

  .error-summary,
  .success-message {
    margin: 16px 18px 0;
    padding: 14px 16px;
  }

  form {
    padding: 20px 18px 24px;
  }

  .form-section {
    margin-bottom: 26px;
  }

  .section-title {
    font-size: 16px;
  }

  .form-label {
    font-size: 13px;
    padding: 9px 12px;
  }

  .form-input,
  .form-textarea {
    font-size: 14px;
    padding: 11px 12px;
  }

  .searchable-input {
    padding-right: 38px;
    background-position: right 12px center;
    background-size: 18px 18px;
  }

  .btn-primary {
    padding: 14px 20px;
    font-size: 15px;
  }

  .search-modal {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    top: 0;
    left: 0;
    transform: none;
  }

  .search-modal-table-wrap {
    max-height: calc(100vh - 240px);
  }

  .success-section {
    /* padding: 20px 18px 24px; */
  }

  .success-inner-wrap {
    padding: 20px 18px 24px;
  }

  .success-panel {
    padding: 20px 16px;
  }

  .success-panel .success-title {
    font-size: 17px;
  }

  .progress-stepper {
    gap: 12px;
  }

  .progress-step {
    padding: 14px 14px 16px 54px;
  }

  .progress-step-index {
    left: 14px;
    top: 12px;
  }

  .progress-step::before {
    left: 20px;
    top: 54px;
  }

  .progress-step-title {
    font-size: 15px;
  }

  .progress-step-desc {
    font-size: 13px;
  }

  .progress-token {
    font-size: 13px;
    padding: 11px 12px;
  }

  .progress-note {
    padding: 14px 14px;
  }

  .birth-date-row {
    gap: 8px;
  }

  .birth-year {
    flex: 1.2 1 0;
  }

  .birth-field .form-input {
    padding: 11px 10px;
    font-size: 14px;
  }

  .birth-field select.form-input {
    padding-right: 30px;
    background-position: right 8px center;
  }

  .birth-unit {
    padding: 0 8px;
    font-size: 13px;
  }
}

.search-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.search-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.search-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: 92%;
  max-width: 680px;
  max-height: 82vh;
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.search-modal.is-active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.search-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e8ebf0;
  flex-shrink: 0;
}

.search-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #2d3748;
}

.search-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background-color: transparent;
  font-size: 24px;
  line-height: 1;
  color: #718096;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.15s ease, color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-modal-close:hover {
  background-color: #f7f8fa;
  color: #2d3748;
}

.search-modal-search {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #edf0f5;
  flex-shrink: 0;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 34px;
  width: 20px;
  height: 20px;
  fill: #a0aec0;
  flex-shrink: 0;
  pointer-events: none;
}

.search-modal-input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  font-family: inherit;
  font-size: 15px;
  color: #2d3748;
  border: 1px solid #d5d8de;
  border-radius: 6px;
  background-color: #ffffff;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-modal-input::placeholder {
  color: #a0aec0;
}

.search-modal-input:focus {
  border-color: #1a4c9d;
  box-shadow: 0 0 0 3px rgba(26, 76, 157, 0.1);
}

.search-modal-table-wrap {
  flex: 1 1 auto;
  overflow-y: auto;
  position: relative;
  max-height: 52vh;
}

.search-modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.search-modal-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.search-modal-table th,
.search-modal-table td {
  padding: 12px 20px;
  text-align: left;
  border-bottom: 1px solid #edf0f5;
}

.search-modal-table th {
  background-color: #e0e0e0;
  color: #333333;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.search-modal-table td {
  background-color: #ffffff;
}

.search-modal-table .col-code {
  width: 30%;
  color: #4a5568;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 14px;
}

.search-modal-table .col-name {
  width: 70%;
  color: #2d3748;
}

.search-modal-table tbody tr {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.search-modal-table tbody tr:hover,
.search-modal-table tbody tr:focus {
  background-color: #eaf0fb;
  outline: none;
}

.search-modal-empty {
  padding: 32px 20px;
  text-align: center;
  color: #718096;
  font-size: 14px;
}

.search-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #edf0f5;
  background-color: #eaf3ff;
  font-size: 12.5px;
  color: #2c5282;
  flex-shrink: 0;
}

.search-modal-footer a {
  color: #2b6cb0;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.search-modal-footer a:hover {
  border-bottom-color: #2b6cb0;
}
