:root {
  color-scheme: light;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  background-color: #0d9217;
  color: #0b3d14;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 96px 24px 40px;
  overflow-y: scroll;
  background-color: #0d9217;
  background-image: radial-gradient(
      circle at 20% 15%,
      rgba(252, 255, 82, 0.35),
      rgba(13, 146, 23, 0) 55%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(240, 255, 241, 0.4),
      rgba(13, 146, 23, 0) 60%
    ),
    radial-gradient(
      circle at 50% 100%,
      rgba(11, 158, 22, 0.35),
      rgba(13, 146, 23, 0) 65%
    );
}

.app-logo {
  position: fixed;
  top: 24px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  z-index: 10;
}

.app-logo img {
  display: block;
  height: 38px;
  width: auto;
}

.simulation-screen {
  width: min(920px, 100%);
  background: #ffffff;
  border-radius: 18px;
  padding: 48px 56px 40px;
  box-shadow: 0 25px 55px rgba(13, 146, 23, 0.15);
  border: 1px solid #e3f5e5;
}

.screen-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
  text-align: left;
}

.screen-title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  position: relative;
  width: fit-content;
}

.screen-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #0b9e16, #fcff52);
  border-radius: 999px;
}

.screen-brand {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
  color: #0d9217;
}

.screen-tagline {
  font-size: 0.9rem;
}

.screen-brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fcff52;
  color: #0b3d14;
}
.simulation-card {
  display: block;
  padding: 16px 0 8px;
}

.screen-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.input-grid {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px 16px;
  align-items: center;
}

.country-select-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.field-label {
  font-size: 1rem;
  font-weight: 600;
  color: #0b3d14;
}

.required-note {
  color: #d93025;
  font-weight: 600;
  margin-bottom: 12px;
}

.required-mark {
  color: #d93025;
  margin-left: 4px;
  font-weight: 700;
}

.select-wrap {
  position: relative;
  display: inline-block;
}

.field-select {
  appearance: none;
  min-width: 120px;
  padding: 10px 44px 10px 16px;
  border: 2px solid #0d9217;
  border-radius: 4px;
  background: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
}

.select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #0d9217;
  transform: translateY(-25%);
  pointer-events: none;
}

.select-wrap--no-arrow::after {
  display: none;
}

.field-select--left {
  text-align: left;
  padding-right: 16px;
}

.field-note {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #0d9217;
}

.field-note--inline {
  margin: 0;
  font-size: 0.75rem;
  color: #0b3d14;
  line-height: 1.4;
}

.field-note--alert {
  margin: 0;
  font-size: 0.85rem;
  color: #d93025;
  font-weight: 600;
  line-height: 1.5;
}

.field-note a {
  color: inherit;
  text-decoration: none;
}

.dimension-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.dimension-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dimension-multiply {
  font-size: 1.1rem;
  color: #0b3d14;
}

.weight-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.radio-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.radio-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.plan-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.plan-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  width: max-content;
  max-width: min(320px, 80vw);
  padding: 10px 12px;
  border-radius: 8px;
  background: #0b3d14;
  color: #ffffff;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-line;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
}

.plan-tooltip::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #0b3d14;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 20;
}

.plan-tooltip:hover::after,
.plan-tooltip:hover::before,
.plan-tooltip:focus-visible::after,
.plan-tooltip:focus-visible::before {
  opacity: 1;
}

.info-tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.info-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  width: max-content;
  max-width: min(360px, 86vw);
  padding: 10px 12px;
  border-radius: 8px;
  background: #0b3d14;
  color: #ffffff;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-line;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
}

.info-tooltip::before {
  content: "";
  position: absolute;
  left: 14px;
  top: calc(100% + 4px);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #0b3d14;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 20;
}

.info-tooltip:hover::after,
.info-tooltip:hover::before,
.info-tooltip:focus-visible::after,
.info-tooltip:focus-visible::before {
  opacity: 1;
}

