body {
  margin: 0;
  background: #f3f7fa;
}

.arp-credit-app,
.arp-credit-app * {
  box-sizing: border-box;
}

.arp-credit-app {
  --arp-navy: #123d56;
  --arp-blue: #176b91;
  --arp-light-blue: #e9f4f9;
  --arp-orange: #f5a623;
  --arp-red: #b5303b;
  --arp-green: #168363;
  --arp-border: #d8e1e7;
  --arp-text: #21333e;
  --arp-muted: #647680;
  --arp-white: #ffffff;
  min-height: 100vh;
  color: var(--arp-text);
  background: #f3f7fa;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Yu Gothic",
    "YuGothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  line-height: 1.6;
}

.arp-app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 42px max(28px, calc((100% - 1240px) / 2));
  color: var(--arp-white);
  background: linear-gradient(120deg, #10384f 0%, #176789 100%);
}

.arp-app-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  opacity: 0.8;
}

.arp-app-header h1 {
  margin: 0;
  color: var(--arp-white);
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 600;
  line-height: 1.35;
}

.arp-app-description {
  margin: 10px 0 0;
  font-size: 16px;
  opacity: 0.9;
}

.arp-mode-badge {
  flex: 0 0 auto;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.arp-security-notice {
  padding: 14px max(28px, calc((100% - 1240px) / 2));
  border-bottom: 1px solid #c9dce6;
  color: #315363;
  background: var(--arp-light-blue);
  font-size: 14px;
}

.arp-security-notice strong {
  margin-right: 6px;
}

.arp-app-main {
  width: min(1240px, calc(100% - 40px));
  margin: 28px auto 48px;
}

.arp-search-card,
.arp-result-card,
.arp-judgment-card {
  border: 1px solid var(--arp-border);
  border-radius: 14px;
  background: var(--arp-white);
  box-shadow: 0 5px 18px rgba(20, 57, 78, 0.06);
}

.arp-search-card,
.arp-result-card {
  padding: 28px;
}

.arp-section-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
}

.arp-step-number {
  display: inline-flex;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  height: 38px;
  border-radius: 50%;
  color: var(--arp-blue);
  background: var(--arp-light-blue);
  font-size: 13px;
  font-weight: 800;
}

.arp-section-heading h2,
.arp-result-card > h2 {
  margin: 0;
  color: var(--arp-navy);
  font-size: 21px;
  line-height: 1.4;
}

.arp-section-heading p {
  margin: 4px 0 0;
  color: var(--arp-muted);
  font-size: 14px;
}

.arp-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.arp-form-group {
  min-width: 0;
}

.arp-form-group-wide {
  grid-column: 1 / -1;
}

.arp-form-group label {
  display: block;
  margin-bottom: 7px;
  color: #334d5b;
  font-size: 14px;
  font-weight: 700;
}

.arp-required {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 7px;
  border-radius: 4px;
  color: var(--arp-white);
  background: var(--arp-red);
  font-size: 10px;
  font-weight: 700;
  vertical-align: 1px;
}

.arp-form-group input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid #bdcbd3;
  border-radius: 7px;
  color: var(--arp-text);
  background: var(--arp-white);
  font: inherit;
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.arp-form-group input::placeholder {
  color: #98a6ad;
}

.arp-form-group input:focus {
  border-color: var(--arp-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 107, 145, 0.14);
}

.arp-search-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.arp-primary-button,
.arp-secondary-button,
.arp-export-button {
  min-height: 46px;
  padding: 10px 22px;
  border-radius: 7px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s, background 0.15s;
}

.arp-primary-button {
  border: 1px solid var(--arp-orange);
  color: #1d303a;
  background: var(--arp-orange);
}

.arp-secondary-button {
  border: 1px solid #aebdc5;
  color: #405763;
  background: var(--arp-white);
}

.arp-primary-button:hover,
.arp-secondary-button:hover,
.arp-export-button:hover {
  transform: translateY(-1px);
}

.arp-primary-button:disabled {
  cursor: wait;
  opacity: 0.6;
  transform: none;
}

.arp-status-message {
  display: none;
  margin-top: 20px;
  padding: 13px 15px;
  border-radius: 7px;
  font-size: 14px;
}

.arp-status-message.is-visible {
  display: block;
}

.arp-status-message.is-loading {
  border: 1px solid #b9d5e3;
  color: #24566d;
  background: #edf7fb;
}

.arp-status-message.is-success {
  border: 1px solid #afd8cb;
  color: #17634e;
  background: #edf8f4;
}

.arp-status-message.is-error {
  border: 1px solid #e3b7ba;
  color: #8b2931;
  background: #fff1f2;
}

.arp-result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 24px;
  margin-top: 24px;
}

.arp-result-main {
  display: grid;
  gap: 20px;
}

.arp-company-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  border-top: 1px solid var(--arp-border);
  border-left: 1px solid var(--arp-border);
}

