@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=Fraunces:ital,wght@0,600;1,700&display=swap');

#teb-calc, #teb-calc * {
  box-sizing: border-box;
  font-family: 'DM Sans', system-ui, sans-serif;
}

#teb-calc {
  --sky:      #38BDF8;
  --sky-d:    #0EA5E9;
  --teal:     #2DD4BF;
  --teal-d:   #0D9488;
  --grad:     linear-gradient(110deg, #38BDF8 0%, #2DD4BF 100%);
  --sky-xl:   #F0FBFF;
  --sky-l:    #E0F6FE;
  --teal-l:   #CCFBF1;
  --dark:     #0C1A2E;
  --slate:    #334155;
  --mid:      #64748B;
  --muted:    #94A3B8;
  --border:   #E2E8F0;
  --border-a: rgba(56,189,248,0.2);
  --white:    #FFFFFF;
  --light:    #F8FAFC;
  --sh:       0 1px 3px rgba(15,23,42,0.06), 0 8px 32px rgba(56,189,248,0.10);
  --sh-sm:    0 1px 2px rgba(15,23,42,0.05), 0 2px 8px rgba(56,189,248,0.07);
  --sh-btn:   0 4px 14px rgba(56,189,248,0.35);
  --r:        16px;
  --r-sm:     10px;

  background: var(--white);
  border-radius: 20px;
  overflow: hidden;
  max-width: 880px;
  margin: 40px auto;
  box-shadow: var(--sh);
  color: var(--dark);
  line-height: 1.6;
  font-size: 16px;
  border: 1px solid var(--border);
}

/* ── HERO ── */
#teb-calc .teb-hero {
  background: var(--white);
  padding: 48px 40px 40px;
  text-align: center;
  position: relative;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
#teb-calc .teb-hero::before {
  content: '';
  position: absolute;
  top: -80px; left: 50%;
  transform: translateX(-50%);
  width: 500px; height: 220px;
  background: radial-gradient(ellipse, rgba(56,189,248,0.10) 0%, transparent 70%);
  pointer-events: none;
}
#teb-calc .teb-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad);
  opacity: 0.5;
}

#teb-calc .teb-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sky-l);
  border: 1px solid var(--border-a);
  color: var(--sky-d);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
  position: relative;
}

#teb-calc .teb-title {
  font-family: 'Fraunces', serif !important;
  font-size: clamp(1.8rem, 4vw, 2.7rem) !important;
  font-weight: 600 !important;
  color: var(--dark) !important;
  line-height: 1.15 !important;
  margin: 0 0 14px !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  text-transform: none !important;
  letter-spacing: -0.02em !important;
  position: relative;
}
#teb-calc .teb-title em {
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#teb-calc .teb-sub {
  color: var(--mid);
  font-size: 0.97rem;
  max-width: 460px;
  margin: 0 auto;
  position: relative;
}

/* ── TABS ── */
#teb-calc .teb-tabs {
  display: flex;
  background: var(--light);
  border-bottom: 1px solid var(--border);
  padding: 6px 6px 0;
  gap: 2px;
}
#teb-calc .teb-tab {
  flex: 1;
  padding: 12px 10px;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--mid);
  cursor: pointer;
  border: none;
  background: transparent;
  border-radius: 10px 10px 0 0;
  position: relative;
  transition: all 0.2s;
  line-height: 1.4;
  margin-bottom: -1px;
}
#teb-calc .teb-tab.teb-active {
  color: var(--sky-d);
  background: var(--white);
  border: 1px solid var(--border);
  border-bottom-color: var(--white);
  font-weight: 600;
}
#teb-calc .teb-tab:hover:not(.teb-active) {
  background: rgba(56,189,248,0.06);
  color: var(--sky-d);
}

/* ── BODY ── */
#teb-calc .teb-body {
  background: var(--white);
  padding: 36px 40px;
}
#teb-calc .teb-panel { display: none; }
#teb-calc .teb-panel.teb-active { display: block; }

