.bbd-form-wrap,
.bbd-form-wrap * {
  box-sizing: border-box;
}

.bbd-form-wrap {
  --bbd-text: #223047;
  --bbd-text-soft: #5b6b80;
  --bbd-text-muted: #74839a;
  --bbd-primary: #2f6fec;
  --bbd-primary-dark: #1f59c8;
  --bbd-primary-soft: #eff5ff;
  --bbd-border: #d9e3f0;
  --bbd-border-strong: #c9d6e7;
  --bbd-surface: #ffffff;
  --bbd-surface-soft: #f8fafc;
  display: grid;
  gap: 24px;
  width: 100%;
  margin: 24px 0;
  color: var(--bbd-text);
  font-family: inherit;
}

.bbd-form-card,
.bbd-result-card {
  background: var(--bbd-surface);
  border: 1px solid var(--bbd-border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: none;
}

.bbd-result-card {
  scroll-margin-top: 96px;
}

.bbd-card-head {
  margin-bottom: 24px;
}

.bbd-hero-layout {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.bbd-hero-layout::after {
  display: none;
}

.bbd-kicker {
  display: inline-flex;
  align-items: center;
  min-height: auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bbd-primary-soft);
  border: 1px solid #dbe7ff;
  color: var(--bbd-primary-dark);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  white-space: normal;
}

.bbd-card-title {
  margin-top: 14px;
  color: var(--bbd-text);
  font-size: 34px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.bbd-description {
  margin: 12px 0 0;
  max-width: 920px;
  color: var(--bbd-text-soft);
  font-size: 15px;
  line-height: 1.9;
}

.bbd-form {
  margin: 0;
}

.bbd-form-section {
  margin-bottom: 20px;
}

.bbd-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 20px;
}

.bbd-field {
  display: flex;
  flex-direction: column;
}

.bbd-field-label,
.bbd-metric-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--bbd-text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
}

.bbd-field-optional {
  color: var(--bbd-text-muted);
  font-size: 12px;
  font-weight: 600;
}

.bbd-field select,
.bbd-metric-box input {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid var(--bbd-border-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--bbd-text);
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bbd-field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 48px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10' fill='none'%3E%3Cpath d='M2 2L8 8L14 2' stroke='%23566a82' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px 10px;
}

.bbd-field select:focus,
.bbd-metric-box input:focus {
  outline: 0;
  border-color: #8fb0ea;
  box-shadow: 0 0 0 3px rgba(47, 111, 236, 0.10);
}

.bbd-metric-box {
  margin-top: 4px;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--bbd-border);
  background: var(--bbd-surface-soft);
}

.bbd-metric-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.bbd-metric-unit {
  margin-top: 6px;
  color: var(--bbd-text-muted);
  font-size: 13px;
  font-weight: 600;
}

.bbd-metric-hint {
  display: inline-flex;
  align-items: center;
  min-height: auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef3fb;
  color: #5d7189;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.bbd-metric-description {
  margin: 10px 0 0;
  color: var(--bbd-text-soft);
  font-size: 14px;
  line-height: 1.8;
}

.bbd-form-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 24px;
}

.bbd-submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  background: var(--bbd-primary);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  box-shadow: none;
}

.bbd-submit-button:hover {
  background: var(--bbd-primary-dark);
}

.bbd-submit-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.bbd-required {
  color: #d34545;
}

.bbd-message {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.7;
}

.bbd-message ul {
  margin: 0;
  padding-left: 18px;
}

.bbd-message-error {
  background: #fff7f7;
  border: 1px solid #f1cccc;
  color: #8b3333;
}

.bbd-message-success {
  background: #f2fbf6;
  border: 1px solid #c8e8d3;
  color: #2f6a47;
}

.bbd-result-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.bbd-result-copy {
  max-width: 760px;
}

