/* Floating 30s limit-check widget */
:root {
  --limit-sticky-gap: 16px;
  --limit-sticky-h: 120px;
}

.limit-fab {
  position: fixed;
  right: 24px;
  bottom: calc(var(--limit-sticky-h) + var(--limit-sticky-gap));
  z-index: 320;
  width: 172px;
  height: 172px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(160deg, #ff8a1f 0%, #ff6a00 55%, #f05600 100%);
  color: #fff;
  box-shadow: 0 14px 36px rgba(255, 106, 0, 0.42);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  overflow: hidden;
  isolation: isolate;
  animation: limit-fab-bounce 1.7s ease-in-out infinite, limit-fab-glow 1.7s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
.limit-fab::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.55) 48%,
    rgba(255, 255, 255, 0.85) 50%,
    rgba(255, 255, 255, 0.45) 52%,
    transparent 65%
  );
  transform: translateX(-120%) rotate(12deg);
  animation: limit-fab-shine 2.4s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.limit-fab::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  animation: limit-fab-ring 1.7s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.limit-fab > * {
  position: relative;
  z-index: 1;
}
.limit-fab:hover {
  animation-play-state: paused;
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 18px 40px rgba(255, 106, 0, 0.48);
}
.limit-fab:focus-visible {
  outline: 3px solid rgba(49, 130, 246, 0.55);
  outline-offset: 3px;
}
body.limit-widget-open .limit-fab {
  animation: none;
  opacity: 0.35;
  pointer-events: none;
}