/* ── GRID ── */
#teb-calc .teb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* ── FIELD ── */
#teb-calc .teb-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#teb-calc .teb-field label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--slate);
  display: block;
  margin: 0;
  padding: 0;
}
#teb-calc .teb-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
#teb-calc .teb-input {
  flex: 1;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  color: var(--dark);
  background: var(--light);
  outline: none;
  width: 100%;
  box-shadow: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -moz-appearance: textfield;
  height: auto;
  margin: 0;
}
#teb-calc .teb-input::-webkit-outer-spin-button,
#teb-calc .teb-input::-webkit-inner-spin-button { -webkit-appearance: none; }
#teb-calc .teb-input::placeholder { color: var(--muted); }
#teb-calc .teb-input:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.15);
  background: var(--white);
  outline: none;
}
#teb-calc .teb-unit {
  padding: 0 16px;
  background: var(--sky-l);
  border: 1.5px solid var(--border-a);
  border-radius: var(--r-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sky-d);
  white-space: nowrap;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ── BUTTON ── */
#teb-calc .teb-btn {
  display: block;
  width: 100%;
  padding: 15px 24px;
  background: var(--grad);
  color: var(--white);
  border: none;
  border-radius: var(--r-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.97rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  margin: 0 0 24px 0;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.01em;
  box-shadow: var(--sh-btn);
  line-height: 1;
  text-transform: none;
}
#teb-calc .teb-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(56,189,248,0.4);
  color: var(--white);
  text-decoration: none;
}
#teb-calc .teb-btn:active { transform: none; }

/* ── RESULT ── */
#teb-calc .teb-result {
  display: none;
  background: var(--sky-xl);
  border: 1px solid var(--border-a);
  border-radius: var(--r);
  padding: 24px;
}
#teb-calc .teb-result.teb-show {
  display: block;
  animation: tebFade 0.3s ease;
}
@keyframes tebFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
#teb-calc .teb-res-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sky-d);
  font-weight: 600;
  margin-bottom: 16px;
}
#teb-calc .teb-res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}
#teb-calc .teb-res-item {
  text-align: center;
  padding: 18px 10px;
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--border-a);
  box-shadow: var(--sh-sm);
}
#teb-calc .teb-res-val {
  display: block;
  font-family: 'Fraunces', serif;
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--sky-d);
  line-height: 1.1;
  margin-bottom: 5px;
  letter-spacing: -0.02em;
}
#teb-calc .teb-res-name {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
#teb-calc .teb-res-note {
  margin-top: 16px;
  font-size: 0.79rem;
  color: var(--mid);
  text-align: center;
  border-top: 1px solid var(--border-a);
  padding-top: 14px;
}

/* ── TABLE ── */
#teb-calc .teb-table-wrap {
  background: var(--white);
  border-top: 1px solid var(--border);
}
#teb-calc .teb-table-head {
  background: var(--light);
  color: var(--slate);
  padding: 16px 24px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
#teb-calc .teb-scroll { overflow-x: auto; }
#teb-calc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
#teb-calc table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--mid);
  background: var(--light);
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
  margin: 0;
}
#teb-calc table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--slate);
  margin: 0;
}
#teb-calc table td:first-child { font-weight: 600; color: var(--dark); }
#teb-calc table td:nth-child(2) { color: var(--sky-d); font-weight: 500; }
#teb-calc table tr:last-child td { border-bottom: none; }
#teb-calc table tr.teb-hl td { background: var(--sky-xl); }
#teb-calc table tr:hover td { background: var(--teal-l); }

#teb-calc .teb-badge-lvl {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.69rem;
  font-weight: 600;
}
#teb-calc .teb-b1 { background: #ECFDF5; color: #059669; border: 1px solid #A7F3D0; }
#teb-calc .teb-b2 { background: var(--sky-l); color: var(--sky-d); border: 1px solid rgba(56,189,248,0.3); }
#teb-calc .teb-b3 { background: var(--teal-l); color: var(--teal-d); border: 1px solid rgba(45,212,191,0.3); }
#teb-calc .teb-b4 { background: #F0F9FF; color: #0369A1; border: 1px solid rgba(14,165,233,0.3); }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  #teb-calc .teb-grid { grid-template-columns: 1fr; }
  #teb-calc .teb-body { padding: 24px 20px; }
  #teb-calc .teb-hero { padding: 32px 20px 28px; }
  #teb-calc .teb-tab { font-size: 0.73rem; padding: 10px 6px; }
  #teb-calc .teb-title { font-size: 1.7rem !important; }
  #teb-calc .teb-tabs { padding: 4px 4px 0; }
}