.arp-company-details > div {
  min-width: 0;
  padding: 16px;
  border-right: 1px solid var(--arp-border);
  border-bottom: 1px solid var(--arp-border);
}

.arp-company-details dt {
  margin-bottom: 4px;
  color: var(--arp-muted);
  font-size: 12px;
  font-weight: 700;
}

.arp-company-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--arp-text);
  font-size: 15px;
  font-weight: 700;
}

.arp-public-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.arp-info-item {
  min-height: 92px;
  padding: 15px;
  border: 1px solid var(--arp-border);
  border-radius: 8px;
  background: #f9fbfc;
}

.arp-info-item span {
  display: block;
  margin-bottom: 7px;
  color: var(--arp-muted);
  font-size: 12px;
}

.arp-info-item strong {
  display: block;
  color: var(--arp-navy);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.arp-source-list {
  margin: 16px 0 0;
  padding-left: 22px;
  color: #405763;
  font-size: 14px;
}

.arp-source-list li + li {
  margin-top: 5px;
}

.arp-acquired-date {
  margin: 14px 0 0;
  color: var(--arp-muted);
  font-size: 13px;
}

.arp-judgment-card {
  position: sticky;
  top: 20px;
  overflow: hidden;
  padding: 28px;
  border-top: 5px solid var(--arp-navy);
  text-align: center;
}

.arp-judgment-label {
  margin: 0 0 16px;
  color: var(--arp-muted);
  font-size: 13px;
  font-weight: 700;
}

.arp-rank-display {
  display: flex;
  width: 92px;
  height: 92px;
  margin: 0 auto 16px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  color: var(--arp-white);
  background: #7b8d96;
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
}

.arp-judgment-card h2 {
  margin: 0;
  color: var(--arp-navy);
  font-size: 23px;
}

.arp-judgment-card > p:not(.arp-judgment-label) {
  color: var(--arp-muted);
  font-size: 14px;
}

.arp-score-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 22px -28px 0;
  border-top: 1px solid var(--arp-border);
  border-bottom: 1px solid var(--arp-border);
}

.arp-score-row > div {
  padding: 16px 8px;
}

.arp-score-row > div + div {
  border-left: 1px solid var(--arp-border);
}

.arp-score-row span {
  display: block;
  color: var(--arp-muted);
  font-size: 12px;
}

.arp-score-row strong {
  display: block;
  margin-top: 3px;
  color: var(--arp-navy);
  font-size: 21px;
}

.arp-judgment-notice {
  margin-top: 20px;
  padding: 13px;
  border-radius: 7px;
  color: #665326;
  background: #fff7df;
  font-size: 12px;
  text-align: left;
}

.arp-export-button {
  width: 100%;
  margin-top: 18px;
  border: 1px solid var(--arp-blue);
  color: var(--arp-white);
  background: var(--arp-blue);
}

.arp-judgment-card.rank-a {
  border-top-color: var(--arp-green);
}

.arp-judgment-card.rank-a .arp-rank-display {
  background: var(--arp-green);
}

.arp-judgment-card.rank-b {
  border-top-color: var(--arp-blue);
}

.arp-judgment-card.rank-b .arp-rank-display {
  background: var(--arp-blue);
}

.arp-judgment-card.rank-c {
  border-top-color: var(--arp-orange);
}

.arp-judgment-card.rank-c .arp-rank-display {
  color: #33270e;
  background: var(--arp-orange);
}

.arp-judgment-card.rank-d {
  border-top-color: var(--arp-red);
}

.arp-judgment-card.rank-d .arp-rank-display {
  background: var(--arp-red);
}

.arp-app-footer {
  padding: 18px 24px 26px;
  color: #71818a;
  background: #f3f7fa;
  font-size: 12px;
  text-align: center;
}

@media (max-width: 900px) {
  .arp-app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .arp-result-layout {
    grid-template-columns: 1fr;
  }

  .arp-judgment-card {
    position: static;
  }

  .arp-public-info-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .arp-app-header {
    padding: 28px 20px;
  }

  .arp-security-notice {
    padding: 13px 20px;
  }

  .arp-app-main {
    width: min(100% - 24px, 1240px);
    margin-top: 16px;
  }

  .arp-search-card,
  .arp-result-card,
  .arp-judgment-card {
    padding: 20px;
    border-radius: 10px;
  }

  .arp-form-grid,
  .arp-company-details,
  .arp-public-info-grid {
    grid-template-columns: 1fr;
  }

  .arp-form-group-wide {
    grid-column: auto;
  }

  .arp-score-row {
    margin-right: -20px;
    margin-left: -20px;
  }

  .arp-primary-button,
  .arp-secondary-button {
    width: 100%;
  }
}
  .arp-primary-button,
  .arp-secondary-button {
    width: 100%;
  }
}

.arp-result-layout[hidden] {
  display: none !important;
}