@keyframes limit-fab-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}
@keyframes limit-fab-glow {
  0%,
  100% {
    box-shadow: 0 12px 28px rgba(255, 106, 0, 0.35), 0 0 0 0 rgba(255, 170, 60, 0.35);
  }
  50% {
    box-shadow: 0 18px 40px rgba(255, 106, 0, 0.55), 0 0 0 12px rgba(255, 170, 60, 0);
  }
}
@keyframes limit-fab-shine {
  0%,
  35% {
    transform: translateX(-130%) rotate(12deg);
  }
  60%,
  100% {
    transform: translateX(130%) rotate(12deg);
  }
}
@keyframes limit-fab-ring {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.96);
  }
  50% {
    opacity: 0.7;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .limit-fab,
  .limit-fab::before,
  .limit-fab::after {
    animation: none !important;
  }
}
.limit-fab-icon {
  width: 42px;
  height: 42px;
  display: block;
}
.limit-fab-text {
  display: block;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.03em;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.limit-widget-modal {
  position: fixed;
  inset: 0;
  z-index: 360;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.limit-widget-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.limit-widget-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.limit-widget-panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.32);
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.limit-widget-modal.is-open .limit-widget-panel,
.limit-widget-panel.is-open {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.limit-widget-head {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 14px;
  background: linear-gradient(180deg, #fff7ef 0%, #fff 100%);
  border-bottom: 1px solid #f1e7dc;
}
.limit-widget-head h3 {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -0.03em;
  color: #1f2937;
}
.limit-head-sub {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
  color: #c2410c;
  letter-spacing: -0.02em;
}
.limit-widget-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.limit-widget-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px 20px 20px;
}
.limit-dual {
  display: block;
}
.limit-col-credit {
  width: 100%;
}
.limit-col-collateral {
  display: none !important;
}
.limit-collateral-title {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.03em;
  color: #1f2937;
}
.limit-accent {
  font-style: normal;
  color: #ff6a00;
}
.limit-collateral-form {
  display: grid;
  gap: 8px;
}
.limit-collateral-form select {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  background: #fff;
  color: #111827;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239ca3af' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.limit-note-sm {
  margin-top: 4px;
  font-size: 11px;
}
.limit-price-line {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  color: #475569;
}
.limit-price-line strong {
  color: #c2410c;
  font-size: 15px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.limit-widget-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.limit-tab {
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #4b5563;
  border-radius: 10px;
  padding: 10px 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.limit-tab.is-active {
  border-color: #ff6a00;
  background: #fff4eb;
  color: #c2410c;
}
.limit-section {
  margin-bottom: 14px;
}
.limit-section-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: #111827;
}
.limit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.limit-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.limit-field.full {
  grid-column: 1 / -1;
}
.limit-field label {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
}
.limit-field input,
.limit-field select {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 14px;
  background: #fff;
  color: #111827;
}
.limit-field input:focus,
.limit-field select:focus {
  outline: 2px solid rgba(255, 106, 0, 0.25);
  border-color: #ff8a1f;
}
.limit-note {
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  color: #475569;
  font-size: 12px;
  line-height: 1.65;
}
.limit-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #4b5563;
  line-height: 1.5;
}
.limit-check input {
  margin-top: 2px;
}
.limit-check a {
  color: #2563eb;
  text-decoration: underline;
}
.limit-actions {
  display: grid;
  gap: 8px;
}
.limit-submit {
  border: 0;
  border-radius: 12px;
  padding: 13px 14px;
  background: linear-gradient(180deg, #ff8a1f, #ff6a00);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.limit-kakao {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fee500;
  color: #191919;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}
.limit-msg {
  min-height: 18px;
  margin: 8px 0 0;
  font-size: 12px;
  color: #64748b;
}
.limit-msg.error { color: #dc2626; }
.limit-msg.ok { color: #059669; }
.limit-panel-employee .limit-biz-only,
.limit-panel-business .limit-emp-only {
  display: none;
}
.limit-back {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: #4b5563;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.limit-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 16px 36px;
  text-align: center;
  color: #64748b;
}
.limit-loading[hidden],
#limitResultContent[hidden],
#limitStepFormWrap[hidden],
#limitStepResultWrap[hidden] {
  display: none !important;
}
.limit-loading-brand {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: #ff6a00;
  letter-spacing: -0.02em;
}
.limit-loading-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #1f2937;
  letter-spacing: -0.02em;
}
.limit-loading-desc {
  margin: 0 0 8px;
  max-width: 280px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: #64748b;
}
.limit-progress {
  width: min(100%, 260px);
  height: 10px;
  border-radius: 999px;
  background: #ffe8d4;
  overflow: hidden;
}
.limit-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8a2a, #ff6a00);
  transition: width 0.05s linear;
}
.limit-loading-pct {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #9a3412;
}
.limit-result-cta {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff1e6;
  border: 1px solid #ffd0a8;
  color: #9a3412;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.02em;
}
.limit-result-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.limit-result-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 12px;
  background: #fff8f1;
  border: 1px solid #ffecd9;
}
.limit-result-list li.is-total {
  background: #fff1e6;
  border-color: #ffd0a8;
}
.limit-result-list strong {
  display: block;
  font-size: 14px;
  color: #9a3412;
}
.limit-result-list span {
  font-size: 12px;
  color: #9ca3af;
}
.limit-result-list em {
  font-style: normal;
  font-size: 18px;
  font-weight: 900;
  color: #c2410c;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.limit-result-wrap {
  min-height: 240px;
}

@media (max-width: 900px) {
  .limit-dual {
    grid-template-columns: 1fr;
  }
  .limit-widget-panel {
    width: min(560px, 100%);
  }
}

@media (max-width: 768px) {
  .limit-fab {
    right: 12px;
    width: 78px;
    height: 78px;
    gap: 3px;
    padding: 8px 6px;
  }
  @keyframes limit-fab-bounce {
    0%,
    100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-10px);
    }
  }
  .limit-fab-icon {
    width: 20px;
    height: 20px;
  }
  .limit-fab-text {
    font-size: 12.5px;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.04em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
  }
  .limit-widget-modal {
    align-items: flex-end;
    padding: 0;
  }
  .limit-widget-panel {
    width: 100%;
    max-height: min(94vh, 100%);
    border-radius: 20px 20px 0 0;
    transform: translateY(24px);
  }
  .limit-widget-modal.is-open .limit-widget-panel,
  .limit-widget-panel.is-open {
    transform: translateY(0);
  }
  .limit-widget-head {
    padding: 16px 16px 12px;
  }
  .limit-widget-head h3 {
    font-size: 16px;
  }
  .limit-widget-body {
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  }
  .limit-dual {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .limit-grid {
    grid-template-columns: 1fr;
  }
}

body.limit-widget-open {
  overflow: hidden;
}