.weight-result-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: nowrap;
}

.unit {
  font-size: 1rem;
  color: #0b3d14;
}

.result-box {
  background: #ffffff;
  padding: 18px 20px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 1rem;
  color: #0b3d14;
}

.result-box--inline {
  min-width: 320px;
  flex-direction: row;
  justify-content: space-between;
  gap: 24px;
}

.result-row {
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  font-weight: 600;
}

.option-section {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.box-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.box-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.box-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0b3d14;
}

.add-box-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #0d9217;
  background: #ffffff;
  color: #0d9217;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}

.box-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.box-card {
  border: 1px solid #cfe8d1;
  border-radius: 12px;
  padding: 16px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.box-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.box-card-title {
  font-weight: 700;
  color: #0b3d14;
}

.box-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.duplicate-box-button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid #0d9217;
  background: #ffffff;
  color: #0d9217;
  font-weight: 700;
  cursor: pointer;
}

.remove-box-button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid #d93025;
  background: #ffffff;
  color: #d93025;
  font-weight: 700;
  cursor: pointer;
}

.remove-box-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.box-grid {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px 20px;
  align-items: center;
}

.box-product-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.box-product-error {
  margin: 0;
  min-height: 1.2em;
}

.box-product-error.is-hidden {
  visibility: hidden;
}

.result-trigger {
  margin-top: 24px;
  display: flex;
  justify-content: center;
}

.result-screen {
  margin-top: 28px;
}

.option-panel {
  border: 1px solid #cfe8d1;
  border-radius: 12px;
  padding: 20px;
  background: #ffffff;
}

.option-grid {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px 20px;
  align-items: center;
}

.field-input {
  padding: 10px 14px;
  border: 2px solid #0d9217;
  border-radius: 4px;
  background: #ffffff;
  font-size: 1rem;
  font-weight: 600;
}

.field-input--narrow {
  width: 50px;
  text-align: center;
  padding: 10px 8px;
}

.field-input--dimension {
  width: 72px;
  text-align: center;
  padding: 10px 8px;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.insurance-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.insurance-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.option-note {
  margin-top: 12px;
  color: #0d9217;
  font-size: 0.9rem;
}

.simulate-row {
  display: flex;
  justify-content: center;
  margin-top: 8px;
  gap: 12px;
  flex-wrap: wrap;
}

.error-message {
  margin-top: 8px;
  color: #d93025;
  font-weight: 600;
  text-align: center;
}

.log-panel {
  border: 1px solid #cfe8d1;
  border-radius: 12px;
  padding: 12px 16px;
  background: #ffffff;
}

.log-title {
  font-weight: 700;
  margin-bottom: 6px;
  color: #0b3d14;
}

.log-body {
  background: #f6fff7;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #0b3d14;
  white-space: pre-wrap;
  word-break: break-word;
}

.total-row {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 2px solid #0d9217;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 700;
}

.total-label {
  font-size: 1.2rem;
  letter-spacing: 0.08em;
}

.total-price {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: 0.05em;
}

.total-price-message {
  color: #d93025;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.total-price-pending {
  color: #0b3d14;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.total-price-pending--center {
  width: 100%;
  display: flex;
  justify-content: center;
}

.shipping-loader {
  width: min(500px, 100%);
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: #f8fafc;
  border-radius: 8px;
  padding: 0 20px;
  box-sizing: border-box;
  gap: 10px;
}

.shipping-loader .truck {
  margin-right: 4px;
}

.shipping-loader .text {
  font-weight: 600;
}

.shipping-loader .dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 4px;
  background: #3b82f6;
  border-radius: 50%;
  animation: shipping-blink 1.4s infinite both;
}

.shipping-loader .dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.shipping-loader .dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes shipping-blink {
  0% {
    opacity: 0.2;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0.2;
  }
}

