.am360-sg-entry {
  margin: 6px 0 10px;
}

.am360-sg-trigger {
  appearance: none;
  border: 0;
  border-bottom: 2px solid currentColor;
  background: transparent;
  color: #111;
  padding: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  cursor: pointer;
}

.am360-sg-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
}

.am360-sg-modal.is-open {
  display: block;
}

.am360-sg-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
}

.am360-sg-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(980px, calc(100vw - 48px));
  max-height: min(860px, calc(100vh - 48px));
  transform: translate(-50%, -50%);
  background: #fff;
  color: #111;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,.28);
}

.am360-sg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 28px;
  border-bottom: 1px solid #d9dde1;
  font-size: 24px;
}

.am360-sg-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #111;
  font-size: 46px;
  line-height: 1;
  cursor: pointer;
}

.am360-sg-body {
  overflow: auto;
  padding: 36px 44px 46px;
}

.am360-sg-guide h2,
.am360-sg-calculator h3 {
  margin: 0 0 22px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.08;
  font-weight: 800;
}

.am360-sg-guide h3 {
  margin: 44px 0 18px;
  font-size: 26px;
  font-weight: 800;
}

.am360-sg-rich {
  margin: 0 0 24px;
  font-size: 22px;
  line-height: 1.45;
}

.am360-sg-disclaimer {
  margin: 28px 0 0;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  color: #666;
  font-size: 15px;
  line-height: 1.5;
}

.am360-sg-table-wrap {
  overflow-x: auto;
}

.am360-sg-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  font-size: 22px;
}

.am360-sg-table th,
.am360-sg-table td {
  padding: 20px 18px;
  text-align: center;
  border: 0;
}

.am360-sg-table th {
  font-weight: 500;
}

.am360-sg-table tbody tr:nth-child(odd) {
  background: #f1f1f1;
}

.am360-sg-fit {
  margin: 42px 0 0;
}

.am360-sg-fit-bars {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}

.am360-sg-fit-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(160px, 2fr) 70px;
  align-items: center;
  gap: 16px;
  font-size: 17px;
}

.am360-sg-fit-track {
  height: 10px;
  overflow: hidden;
  background: #ececec;
  border-radius: 999px;
}

.am360-sg-fit-track span {
  display: block;
  height: 100%;
  background: #111;
}

.am360-sg-fit-row strong {
  text-align: right;
}

.am360-sg-fit-note {
  margin: 14px 0 0;
  color: #555;
  font-size: 16px;
  line-height: 1.5;
}

.am360-sg-calculator {
  margin: 0 0 44px;
  padding: 28px;
  background: #f7f7f7;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.am360-sg-step {
  margin-bottom: 18px;
  color: #737373;
  font-size: 15px;
}

.am360-sg-calculator p {
  margin: 0 0 24px;
  color: #555;
  font-size: 18px;
}

.am360-sg-calc-panel {
  display: none;
}

.am360-sg-calc-panel.is-active {
  display: block;
}

.am360-sg-calc-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}

.am360-sg-calc-fields label span {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-size: 15px;
}

.am360-sg-calc-fields input {
  width: 100%;
  min-height: 58px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0 18px;
  font-size: 20px;
  background: #fff;
}

.am360-sg-morphology-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.am360-sg-morphology-options button {
  min-height: 56px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #111;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.am360-sg-morphology-options button.is-selected {
  border-color: #000;
  background: #000;
  color: #fff;
}

.am360-sg-calc-submit {
  width: 100%;
  margin-top: 24px;
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  background: #000;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.am360-sg-result {
  margin-top: 18px;
  font-size: 18px;
  font-weight: 700;
}

.am360-sg-result:not(:empty) {
  padding: 18px 20px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  line-height: 1.35;
}

.am360-sg-result.is-success {
  border-color: #111;
  background: #111;
  color: #fff;
  font-size: 22px;
  text-align: center;
}

.am360-sg-result.is-error {
  border-color: #f0b4b4;
  background: #fff5f5;
  color: #9f1d1d;
}

.am360-sg-attrs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
  color: #666;
  font-size: 13px;
}

body.am360-sg-lock {
  overflow: hidden;
}

@media (max-width: 767px) {
  .am360-sg-dialog {
    inset: 0;
    left: 0;
    top: 0;
    width: 100vw;
    max-height: none;
    height: 100vh;
    transform: none;
    border-radius: 0;
  }

  .am360-sg-header {
    padding: 18px 22px;
    font-size: 18px;
  }

  .am360-sg-body {
    padding: 34px 22px 44px;
  }

  .am360-sg-guide h2,
  .am360-sg-calculator h3 {
    margin-bottom: 16px;
    font-size: 26px;
    line-height: 1.15;
  }

  .am360-sg-guide h3 {
    margin: 30px 0 14px;
    font-size: 19px;
    line-height: 1.2;
  }

  .am360-sg-rich {
    font-size: 15px;
    line-height: 1.45;
  }

  .am360-sg-calculator {
    margin-bottom: 30px;
    padding: 20px;
  }

  .am360-sg-calculator p,
  .am360-sg-result {
    font-size: 15px;
  }

  .am360-sg-calc-fields label span,
  .am360-sg-step,
  .am360-sg-attrs,
  .am360-sg-fit-note {
    font-size: 13px;
  }

  .am360-sg-calc-fields input {
    min-height: 48px;
    font-size: 16px;
  }

  .am360-sg-calc-submit {
    min-height: 48px;
    font-size: 15px;
  }

  .am360-sg-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
    font-size: 14px;
  }

  .am360-sg-table th,
  .am360-sg-table td {
    padding: 12px 6px;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .am360-sg-calc-fields {
    grid-template-columns: 1fr;
  }

  .am360-sg-fit-row {
    grid-template-columns: 1fr 58px;
    gap: 8px 12px;
  }

  .am360-sg-fit-track {
    grid-column: 1 / -1;
    order: 3;
  }
}