.bbd-result-title {
  margin-top: 10px;
  color: var(--bbd-text);
  font-size: 22px;
  line-height: 1.45;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.bbd-description--result {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.8;
}

.bbd-period-switcher {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.bbd-toolbar-label {
  color: var(--bbd-text-soft);
  font-size: 12px;
  font-weight: 700;
}

.bbd-period-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bbd-period-pill,
.bbd-meta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--bbd-border);
  border-radius: 999px;
  background: #fff;
  color: #506176;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.bbd-period-pill {
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.bbd-period-pill:hover {
  border-color: #aec4e9;
}

.bbd-period-pill.is-active {
  border-color: #cfe0ff;
  background: var(--bbd-primary-soft);
  color: var(--bbd-primary-dark);
}

.bbd-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.bbd-result-grid,
.bbd-benchmark-sub {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.bbd-result-item,
.bbd-benchmark-main,
.bbd-benchmark-diff,
.bbd-benchmark-pending {
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--bbd-border);
  background: #fff;
}

.bbd-result-item span,
.bbd-benchmark-main span,
.bbd-benchmark-diff span {
  display: block;
  margin-bottom: 6px;
  color: var(--bbd-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.bbd-result-item strong,
.bbd-benchmark-main strong,
.bbd-benchmark-diff strong {
  display: block;
  color: var(--bbd-text);
  font-size: 18px;
  line-height: 1.5;
}

.bbd-benchmark-focus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.9fr);
  gap: 14px;
  margin-top: 16px;
  margin-bottom: 16px;
}

.bbd-benchmark-main {
  background: #f8fbff;
}

.bbd-benchmark-main strong,
.bbd-benchmark-diff strong {
  font-size: 24px;
}

.bbd-benchmark-main small {
  display: block;
  margin-top: 8px;
  color: var(--bbd-text-soft);
  font-size: 12px;
}

.bbd-benchmark-diff em {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-top: 10px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f3f6fa;
  color: #5f6f84;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.bbd-benchmark-sub {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bbd-benchmark-note {
  margin: 14px 0 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--bbd-border);
  color: var(--bbd-text-soft);
  font-size: 13px;
  line-height: 1.8;
}

.bbd-pending-title {
  margin-bottom: 8px;
  color: var(--bbd-text);
  font-size: 16px;
  font-weight: 700;
}

.bbd-benchmark-pending p {
  margin: 0 0 8px;
  color: var(--bbd-text-soft);
  line-height: 1.8;
}

@media (max-width: 920px) {
  .bbd-field-grid,
  .bbd-result-grid,
  .bbd-benchmark-focus,
  .bbd-benchmark-sub {
    grid-template-columns: 1fr;
  }

  .bbd-benchmark-sub {
    gap: 12px;
  }
}

@media (max-width: 767px) {
  .bbd-form-wrap {
    gap: 20px;
    margin: 20px 0;
  }

  .bbd-form-card,
  .bbd-result-card {
    padding: 20px;
    border-radius: 14px;
  }

  .bbd-card-head {
    margin-bottom: 20px;
  }

  .bbd-kicker {
    font-size: 12px;
    padding: 7px 12px;
  }

  .bbd-card-title {
    font-size: 28px;
    line-height: 1.3;
  }

  .bbd-description {
    font-size: 14px;
    line-height: 1.85;
  }

  .bbd-field-label,
  .bbd-metric-label {
    font-size: 14px;
  }

  .bbd-field select,
  .bbd-metric-box input {
    min-height: 50px;
    padding: 0 14px;
    font-size: 15px;
    border-radius: 10px;
  }

  .bbd-field select {
    padding-right: 42px;
    background-position: right 14px center;
  }

  .bbd-metric-box {
    padding: 16px;
    border-radius: 12px;
  }

  .bbd-metric-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .bbd-metric-hint {
    white-space: normal;
  }

  .bbd-submit-button {
    width: 100%;
    min-width: 0;
  }

  .bbd-result-title {
    font-size: 18px;
  }

  .bbd-period-switcher,
  .bbd-period-form {
    width: 100%;
  }

  .bbd-period-pill {
    flex: 1 1 calc(50% - 8px);
  }
}