.cta-row {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.cta-row-group {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}

.pdf-save-hint-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.pdf-save-hint {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0b9e16;
  animation: hintPulse 1.6s ease-in-out infinite;
  text-shadow: 0 0 8px rgba(252, 255, 82, 0.6);
}

@keyframes hintPulse {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  border-radius: 999px;
  background: #0b9e16;
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(11, 158, 22, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
  transform: none;
}

.cta-button--primary {
  padding: 18px 40px;
  font-size: 1.15rem;
  min-width: 260px;
  background: #fcff52;
  color: #0b3d14;
  box-shadow: 0 16px 30px rgba(252, 255, 82, 0.35);
  border: 2px solid #e2e64b;
}

.cta-button--primary:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 20px 36px rgba(252, 255, 82, 0.45);
}

.cta-button--primary:focus-visible {
  outline: 3px solid #fff2a8;
  outline-offset: 4px;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  border-radius: 999px;
  border: none;
  background: #fcff52;
  color: #0b3d14;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(252, 255, 82, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.secondary-button.secondary-button--outline {
  background: #ffffff;
  border: 2px solid #0d9217;
  color: #0d9217;
  box-shadow: 0 12px 24px rgba(13, 146, 23, 0.18);
}

.secondary-button.secondary-button--outline:hover {
  box-shadow: 0 16px 30px rgba(13, 146, 23, 0.3);
}

#retryButton {
  background: #ffffff;
  color: #0d9217;
  border: 2px solid #0d9217;
  box-shadow: 0 12px 24px rgba(13, 146, 23, 0.18);
}

#estimateButton {
  background: #0b9e16;
  color: #ffffff;
  border: 2px solid #0b7d12;
  box-shadow: 0 12px 24px rgba(11, 158, 22, 0.35);
}

#estimateButton:hover,
.secondary-button--accent:hover {
  box-shadow: 0 16px 30px rgba(11, 158, 22, 0.45);
}

.secondary-button--accent {
  background: #0b9e16;
  color: #ffffff;
  border: 2px solid #0b7d12;
  box-shadow: 0 12px 24px rgba(11, 158, 22, 0.35);
}

#estimateButton:hover {
  box-shadow: 0 16px 30px rgba(11, 158, 22, 0.45);
}

#retryButton:hover {
  box-shadow: 0 16px 30px rgba(13, 146, 23, 0.3);
}

.secondary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(252, 255, 82, 0.45);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.modal-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  width: min(420px, 100%);
  box-shadow: 0 20px 45px rgba(13, 146, 23, 0.25);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #ffffff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.modal-label {
  font-weight: 600;
}

.modal-error {
  color: #d93025;
  font-weight: 600;
  font-size: 0.95rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(26, 98, 255, 0.3);
}

.cta-button:focus-visible {
  outline: 3px solid #88b3ff;
  outline-offset: 3px;
}

.disclaimer {
  margin-top: 18px;
  color: #0b3d14;
  font-size: 0.9rem;
  line-height: 1.6;
}

.disclaimer-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.disclaimer-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.disclaimer-list li + li {
  margin-top: 8px;
}

.disclaimer a {
  color: #0b3d14;
  word-break: break-all;
  text-decoration: underline;
}

@media (max-width: 820px) {
  .result-box {
    width: 100%;
  }

  .weight-result-row {
    flex-wrap: wrap;
  }

  .result-box--inline {
    min-width: auto;
    width: 100%;
  }

  .option-grid {
    grid-template-columns: 1fr;
  }

  .box-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .simulation-screen {
    padding: 32px 24px;
  }

  .input-grid {
    grid-template-columns: 1fr;
  }

  .dimension-group {
    flex-wrap: wrap;
  }
}

.tooltip-indicator {
  margin-left: 4px;
  font-size: 0.85em;
}

.box-limit-error {
  margin: 0 0 0 4px;
  min-height: 1.2em;
}

.box-limit-error.is-hidden {
  visibility: hidden;
}
